diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e8285b71..4f9005ea 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.5" + ".": "0.1.0-alpha.6" } \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index b5329c39..d541e936 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -118,17 +118,16 @@ Metrics/ParameterLists: Metrics/PerceivedComplexity: Enabled: false +# Need to preserve block identifier for documentation. Naming/BlockForwarding: - Exclude: - - "**/*.rbi" + Enabled: false Naming/ClassAndModuleCamelCase: Exclude: - "**/*.rbi" Naming/MethodParameterName: - Exclude: - - "**/*.rbi" + Enabled: false Naming/PredicateName: Exclude: @@ -153,6 +152,9 @@ Style/Alias: Style/AndOr: EnforcedStyle: always +Style/ArgumentsForwarding: + Enabled: false + Style/BisectedAttrAccessor: Exclude: - "**/*.rbi" @@ -235,6 +237,10 @@ Style/RegexpLiteral: Style/SafeNavigation: Enabled: false +Style/SignalException: + Exclude: + - Rakefile + # We use these sparingly, where we anticipate future branches for the # inner conditional. Style/SoleNestedConditional: diff --git a/.stats.yml b/.stats.yml index 66cac5a2..05cd9fbf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-3224f142ed1542ed2535c155e8eb23b7ea10470c12448d60c3ce584126073a93.yml -openapi_spec_hash: 6c4b213ed5e4f7d1b369e04e4bfb5164 -config_hash: 8303e755d3e16cf28542d5f0aec83851 +configured_endpoints: 46 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-14d375aab89e6b212fe459805a42d6ea7d7da8eae2037ae710a187d06911be1d.yml +openapi_spec_hash: 08b86ecbec3323717d48e4aaee48ed54 +config_hash: 2bca9e6b32f742acb077cf8822ec9e23 diff --git a/.yardopts b/.yardopts index c7c3301d..004c697b 100644 --- a/.yardopts +++ b/.yardopts @@ -1,3 +1,4 @@ --markup markdown +--markup-provider redcarpet --exclude /rbi --exclude /sig diff --git a/CHANGELOG.md b/CHANGELOG.md index f4c1daa9..351a0b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # Changelog +## 0.1.0-alpha.6 (2025-04-04) + +Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.5...v0.1.0-alpha.6) + +### ⚠ BREAKING CHANGES + +* bump min supported ruby version to 3.1 (oldest non-EOL) ([#105](https://github.com/Finch-API/finch-api-ruby/issues/105)) +* remove top level type aliases to relocated classes ([#104](https://github.com/Finch-API/finch-api-ruby/issues/104)) +* use descriptive prefixes for enum names that start with otherwise illegal identifiers ([#102](https://github.com/Finch-API/finch-api-ruby/issues/102)) + +### Features + +* add reference links in yard ([#91](https://github.com/Finch-API/finch-api-ruby/issues/91)) ([00d19d9](https://github.com/Finch-API/finch-api-ruby/commit/00d19d904112c859a8bfdbdcbd6bff77c8a690c2)) +* **api:** add new endpoints for pay statement items ([#111](https://github.com/Finch-API/finch-api-ruby/issues/111)) ([ad6dda6](https://github.com/Finch-API/finch-api-ruby/commit/ad6dda6260a68c923b8d9ef792be29cc91e3a793)) +* **api:** api update ([#101](https://github.com/Finch-API/finch-api-ruby/issues/101)) ([7aec958](https://github.com/Finch-API/finch-api-ruby/commit/7aec9585751d4a5a3d5abe354ba55b80e74d5cd9)) +* **api:** api update ([#94](https://github.com/Finch-API/finch-api-ruby/issues/94)) ([3ed684f](https://github.com/Finch-API/finch-api-ruby/commit/3ed684fe7a74c9e6c14b370deb3656cf732ec5aa)) +* **api:** api update ([#95](https://github.com/Finch-API/finch-api-ruby/issues/95)) ([d683fa6](https://github.com/Finch-API/finch-api-ruby/commit/d683fa626a563cfd2278eca354daab3866aa163d)) +* **api:** manual updates ([#112](https://github.com/Finch-API/finch-api-ruby/issues/112)) ([e2e7efb](https://github.com/Finch-API/finch-api-ruby/commit/e2e7efb47b063d3bb88708fb6b3cafe80b4ed6af)) +* bump min supported ruby version to 3.1 (oldest non-EOL) ([#105](https://github.com/Finch-API/finch-api-ruby/issues/105)) ([61d708b](https://github.com/Finch-API/finch-api-ruby/commit/61d708b8e76774d4c805738e550e5e5670aac7e7)) +* implement `to_json` for base model ([#99](https://github.com/Finch-API/finch-api-ruby/issues/99)) ([09448dc](https://github.com/Finch-API/finch-api-ruby/commit/09448dc9ff39e3293cb8331f35ccd5a503a02754)) +* link response models to their methods in yard doc ([#93](https://github.com/Finch-API/finch-api-ruby/issues/93)) ([c9498b8](https://github.com/Finch-API/finch-api-ruby/commit/c9498b8396331ab6b67b71fbb765770f7593dc6d)) +* remove top level type aliases to relocated classes ([#104](https://github.com/Finch-API/finch-api-ruby/issues/104)) ([59abb7e](https://github.com/Finch-API/finch-api-ruby/commit/59abb7e7fe034573530ba32cbd17161333a52422)) +* support solargraph generics ([#108](https://github.com/Finch-API/finch-api-ruby/issues/108)) ([a9a77bd](https://github.com/Finch-API/finch-api-ruby/commit/a9a77bdc826b05c7698a92551fa29df578d836c2)) + + +### Bug Fixes + +* path interpolation template strings ([#90](https://github.com/Finch-API/finch-api-ruby/issues/90)) ([9cbfb2b](https://github.com/Finch-API/finch-api-ruby/commit/9cbfb2bfd665967e0137b221a4f068b6b02c83be)) +* pre-release version string should match ruby, not semver conventions ([#107](https://github.com/Finch-API/finch-api-ruby/issues/107)) ([72c823b](https://github.com/Finch-API/finch-api-ruby/commit/72c823b4c032706dd1a45ebb062116ef56ff53f3)) +* switch to github compatible markdown engine ([#87](https://github.com/Finch-API/finch-api-ruby/issues/87)) ([3f84336](https://github.com/Finch-API/finch-api-ruby/commit/3f84336be69f9d27b503329e397511edba980cae)) +* use descriptive prefixes for enum names that start with otherwise illegal identifiers ([#102](https://github.com/Finch-API/finch-api-ruby/issues/102)) ([4e15ab3](https://github.com/Finch-API/finch-api-ruby/commit/4e15ab3bfa3ae7d695b35ac64901cf9835721ac9)) + + +### Chores + +* demonstrate how to make undocumented requests in README ([#106](https://github.com/Finch-API/finch-api-ruby/issues/106)) ([c316243](https://github.com/Finch-API/finch-api-ruby/commit/c316243d7f4a6b2b94f88779457fcbcff8ab6eb3)) +* do not use literals for version in type definitions ([#109](https://github.com/Finch-API/finch-api-ruby/issues/109)) ([cdb9530](https://github.com/Finch-API/finch-api-ruby/commit/cdb9530afe28b75425acb6f8ee075d368a365320)) +* extract error classes into own module ([#100](https://github.com/Finch-API/finch-api-ruby/issues/100)) ([82f6f32](https://github.com/Finch-API/finch-api-ruby/commit/82f6f32c6f060e5b5b7a8134aafd92c9f0c92f12)) +* fix misc rubocop errors ([#88](https://github.com/Finch-API/finch-api-ruby/issues/88)) ([369e17b](https://github.com/Finch-API/finch-api-ruby/commit/369e17b85d9cf01d61a0daefdda0af03e7c4e11b)) +* improve yard docs readability ([#92](https://github.com/Finch-API/finch-api-ruby/issues/92)) ([621ca2a](https://github.com/Finch-API/finch-api-ruby/commit/621ca2a7a4646d6ded45f0d2c0851a749c860a80)) +* **internal:** codegen related update ([#96](https://github.com/Finch-API/finch-api-ruby/issues/96)) ([a479855](https://github.com/Finch-API/finch-api-ruby/commit/a47985553f6e4bf93a30cdd5e046a8e6019c8496)) +* **internal:** version bump ([#85](https://github.com/Finch-API/finch-api-ruby/issues/85)) ([fb6870a](https://github.com/Finch-API/finch-api-ruby/commit/fb6870a0610b580e715c8011213996cfffe83d0f)) +* move private classes into internal module ([#103](https://github.com/Finch-API/finch-api-ruby/issues/103)) ([ed3b639](https://github.com/Finch-API/finch-api-ruby/commit/ed3b6395d8dceb2edcecfb496c2ab046ef89ea88)) +* order client variables by "importance" ([#98](https://github.com/Finch-API/finch-api-ruby/issues/98)) ([dcab107](https://github.com/Finch-API/finch-api-ruby/commit/dcab10772b4b55072685efd5602908ac52b968c2)) +* relax sorbet enum parameters to allow `String` in addition to `Symbol` ([#97](https://github.com/Finch-API/finch-api-ruby/issues/97)) ([93128b8](https://github.com/Finch-API/finch-api-ruby/commit/93128b8e9d88e9e470559452f0d3aa7f578a81aa)) +* use fully qualified name in sorbet README example ([#89](https://github.com/Finch-API/finch-api-ruby/issues/89)) ([bc9989c](https://github.com/Finch-API/finch-api-ruby/commit/bc9989c9f0a531a754d35829d454a9265b4524bf)) +* use package name for gemspec ([#110](https://github.com/Finch-API/finch-api-ruby/issues/110)) ([9f6eebe](https://github.com/Finch-API/finch-api-ruby/commit/9f6eebe7df319daed6f7135185cc96bc99273a4a)) + ## 0.1.0-alpha.5 (2025-03-31) Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) diff --git a/Gemfile b/Gemfile index b064fc5a..e5ec01e9 100644 --- a/Gemfile +++ b/Gemfile @@ -5,12 +5,6 @@ source "https://rubygems.org" gemspec group :development do - gem "async" - gem "minitest" - gem "minitest-focus" - gem "minitest-hooks" - gem "minitest-proveit" - gem "minitest-rg" gem "rake" gem "rbs" gem "rubocop" @@ -20,6 +14,19 @@ group :development do # TODO: using a fork for now, the prettier below has a bug gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main" gem "tapioca" +end + +group :development, :test do + gem "async" + gem "minitest" + gem "minitest-focus" + gem "minitest-hooks" + gem "minitest-proveit" + gem "minitest-rg" +end + +group :development, :docs do + gem "redcarpet" gem "webrick" gem "yard" end diff --git a/Gemfile.lock b/Gemfile.lock index 87366e02..81912370 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,8 +29,8 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - ast (2.4.2) - async (2.23.0) + ast (2.4.3) + async (2.23.1) console (~> 1.29) fiber-annotation io-event (~> 1.9) @@ -41,11 +41,11 @@ GEM bigdecimal (3.1.9) concurrent-ruby (1.3.5) connection_pool (2.5.0) - console (1.29.3) + console (1.30.2) fiber-annotation fiber-local (~> 1.1) json - csv (3.3.2) + csv (3.3.3) drb (2.2.1) erubi (1.13.1) ffi (1.17.1) @@ -56,16 +56,16 @@ GEM fileutils (1.7.3) i18n (1.14.7) concurrent-ruby (~> 1.0) - io-event (1.9.0) - json (2.10.1) + io-event (1.10.0) + json (2.10.2) language_server-protocol (3.17.0.4) lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.6) - metrics (0.12.1) - minitest (5.25.4) + logger (1.7.0) + metrics (0.12.2) + minitest (5.25.5) minitest-focus (1.4.0) minitest (>= 4, < 6) minitest-hooks (1.5.2) @@ -74,26 +74,29 @@ GEM minitest (> 5, < 7) minitest-rg (5.3.0) minitest (~> 5.0) + mutex_m (0.3.0) netrc (0.11.0) parallel (1.26.3) - parser (3.3.7.1) + parser (3.3.7.4) ast (~> 2.4.1) racc prettier_print (1.2.1) - prism (1.3.0) + prism (1.4.0) racc (1.8.1) rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbi (0.2.4) + rbi (0.3.1) prism (~> 1.0) + rbs (>= 3.4.4) sorbet-runtime (>= 0.5.9204) - rbs (3.8.1) + rbs (3.9.2) logger + redcarpet (3.6.1) regexp_parser (2.10.0) - rubocop (1.73.2) + rubocop (1.75.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -101,41 +104,43 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.43.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.1) - parser (>= 3.3.1.0) + rubocop-ast (1.43.0) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) - 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) + sorbet (0.5.11966) + sorbet-static (= 0.5.11966) + sorbet-runtime (0.5.11966) + sorbet-static (0.5.11966-x86_64-linux) + sorbet-static-and-runtime (0.5.11966) + sorbet (= 0.5.11966) + sorbet-runtime (= 0.5.11966) + spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) rbi (>= 0.2.3) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - steep (1.9.4) + steep (1.10.0) activesupport (>= 5.1) concurrent-ruby (>= 1.1.10) csv (>= 3.0.9) fileutils (>= 1.1.0) json (>= 2.1.0) - language_server-protocol (>= 3.15, < 4.0) + language_server-protocol (>= 3.17.0.4, < 4.0) listen (~> 3.0) logger (>= 1.3.0) + mutex_m (>= 0.3.0) parser (>= 3.1) rainbow (>= 2.2.2, < 4.0) - rbs (~> 3.8) + rbs (~> 3.9) securerandom (>= 0.1) strscan (>= 1.0.0) - terminal-table (>= 2, < 4) + terminal-table (>= 2, < 5) uri (>= 0.12.0) strscan (3.1.2) syntax_tree (6.2.0) @@ -150,13 +155,15 @@ GEM spoom (>= 1.2.0) thor (>= 1.2.0) yard-sorbet - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) thor (1.3.2) traces (0.15.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.6.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) uri (1.0.3) webrick (1.9.1) yard (0.9.37) @@ -177,6 +184,7 @@ DEPENDENCIES minitest-rg rake rbs + redcarpet rubocop sorbet steep diff --git a/README.md b/README.md index da382342..62588788 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 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.1.0+ application. It is generated with [Stainless](https://www.stainless.com/). @@ -14,10 +14,14 @@ The underlying REST API documentation can be found on [developer.tryfinch.com](h To use this gem, install via Bundler by adding the following to your application's `Gemfile`: + + ```ruby -gem "finch-api", "~> 0.1.0.pre.alpha.4" +gem "finch-api", "~> 0.1.0.pre.alpha.5" ``` + + To fetch an initial copy of the gem: ```sh @@ -63,7 +67,7 @@ When the library is unable to connect to the API, or if the API returns a non-su ```ruby begin company = finch.hris.company.retrieve -rescue FinchAPI::Error => e +rescue FinchAPI::Errors::APIError => e puts(e.status) # 400 end ``` @@ -79,7 +83,7 @@ Error codes are as followed: | HTTP 409 | `ConflictError` | | HTTP 422 | `UnprocessableEntityError` | | HTTP 429 | `RateLimitError` | -| HTTP >=500 | `InternalServerError` | +| HTTP >= 500 | `InternalServerError` | | Other HTTP error | `APIStatusError` | | Timeout | `APITimeoutError` | | Network error | `APIConnectionError` | @@ -120,7 +124,9 @@ finch = FinchAPI::Client.new( finch.hris.directory.list(request_options: {timeout: 5}) ``` -## Sorbet Support +## LSP Support + +### Sorbet **This library emits an intentional warning under the [`tapioca` toolchain](https://github.com/Shopify/tapioca)**. This is normal, and does not impact functionality. @@ -133,13 +139,38 @@ Due to limitations with the Sorbet type system, where a method otherwise can tak Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience. ```ruby -model = DirectoryListParams.new +model = FinchAPI::Models::HRIS::DirectoryListParams.new finch.hris.directory.list(**model) ``` ## Advanced +### Making custom/undocumented requests + +This library is typed for convenient access to the documented API. + +If you need to access undocumented endpoints, params, or response properties, the library can still be used. + +#### Undocumented request params + +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a requests as seen in examples above. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can make requests using `client.request`. Options on the client will be respected (such as retries) when making this request. + +```ruby +response = + client.request( + method: :post, + path: '/undocumented/endpoint', + query: {"dog": "woof"}, + headers: {"useful-header": "interesting-value"}, + body: {"he": "llo"}, + ) +``` + ### 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. @@ -158,4 +189,4 @@ This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` typ ## Requirements -Ruby 3.0.0 or higher. +Ruby 3.1.0 or higher. diff --git a/Rakefile b/Rakefile index 9dd35599..05cf5887 100644 --- a/Rakefile +++ b/Rakefile @@ -14,7 +14,7 @@ xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] multitask(default: [:test]) multitask(:test) do - rb = + rb = FileList[ENV.fetch("TEST", "./test/**/*_test.rb")] .map { "require_relative(#{_1.dump});" } .join @@ -87,9 +87,9 @@ multitask(typecheck: [:steep, :sorbet]) multitask(lint: [:rubocop, :typecheck]) multitask(:build) do - sh(*%w[gem build -- finch-api.gemspec]) + sh(*%w[gem build -- finch_api.gemspec]) end multitask(release: [:build]) do - sh(*%w[gem push], *FileList["finch-api-*.gem"]) + sh(*%w[gem push], *FileList["finch_api-*.gem"]) end diff --git a/Steepfile b/Steepfile index 48667fe7..6e5d0ac5 100644 --- a/Steepfile +++ b/Steepfile @@ -9,7 +9,7 @@ target :lib do YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => { dependencies: } # currently these libraries lack the `*.rbs` annotations required by `steep` - stdlibs = dependencies - %w[etc net/http rbconfig set stringio] + stdlibs = dependencies - %w[English etc net/http rbconfig set stringio] stdlibs.each { library(_1) } end diff --git a/finch-api.gemspec b/finch_api.gemspec similarity index 94% rename from finch-api.gemspec rename to finch_api.gemspec index e3cc699a..50ab3acb 100644 --- a/finch-api.gemspec +++ b/finch_api.gemspec @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "lib/finch-api/version" +require_relative "lib/finch_api/version" Gem::Specification.new do |s| s.name = "finch-api" diff --git a/lib/finch-api.rb b/lib/finch-api.rb deleted file mode 100644 index 66b7eb27..00000000 --- a/lib/finch-api.rb +++ /dev/null @@ -1,203 +0,0 @@ -# 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.chain([$0]).chain(ARGV).grep(/tapioca/) - 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" -require "erb" -require "etc" -require "json" -require "net/http" -require "pathname" -require "rbconfig" -require "securerandom" -require "set" -require "stringio" -require "time" -require "uri" - -# Gems. -require "connection_pool" - -# Package files. -require_relative "finch-api/version" -require_relative "finch-api/util" -require_relative "finch-api/type/converter" -require_relative "finch-api/type/unknown" -require_relative "finch-api/type/boolean_model" -require_relative "finch-api/type/enum" -require_relative "finch-api/type/union" -require_relative "finch-api/type/array_of" -require_relative "finch-api/type/hash_of" -require_relative "finch-api/type/base_model" -require_relative "finch-api/type/base_page" -require_relative "finch-api/type/request_parameters" -require_relative "finch-api/type" -require_relative "finch-api/request_options" -require_relative "finch-api/errors" -require_relative "finch-api/transport/base_client" -require_relative "finch-api/transport/pooled_net_requester" -require_relative "finch-api/client" -require_relative "finch-api/individuals_page" -require_relative "finch-api/page" -require_relative "finch-api/responses_page" -require_relative "finch-api/single_page" -require_relative "finch-api/models/base_webhook_event" -require_relative "finch-api/models/hris/benefit_contribution" -require_relative "finch-api/models/sandbox/jobs/sandbox_job_configuration" -require_relative "finch-api/models/access_token_create_params" -require_relative "finch-api/models/account_disconnect_params" -require_relative "finch-api/models/account_introspect_params" -require_relative "finch-api/models/account_update_event" -require_relative "finch-api/models/company_event" -require_relative "finch-api/models/connect/session_new_params" -require_relative "finch-api/models/connect/session_new_response" -require_relative "finch-api/models/connect/session_reauthenticate_params" -require_relative "finch-api/models/connect/session_reauthenticate_response" -require_relative "finch-api/models/connection_status_type" -require_relative "finch-api/models/create_access_token_response" -require_relative "finch-api/models/directory_event" -require_relative "finch-api/models/disconnect_response" -require_relative "finch-api/models/employment_event" -require_relative "finch-api/models/hris/benefit_create_params" -require_relative "finch-api/models/hris/benefit_features_and_operations" -require_relative "finch-api/models/hris/benefit_frequency" -require_relative "finch-api/models/hris/benefit_list_params" -require_relative "finch-api/models/hris/benefit_list_supported_benefits_params" -require_relative "finch-api/models/hris/benefit_retrieve_params" -require_relative "finch-api/models/hris/benefits/enrolled_individual" -require_relative "finch-api/models/hris/benefits/individual_benefit" -require_relative "finch-api/models/hris/benefits/individual_enrolled_ids_params" -require_relative "finch-api/models/hris/benefits/individual_enrolled_ids_response" -require_relative "finch-api/models/hris/benefits/individual_enroll_many_params" -require_relative "finch-api/models/hris/benefits/individual_retrieve_many_benefits_params" -require_relative "finch-api/models/hris/benefits/individual_unenroll_many_params" -require_relative "finch-api/models/hris/benefits/unenrolled_individual" -require_relative "finch-api/models/hris/benefits_support" -require_relative "finch-api/models/hris/benefit_type" -require_relative "finch-api/models/hris/benefit_update_params" -require_relative "finch-api/models/hris/benfit_contribution" -require_relative "finch-api/models/hris/company_benefit" -require_relative "finch-api/models/hris/company_retrieve_params" -require_relative "finch-api/models/hris/create_company_benefits_response" -require_relative "finch-api/models/hris/directory_list_individuals_params" -require_relative "finch-api/models/hris/directory_list_params" -require_relative "finch-api/models/hris/document_list_params" -require_relative "finch-api/models/hris/document_list_response" -require_relative "finch-api/models/hris/document_response" -require_relative "finch-api/models/hris/document_retreive_params" -require_relative "finch-api/models/hris/document_retreive_response" -require_relative "finch-api/models/hris/employment_data" -require_relative "finch-api/models/hris/employment_data_response" -require_relative "finch-api/models/hris/employment_retrieve_many_params" -require_relative "finch-api/models/hris/company" -require_relative "finch-api/models/hris/individual" -require_relative "finch-api/models/hris/individual_in_directory" -require_relative "finch-api/models/hris/individual_response" -require_relative "finch-api/models/hris/individual_retrieve_many_params" -require_relative "finch-api/models/hris/payment" -require_relative "finch-api/models/hris/payment_list_params" -require_relative "finch-api/models/hris/pay_statement" -require_relative "finch-api/models/hris/pay_statement_response" -require_relative "finch-api/models/hris/pay_statement_response_body" -require_relative "finch-api/models/hris/pay_statement_retrieve_many_params" -require_relative "finch-api/models/hris/supported_benefit" -require_relative "finch-api/models/hris/support_per_benefit_type" -require_relative "finch-api/models/hris/update_company_benefit_response" -require_relative "finch-api/models/hris/w42005" -require_relative "finch-api/models/hris/w42020" -require_relative "finch-api/models/income" -require_relative "finch-api/models/individual_event" -require_relative "finch-api/models/introspection" -require_relative "finch-api/models/job_completion_event" -require_relative "finch-api/models/jobs/automated_async_job" -require_relative "finch-api/models/jobs/automated_create_params" -require_relative "finch-api/models/jobs/automated_create_response" -require_relative "finch-api/models/jobs/automated_list_params" -require_relative "finch-api/models/jobs/automated_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" -require_relative "finch-api/models/location" -require_relative "finch-api/models/money" -require_relative "finch-api/models/operation_support" -require_relative "finch-api/models/operation_support_matrix" -require_relative "finch-api/models/paging" -require_relative "finch-api/models/payment_event" -require_relative "finch-api/models/payroll/pay_group_list_params" -require_relative "finch-api/models/payroll/pay_group_list_response" -require_relative "finch-api/models/payroll/pay_group_retrieve_params" -require_relative "finch-api/models/payroll/pay_group_retrieve_response" -require_relative "finch-api/models/pay_statement_event" -require_relative "finch-api/models/provider" -require_relative "finch-api/models/provider_list_params" -require_relative "finch-api/models/request_forwarding_forward_params" -require_relative "finch-api/models/request_forwarding_forward_response" -require_relative "finch-api/models/sandbox/company_update_params" -require_relative "finch-api/models/sandbox/company_update_response" -require_relative "finch-api/models/sandbox/connection_create_params" -require_relative "finch-api/models/sandbox/connection_create_response" -require_relative "finch-api/models/sandbox/connections/account_create_params" -require_relative "finch-api/models/sandbox/connections/account_create_response" -require_relative "finch-api/models/sandbox/connections/account_update_params" -require_relative "finch-api/models/sandbox/connections/account_update_response" -require_relative "finch-api/models/sandbox/directory_create_params" -require_relative "finch-api/models/sandbox/directory_create_response" -require_relative "finch-api/models/sandbox/employment_update_params" -require_relative "finch-api/models/sandbox/employment_update_response" -require_relative "finch-api/models/sandbox/individual_update_params" -require_relative "finch-api/models/sandbox/individual_update_response" -require_relative "finch-api/models/sandbox/job_create_params" -require_relative "finch-api/models/sandbox/job_create_response" -require_relative "finch-api/models/sandbox/jobs/configuration_retrieve_params" -require_relative "finch-api/models/sandbox/jobs/configuration_retrieve_response" -require_relative "finch-api/models/sandbox/jobs/configuration_update_params" -require_relative "finch-api/models/sandbox/payment_create_params" -require_relative "finch-api/models/sandbox/payment_create_response" -require_relative "finch-api/models/webhook_event" -require_relative "finch-api/resources/access_tokens" -require_relative "finch-api/resources/account" -require_relative "finch-api/resources/connect" -require_relative "finch-api/resources/connect/sessions" -require_relative "finch-api/resources/hris" -require_relative "finch-api/resources/hris/benefits" -require_relative "finch-api/resources/hris/benefits/individuals" -require_relative "finch-api/resources/hris/company" -require_relative "finch-api/resources/hris/directory" -require_relative "finch-api/resources/hris/documents" -require_relative "finch-api/resources/hris/employments" -require_relative "finch-api/resources/hris/individuals" -require_relative "finch-api/resources/hris/payments" -require_relative "finch-api/resources/hris/pay_statements" -require_relative "finch-api/resources/jobs" -require_relative "finch-api/resources/jobs/automated" -require_relative "finch-api/resources/jobs/manual" -require_relative "finch-api/resources/payroll" -require_relative "finch-api/resources/payroll/pay_groups" -require_relative "finch-api/resources/providers" -require_relative "finch-api/resources/request_forwarding" -require_relative "finch-api/resources/sandbox" -require_relative "finch-api/resources/sandbox/company" -require_relative "finch-api/resources/sandbox/connections" -require_relative "finch-api/resources/sandbox/connections/accounts" -require_relative "finch-api/resources/sandbox/directory" -require_relative "finch-api/resources/sandbox/employment" -require_relative "finch-api/resources/sandbox/individual" -require_relative "finch-api/resources/sandbox/jobs" -require_relative "finch-api/resources/sandbox/jobs/configuration" -require_relative "finch-api/resources/sandbox/payment" -require_relative "finch-api/resources/webhooks" diff --git a/lib/finch-api/errors.rb b/lib/finch-api/errors.rb deleted file mode 100644 index 48e69e6f..00000000 --- a/lib/finch-api/errors.rb +++ /dev/null @@ -1,183 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - class Error < StandardError - # @!parse - # # @return [StandardError, nil] - # attr_accessor :cause - end - - class ConversionError < FinchAPI::Error - end - - class APIError < FinchAPI::Error - # @return [URI::Generic] - attr_accessor :url - - # @return [Integer, nil] - attr_accessor :status - - # @return [Object, nil] - attr_accessor :body - - # @api private - # - # @param url [URI::Generic] - # @param status [Integer, nil] - # @param body [Object, nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) - @url = url - @status = status - @body = body - @request = request - @response = response - super(message) - end - end - - class APIConnectionError < FinchAPI::APIError - # @!parse - # # @return [nil] - # attr_accessor :status - - # @!parse - # # @return [nil] - # attr_accessor :body - - # @api private - # - # @param url [URI::Generic] - # @param status [nil] - # @param body [nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize( - url:, - status: nil, - body: nil, - request: nil, - response: nil, - message: "Connection error." - ) - super - end - end - - class APITimeoutError < FinchAPI::APIConnectionError - # @api private - # - # @param url [URI::Generic] - # @param status [nil] - # @param body [nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize( - url:, - status: nil, - body: nil, - request: nil, - response: nil, - message: "Request timed out." - ) - super - end - end - - class APIStatusError < FinchAPI::APIError - # @api private - # - # @param url [URI::Generic] - # @param status [Integer] - # @param body [Object, nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - # - # @return [FinchAPI::APIStatusError] - def self.for(url:, status:, body:, request:, response:, message: nil) - kwargs = {url: url, status: status, body: body, request: request, response: response, message: message} - - case status - in 400 - FinchAPI::BadRequestError.new(**kwargs) - in 401 - FinchAPI::AuthenticationError.new(**kwargs) - in 403 - FinchAPI::PermissionDeniedError.new(**kwargs) - in 404 - FinchAPI::NotFoundError.new(**kwargs) - in 409 - FinchAPI::ConflictError.new(**kwargs) - in 422 - FinchAPI::UnprocessableEntityError.new(**kwargs) - in 429 - FinchAPI::RateLimitError.new(**kwargs) - in (500..) - FinchAPI::InternalServerError.new(**kwargs) - else - FinchAPI::APIStatusError.new(**kwargs) - end - end - - # @!parse - # # @return [Integer] - # attr_accessor :status - - # @api private - # - # @param url [URI::Generic] - # @param status [Integer] - # @param body [Object, nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize(url:, status:, body:, request:, response:, message: nil) - message ||= {url: url.to_s, status: status, body: body} - super( - url: url, - status: status, - body: body, - request: request, - response: response, - message: message&.to_s - ) - end - end - - class BadRequestError < FinchAPI::APIStatusError - HTTP_STATUS = 400 - end - - class AuthenticationError < FinchAPI::APIStatusError - HTTP_STATUS = 401 - end - - class PermissionDeniedError < FinchAPI::APIStatusError - HTTP_STATUS = 403 - end - - class NotFoundError < FinchAPI::APIStatusError - HTTP_STATUS = 404 - end - - class ConflictError < FinchAPI::APIStatusError - HTTP_STATUS = 409 - end - - class UnprocessableEntityError < FinchAPI::APIStatusError - HTTP_STATUS = 422 - end - - class RateLimitError < FinchAPI::APIStatusError - HTTP_STATUS = 429 - end - - class InternalServerError < FinchAPI::APIStatusError - HTTP_STATUS = (500..) - end -end diff --git a/lib/finch-api/individuals_page.rb b/lib/finch-api/individuals_page.rb deleted file mode 100644 index 90849b22..00000000 --- a/lib/finch-api/individuals_page.rb +++ /dev/null @@ -1,92 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - # @example - # if individuals_page.has_next? - # individuals_page = individuals_page.next_page - # end - # - # @example - # individuals_page.auto_paging_each do |directory| - # puts(directory) - # end - # - # @example - # directories = - # individuals_page - # .to_enum - # .lazy - # .select { _1.object_id.even? } - # .map(&:itself) - # .take(2) - # .to_a - # - # directories => Array - class IndividualsPage - include FinchAPI::Type::BasePage - - # @return [Array, nil] - attr_accessor :individuals - - # @return [FinchAPI::Models::Paging] - attr_accessor :paging - - # @api private - # - # @param client [FinchAPI::Transport::BaseClient] - # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] - # @param page_data [Hash{Symbol=>Object}] - def initialize(client:, req:, headers:, page_data:) - super - model = req.fetch(:model) - - case page_data - in {individuals: Array | nil => individuals} - @individuals = individuals&.map { FinchAPI::Type::Converter.coerce(model, _1) } - else - end - - case page_data - in {paging: Hash | nil => paging} - @paging = FinchAPI::Type::Converter.coerce(FinchAPI::Models::Paging, paging) - else - end - end - - # @return [Boolean] - def next_page? - 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? - 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.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 ##{__method__}") - end - page = self - loop do - page.individuals&.each { blk.call(_1) } - break unless page.next_page? - page = page.next_page - end - end - - # @return [String] - def inspect - "#<#{self.class}:0x#{object_id.to_s(16)} individuals=#{individuals.inspect} paging=#{paging.inspect}>" - end - end -end diff --git a/lib/finch-api/models/account_disconnect_params.rb b/lib/finch-api/models/account_disconnect_params.rb deleted file mode 100644 index e8810332..00000000 --- a/lib/finch-api/models/account_disconnect_params.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - class AccountDisconnectParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end -end diff --git a/lib/finch-api/models/account_introspect_params.rb b/lib/finch-api/models/account_introspect_params.rb deleted file mode 100644 index cbdbb052..00000000 --- a/lib/finch-api/models/account_introspect_params.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - class AccountIntrospectParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end -end diff --git a/lib/finch-api/models/hris/benefit_list_params.rb b/lib/finch-api/models/hris/benefit_list_params.rb deleted file mode 100644 index df51bff0..00000000 --- a/lib/finch-api/models/hris/benefit_list_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module HRIS - class BenefitListParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb b/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb deleted file mode 100644 index d8f351bf..00000000 --- a/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module HRIS - class BenefitListSupportedBenefitsParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/hris/benefit_retrieve_params.rb b/lib/finch-api/models/hris/benefit_retrieve_params.rb deleted file mode 100644 index a859e0c2..00000000 --- a/lib/finch-api/models/hris/benefit_retrieve_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module HRIS - class BenefitRetrieveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb b/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb deleted file mode 100644 index 92171811..00000000 --- a/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module HRIS - module Benefits - class IndividualEnrolledIDsParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end - end -end diff --git a/lib/finch-api/models/hris/company_retrieve_params.rb b/lib/finch-api/models/hris/company_retrieve_params.rb deleted file mode 100644 index b1469611..00000000 --- a/lib/finch-api/models/hris/company_retrieve_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module HRIS - class CompanyRetrieveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/hris/document_retreive_params.rb b/lib/finch-api/models/hris/document_retreive_params.rb deleted file mode 100644 index 06162733..00000000 --- a/lib/finch-api/models/hris/document_retreive_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module HRIS - class DocumentRetreiveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/jobs/automated_retrieve_params.rb b/lib/finch-api/models/jobs/automated_retrieve_params.rb deleted file mode 100644 index 258cfc9f..00000000 --- a/lib/finch-api/models/jobs/automated_retrieve_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module Jobs - class AutomatedRetrieveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/jobs/manual_retrieve_params.rb b/lib/finch-api/models/jobs/manual_retrieve_params.rb deleted file mode 100644 index c3aa78c7..00000000 --- a/lib/finch-api/models/jobs/manual_retrieve_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module Jobs - class ManualRetrieveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/payroll/pay_group_retrieve_params.rb b/lib/finch-api/models/payroll/pay_group_retrieve_params.rb deleted file mode 100644 index 35ce8db5..00000000 --- a/lib/finch-api/models/payroll/pay_group_retrieve_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module Payroll - class PayGroupRetrieveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end -end diff --git a/lib/finch-api/models/provider_list_params.rb b/lib/finch-api/models/provider_list_params.rb deleted file mode 100644 index df7c302f..00000000 --- a/lib/finch-api/models/provider_list_params.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - class ProviderListParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end -end diff --git a/lib/finch-api/models/sandbox/directory_create_response.rb b/lib/finch-api/models/sandbox/directory_create_response.rb deleted file mode 100644 index f166aabb..00000000 --- a/lib/finch-api/models/sandbox/directory_create_response.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module Sandbox - DirectoryCreateResponse = FinchAPI::ArrayOf[FinchAPI::Unknown] - end - end -end diff --git a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb b/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb deleted file mode 100644 index 23efcea6..00000000 --- a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Models - module Sandbox - module Jobs - class ConfigurationRetrieveParams < FinchAPI::BaseModel - # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - # @!parse - # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # # - # def initialize(request_options: {}, **) = super - - # def initialize: (Hash | FinchAPI::BaseModel) -> void - end - end - end - end -end diff --git a/lib/finch-api/page.rb b/lib/finch-api/page.rb deleted file mode 100644 index b0eb004b..00000000 --- a/lib/finch-api/page.rb +++ /dev/null @@ -1,92 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - # @example - # if page.has_next? - # page = page.next_page - # end - # - # @example - # page.auto_paging_each do |item| - # puts(item) - # end - # - # @example - # items = - # page - # .to_enum - # .lazy - # .select { _1.object_id.even? } - # .map(&:itself) - # .take(2) - # .to_a - # - # items => Array - class Page - include FinchAPI::Type::BasePage - - # @return [Array, nil] - attr_accessor :data - - # @return [FinchAPI::Models::Paging] - attr_accessor :paging - - # @api private - # - # @param client [FinchAPI::Transport::BaseClient] - # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] - # @param page_data [Hash{Symbol=>Object}] - def initialize(client:, req:, headers:, page_data:) - super - model = req.fetch(:model) - - case page_data - in {data: Array | nil => data} - @data = data&.map { FinchAPI::Type::Converter.coerce(model, _1) } - else - end - - case page_data - in {paging: Hash | nil => paging} - @paging = FinchAPI::Type::Converter.coerce(FinchAPI::Models::Paging, paging) - else - end - end - - # @return [Boolean] - def next_page? - 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? - 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.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 ##{__method__}") - end - page = self - loop do - page.data&.each { blk.call(_1) } - break unless page.next_page? - page = page.next_page - end - end - - # @return [String] - def inspect - "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} paging=#{paging.inspect}>" - end - end -end diff --git a/lib/finch-api/resources/connect/sessions.rb b/lib/finch-api/resources/connect/sessions.rb deleted file mode 100644 index 40b84600..00000000 --- a/lib/finch-api/resources/connect/sessions.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Resources - class Connect - class Sessions - # Create a new connect session for an employer - # - # @param params [FinchAPI::Models::Connect::SessionNewParams, Hash{Symbol=>Object}] . - # - # @option params [String] :customer_id - # - # @option params [String] :customer_name - # - # @option params [Array] :products - # - # @option params [String, nil] :customer_email - # - # @option params [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] :integration - # - # @option params [Boolean, nil] :manual - # - # @option params [Float, nil] :minutes_to_expire The number of minutes until the session expires (defaults to 43,200, which is 30 - # days) - # - # @option params [String, nil] :redirect_uri - # - # @option params [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] :sandbox - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::Models::Connect::SessionNewResponse] - def new(params) - parsed, options = FinchAPI::Models::Connect::SessionNewParams.dump_request(params) - @client.request( - method: :post, - path: "connect/sessions", - body: parsed, - model: FinchAPI::Models::Connect::SessionNewResponse, - options: options - ) - end - - # Create a new Connect session for reauthenticating an existing connection - # - # @param params [FinchAPI::Models::Connect::SessionReauthenticateParams, Hash{Symbol=>Object}] . - # - # @option params [String] :connection_id The ID of the existing connection to reauthenticate - # - # @option params [Integer, nil] :minutes_to_expire The number of minutes until the session expires (defaults to 43,200, which is 30 - # days) - # - # @option params [Array, nil] :products The products to request access to (optional for reauthentication) - # - # @option params [String, nil] :redirect_uri The URI to redirect to after the Connect flow is completed - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::Models::Connect::SessionReauthenticateResponse] - def reauthenticate(params) - parsed, options = FinchAPI::Models::Connect::SessionReauthenticateParams.dump_request(params) - @client.request( - method: :post, - path: "connect/sessions/reauthenticate", - body: parsed, - model: FinchAPI::Models::Connect::SessionReauthenticateResponse, - options: options - ) - end - - # @param client [FinchAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/finch-api/resources/request_forwarding.rb b/lib/finch-api/resources/request_forwarding.rb deleted file mode 100644 index cc0b573d..00000000 --- a/lib/finch-api/resources/request_forwarding.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Resources - class RequestForwarding - # The Forward API allows you to make direct requests to an employment system. If - # Finch’s unified API doesn’t have a data model that cleanly fits your needs, then - # Forward allows you to push or pull data models directly against an integration’s - # API. - # - # @param params [FinchAPI::Models::RequestForwardingForwardParams, Hash{Symbol=>Object}] . - # - # @option params [String] :method_ The HTTP method for the forwarded request. Valid values include: `GET` , `POST` - # , `PUT` , `DELETE` , and `PATCH`. - # - # @option params [String] :route The URL route path for the forwarded request. This value must begin with a - # forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and - # underscores. - # - # @option params [String, nil] :data The body for the forwarded request. This value must be specified as either a - # string or a valid JSON object. - # - # @option params [Object, nil] :headers The HTTP headers to include on the forwarded request. This value must be - # specified as an object of key-value pairs. Example: - # `{"Content-Type": "application/xml", "X-API-Version": "v1" }` - # - # @option params [Object, nil] :params The query parameters for the forwarded request. This value must be specified as - # a valid JSON object rather than a query string. - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::Models::RequestForwardingForwardResponse] - def forward(params) - parsed, options = FinchAPI::Models::RequestForwardingForwardParams.dump_request(params) - @client.request( - method: :post, - path: "forward", - body: parsed, - model: FinchAPI::Models::RequestForwardingForwardResponse, - options: options - ) - end - - # @param client [FinchAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/finch-api/resources/sandbox/company.rb b/lib/finch-api/resources/sandbox/company.rb deleted file mode 100644 index 70c8df86..00000000 --- a/lib/finch-api/resources/sandbox/company.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Resources - class Sandbox - class Company - # Update a sandbox company's data - # - # @param params [FinchAPI::Models::Sandbox::CompanyUpdateParams, Hash{Symbol=>Object}] . - # - # @option params [Array, nil] :accounts An array of bank account objects associated with the payroll/HRIS system. - # - # @option params [Array, nil] :departments The array of company departments. - # - # @option params [String, nil] :ein The employer identification number. - # - # @option params [FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, nil] :entity The entity type object. - # - # @option params [String, nil] :legal_name The legal name of the company. - # - # @option params [Array, nil] :locations - # - # @option params [String, nil] :primary_email The email of the main administrator on the account. - # - # @option params [String, nil] :primary_phone_number The phone number of the main administrator on the account. Format: `XXXXXXXXXX` - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::Models::Sandbox::CompanyUpdateResponse] - def update(params) - parsed, options = FinchAPI::Models::Sandbox::CompanyUpdateParams.dump_request(params) - @client.request( - method: :put, - path: "sandbox/company", - body: parsed, - model: FinchAPI::Models::Sandbox::CompanyUpdateResponse, - options: options - ) - end - - # @param client [FinchAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/finch-api/resources/sandbox/employment.rb b/lib/finch-api/resources/sandbox/employment.rb deleted file mode 100644 index 56efcbe0..00000000 --- a/lib/finch-api/resources/sandbox/employment.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Resources - class Sandbox - class Employment - # Update sandbox employment - # - # @param individual_id [String] - # - # @param params [FinchAPI::Models::Sandbox::EmploymentUpdateParams, Hash{Symbol=>Object}] . - # - # @option params [String, nil] :class_code Worker's compensation classification code for this employee - # - # @option params [Array] :custom_fields Custom fields for the individual. These are fields which are defined by the - # employer in the system. Custom fields are not currently supported for assisted - # connections. - # - # @option params [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, nil] :department The department object. - # - # @option params [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, nil] :employment The employment object. - # - # @option params [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus, nil] :employment_status The detailed employment status of the individual. - # - # @option params [String, nil] :end_date - # - # @option params [String, nil] :first_name The legal first name of the individual. - # - # @option params [FinchAPI::Models::Income, nil] :income The employee's income as reported by the provider. This may not always be - # annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, - # depending on what information the provider returns. - # - # @option params [Array, nil] :income_history The array of income history. - # - # @option params [Boolean, nil] :is_active `true` if the individual an an active employee or contractor at the company. - # - # @option params [String, nil] :last_name The legal last name of the individual. - # - # @option params [String, nil] :latest_rehire_date - # - # @option params [FinchAPI::Models::Location, nil] :location - # - # @option params [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, nil] :manager The manager object representing the manager of the individual within the org. - # - # @option params [String, nil] :middle_name The legal middle name of the individual. - # - # @option params [String] :source_id The source system's unique employment identifier for this individual - # - # @option params [String, nil] :start_date - # - # @option params [String, nil] :title The current title of the individual. - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::Models::Sandbox::EmploymentUpdateResponse] - def update(individual_id, params = {}) - parsed, options = FinchAPI::Models::Sandbox::EmploymentUpdateParams.dump_request(params) - @client.request( - method: :put, - path: ["sandbox/employment/%0s", individual_id], - body: parsed, - model: FinchAPI::Models::Sandbox::EmploymentUpdateResponse, - options: options - ) - end - - # @param client [FinchAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/finch-api/resources/sandbox/individual.rb b/lib/finch-api/resources/sandbox/individual.rb deleted file mode 100644 index 541489d7..00000000 --- a/lib/finch-api/resources/sandbox/individual.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Resources - class Sandbox - class Individual - # Update sandbox individual - # - # @param individual_id [String] - # - # @param params [FinchAPI::Models::Sandbox::IndividualUpdateParams, Hash{Symbol=>Object}] . - # - # @option params [String, nil] :dob - # - # @option params [Array, nil] :emails - # - # @option params [String, nil] :encrypted_ssn Social Security Number of the individual in **encrypted** format. This field is - # only available with the `ssn` scope enabled and the - # `options: { include: ['ssn'] }` param set in the body. - # - # @option params [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity, nil] :ethnicity The EEOC-defined ethnicity of the individual. - # - # @option params [String, nil] :first_name The legal first name of the individual. - # - # @option params [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender, nil] :gender The gender of the individual. - # - # @option params [String, nil] :last_name The legal last name of the individual. - # - # @option params [String, nil] :middle_name The legal middle name of the individual. - # - # @option params [Array, nil] :phone_numbers - # - # @option params [String, nil] :preferred_name The preferred name of the individual. - # - # @option params [FinchAPI::Models::Location, nil] :residence - # - # @option params [String, nil] :ssn Social Security Number of the individual. This field is only available with the - # `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the - # body. - # [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::Models::Sandbox::IndividualUpdateResponse] - def update(individual_id, params = {}) - parsed, options = FinchAPI::Models::Sandbox::IndividualUpdateParams.dump_request(params) - @client.request( - method: :put, - path: ["sandbox/individual/%0s", individual_id], - body: parsed, - model: FinchAPI::Models::Sandbox::IndividualUpdateResponse, - options: options - ) - end - - # @param client [FinchAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/finch-api/responses_page.rb b/lib/finch-api/responses_page.rb deleted file mode 100644 index f39f95fb..00000000 --- a/lib/finch-api/responses_page.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - # @example - # if responses_page.has_next? - # responses_page = responses_page.next_page - # end - # - # @example - # responses_page.auto_paging_each do |individual| - # puts(individual) - # end - # - # @example - # individuals = - # responses_page - # .to_enum - # .lazy - # .select { _1.object_id.even? } - # .map(&:itself) - # .take(2) - # .to_a - # - # individuals => Array - class ResponsesPage - include FinchAPI::Type::BasePage - - # @return [Array, nil] - attr_accessor :responses - - # @api private - # - # @param client [FinchAPI::Transport::BaseClient] - # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] - # @param page_data [Array] - def initialize(client:, req:, headers:, page_data:) - super - model = req.fetch(:model) - - case page_data - in {responses: Array | nil => responses} - @responses = responses&.map { FinchAPI::Type::Converter.coerce(model, _1) } - else - end - end - - # @return [Boolean] - def next_page? - false - end - - # @raise [FinchAPI::HTTP::Error] - # @return [FinchAPI::ResponsesPage] - def next_page - 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 ##{__method__}") - end - page = self - loop do - page.responses&.each { blk.call(_1) } - break unless page.next_page? - page = page.next_page - end - end - - # @return [String] - def inspect - "#<#{self.class}:0x#{object_id.to_s(16)} responses=#{responses.inspect}>" - end - end -end diff --git a/lib/finch-api/single_page.rb b/lib/finch-api/single_page.rb deleted file mode 100644 index 0f7ff928..00000000 --- a/lib/finch-api/single_page.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - # @example - # if single_page.has_next? - # single_page = single_page.next_page - # end - # - # @example - # single_page.auto_paging_each do |payment| - # puts(payment) - # end - # - # @example - # payments = - # single_page - # .to_enum - # .lazy - # .select { _1.object_id.even? } - # .map(&:itself) - # .take(2) - # .to_a - # - # payments => Array - class SinglePage < ::Array - include FinchAPI::Type::BasePage - - # @api private - # - # @param client [FinchAPI::Transport::BaseClient] - # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] - # @param page_data [Array] - def initialize(client:, req:, headers:, page_data:) - super - model = req.fetch(:model) - - case page_data - in Array - replace(page_data.map { FinchAPI::Type::Converter.coerce(model, _1) }) - else - end - end - - # @return [Boolean] - def next_page? - false - end - - # @raise [FinchAPI::HTTP::Error] - # @return [FinchAPI::SinglePage] - def next_page - 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 ##{__method__}") - end - page = self - loop do - page.each { blk.call(_1) } - break unless page.next_page? - page = page.next_page - end - end - - # @return [String] - def inspect - "#<#{self.class}:0x#{object_id.to_s(16)}>" - end - end -end diff --git a/lib/finch-api/transport/base_client.rb b/lib/finch-api/transport/base_client.rb deleted file mode 100644 index 28815800..00000000 --- a/lib/finch-api/transport/base_client.rb +++ /dev/null @@ -1,459 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Transport - # @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 - } - # rubocop:enable Style/MutableConstant - - class << self - # @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 - in Hash - req.each_key do |k| - unless keys.include?(k) - raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") - end - end - else - raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") - end - end - - # @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] - in [true | false, _] - coerced - in [_, 408 | 409 | 429 | (500..)] - # retry on: - # 408: timeouts - # 409: locks - # 429: rate limits - # 500+: unknown errors - true - else - false - end - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @option request [Object] :body - # - # @option request [Integer] :max_retries - # - # @option request [Float] :timeout - # - # @param status [Integer] - # - # @param response_headers [Hash{String=>String}, Net::HTTPHeader] - # - # @return [Hash{Symbol=>Object}] - def follow_redirect(request, status:, response_headers:) - method, url, headers = request.fetch_values(:method, :url, :headers) - location = - Kernel.then do - URI.join(url, response_headers["location"]) - rescue ArgumentError - message = "Server responded with status #{status} but no valid location header." - raise FinchAPI::APIConnectionError.new(url: url, message: message) - end - - request = {**request, url: location} - - case [url.scheme, location.scheme] - in ["https", "http"] - message = "Tried to redirect to a insecure URL" - raise FinchAPI::APIConnectionError.new(url: url, message: message) - else - nil - end - - # from whatwg fetch spec - case [status, method] - in [301 | 302, :post] | [303, _] - drop = %w[content-encoding content-language content-length content-location content-type] - request = { - **request, - method: method == :head ? :head : :get, - headers: headers.except(*drop), - body: nil - } - else - end - - # from undici - if FinchAPI::Util.uri_origin(url) != FinchAPI::Util.uri_origin(location) - drop = %w[authorization cookie host proxy-authorization] - request = {**request, headers: request.fetch(:headers).except(*drop)} - end - - request - end - - # @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 - - # @api private - # @return [FinchAPI::Transport::PooledNetRequester] - attr_accessor :requester - - # @api private - # - # @param base_url [String] - # @param timeout [Float] - # @param max_retries [Integer] - # @param initial_retry_delay [Float] - # @param max_retry_delay [Float] - # @param headers [Hash{String=>String, Integer, Array, nil}] - # @param idempotency_header [String, nil] - def initialize( - base_url:, - timeout: 0.0, - max_retries: 0, - initial_retry_delay: 0.0, - max_retry_delay: 0.0, - headers: {}, - idempotency_header: nil - ) - @requester = FinchAPI::Transport::PooledNetRequester.new - @headers = FinchAPI::Util.normalized_headers( - self.class::PLATFORM_HEADERS, - { - "accept" => "application/json", - "content-type" => "application/json" - }, - headers - ) - @base_url = FinchAPI::Util.parse_uri(base_url) - @idempotency_header = idempotency_header&.to_s&.downcase - @max_retries = max_retries - @timeout = timeout - @initial_retry_delay = initial_retry_delay - @max_retry_delay = max_retry_delay - end - - # @api private - # - # @return [Hash{String=>String}] - private def auth_headers = {} - - # @api private - # - # @return [String] - private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" - - # @api private - # - # @param req [Hash{Symbol=>Object}] . - # - # @option req [Symbol] :method - # - # @option req [String, Array] :path - # - # @option req [Hash{String=>Array, String, nil}, nil] :query - # - # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers - # - # @option req [Object, nil] :body - # - # @option req [Symbol, nil] :unwrap - # - # @option req [Class, nil] :page - # - # @option req [Class, nil] :stream - # - # @option req [FinchAPI::Type::Converter, Class, nil] :model - # - # @param opts [Hash{Symbol=>Object}] . - # - # @option opts [String, nil] :idempotency_key - # - # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query - # - # @option opts [Hash{String=>String, nil}, nil] :extra_headers - # - # @option opts [Object, nil] :extra_body - # - # @option opts [Integer, nil] :max_retries - # - # @option opts [Float, nil] :timeout - # - # @return [Hash{Symbol=>Object}] - private def build_request(req, opts) - method, uninterpolated_path = req.fetch_values(:method, :path) - - path = FinchAPI::Util.interpolate_path(uninterpolated_path) - - query = FinchAPI::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) - - headers = FinchAPI::Util.normalized_headers( - @headers, - auth_headers, - req[:headers].to_h, - opts[:extra_headers].to_h - ) - - if @idempotency_header && - !headers.key?(@idempotency_header) && - !Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) - headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } - end - - unless headers.key?("x-stainless-retry-count") - headers["x-stainless-retry-count"] = "0" - end - - timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..)) - unless headers.key?("x-stainless-timeout") || timeout.zero? - headers["x-stainless-timeout"] = timeout.to_s - end - - headers.reject! { |_, v| v.to_s.empty? } - - body = - case method - in :get | :head | :options | :trace - nil - else - FinchAPI::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) - end - - headers, encoded = FinchAPI::Util.encode_content(headers, body) - { - method: method, - url: FinchAPI::Util.join_parsed_uri(@base_url, {**req, path: path, query: query}), - headers: headers, - body: encoded, - max_retries: opts.fetch(:max_retries, @max_retries), - timeout: timeout - } - end - - # @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 } - return span if span - - retry_header = headers["retry-after"] - return span if (span = Float(retry_header, exception: false)) - - span = retry_header&.then do - Time.httpdate(_1) - Time.now - rescue ArgumentError - nil - end - return span if span - - scale = retry_count**2 - jitter = 1 - (0.25 * rand) - (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @option request [Object] :body - # - # @option request [Integer] :max_retries - # - # @option request [Float] :timeout - # - # @param redirect_count [Integer] - # - # @param retry_count [Integer] - # - # @param send_retry_header [Boolean] - # - # @raise [FinchAPI::APIError] - # @return [Array(Integer, Net::HTTPResponse, Enumerable)] - private def send_request(request, redirect_count:, retry_count:, send_retry_header:) - url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout) - input = {**request.except(:timeout), deadline: FinchAPI::Util.monotonic_secs + timeout} - - if send_retry_header - headers["x-stainless-retry-count"] = retry_count.to_s - end - - begin - status, response, stream = @requester.execute(input) - rescue FinchAPI::APIConnectionError => e - status = e - end - - case status - in ..299 - [status, response, stream] - in 300..399 if redirect_count >= self.class::MAX_REDIRECTS - self.class.reap_connection!(status, stream: stream) - - message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." - raise FinchAPI::APIConnectionError.new(url: url, message: message) - in 300..399 - self.class.reap_connection!(status, stream: stream) - - request = self.class.follow_redirect(request, status: status, response_headers: response) - send_request( - request, - redirect_count: redirect_count + 1, - retry_count: retry_count, - send_retry_header: send_retry_header - ) - in FinchAPI::APIConnectionError if retry_count >= max_retries - raise status - in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response) - decoded = 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( - url: url, - status: status, - body: decoded, - request: nil, - response: response - ) - in (400..) | FinchAPI::APIConnectionError - self.class.reap_connection!(status, stream: stream) - - delay = retry_delay(response, retry_count: retry_count) - sleep(delay) - - send_request( - request, - redirect_count: redirect_count, - retry_count: retry_count + 1, - send_retry_header: send_retry_header - ) - end - end - - # Execute the request specified by `req`. This is the method that all resource - # methods call into. - # - # @param req [Hash{Symbol=>Object}] . - # - # @option req [Symbol] :method - # - # @option req [String, Array] :path - # - # @option req [Hash{String=>Array, String, nil}, nil] :query - # - # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers - # - # @option req [Object, nil] :body - # - # @option req [Symbol, nil] :unwrap - # - # @option req [Class, nil] :page - # - # @option req [Class, nil] :stream - # - # @option req [FinchAPI::Type::Converter, Class, nil] :model - # - # @option req [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :options - # - # @raise [FinchAPI::APIError] - # @return [Object] - def request(req) - self.class.validate!(req) - model = req.fetch(:model) { FinchAPI::Unknown } - opts = req[:options].to_h - FinchAPI::RequestOptions.validate!(opts) - request = build_request(req.except(:options), opts) - url = request.fetch(:url) - - # Don't send the current retry count in the headers if the caller modified the header defaults. - send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" - status, response, stream = send_request( - request, - redirect_count: 0, - retry_count: 0, - send_retry_header: send_retry_header - ) - - decoded = FinchAPI::Util.decode_content(response, stream: stream) - case req - in { stream: Class => st } - st.new(model: model, url: url, status: status, response: response, stream: decoded) - in { page: Class => page } - page.new(client: self, req: req, headers: response, page_data: decoded) - else - unwrapped = FinchAPI::Util.dig(decoded, req[:unwrap]) - FinchAPI::Type::Converter.coerce(model, unwrapped) - end - 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 -end diff --git a/lib/finch-api/transport/pooled_net_requester.rb b/lib/finch-api/transport/pooled_net_requester.rb deleted file mode 100644 index 1a947803..00000000 --- a/lib/finch-api/transport/pooled_net_requester.rb +++ /dev/null @@ -1,182 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Transport - # @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 - # @api private - # - # @param url [URI::Generic] - # - # @return [Net::HTTP] - def connect(url) - port = - case [url.port, url.scheme] - in [Integer, _] - url.port - in [nil, "http" | "ws"] - Net::HTTP.http_default_port - in [nil, "https" | "wss"] - Net::HTTP.https_default_port - end - - Net::HTTP.new(url.host, port).tap do - _1.use_ssl = %w[https wss].include?(url.scheme) - _1.max_retries = 0 - end - end - - # @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 - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @param blk [Proc] - # - # @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, - !body.nil?, - method != :head, - url.to_s - ) - - headers.each { req[_1] = _2 } - - case body - in nil - nil - in String - req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] - req.body_stream = FinchAPI::Util::ReadIOAdapter.new(body, &) - in StringIO - 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 - - # @api private - # - # @param url [URI::Generic] - # @param deadline [Float] - # @param blk [Proc] - # - # @raise [Timeout::Error] - # @yieldparam [Net::HTTP] - private def with_pool(url, deadline:, &blk) - origin = FinchAPI::Util.uri_origin(url) - timeout = deadline - FinchAPI::Util.monotonic_secs - pool = - @mutex.synchronize do - @pools[origin] ||= ConnectionPool.new(size: @size) do - self.class.connect(url) - end - end - - pool.with(timeout: timeout, &blk) - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @option request [Object] :body - # - # @option request [Float] :deadline - # - # @return [Array(Integer, Net::HTTPResponse, Enumerable)] - def execute(request) - url, deadline = request.fetch_values(:url, :deadline) - - eof = false - finished = false - enum = Enumerator.new do |y| - 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) - 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, req, rsp] - break if finished - - rsp.read_body do |bytes| - y << bytes - break if finished - - self.class.calibrate_socket_timeout(conn, deadline) - end - eof = true - end - end - rescue Timeout::Error - raise FinchAPI::APITimeoutError - end - - 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 - [Integer(response.code), response, (response.body = body)] - end - - # @api private - # - # @param size [Integer] - def initialize(size: Etc.nprocessors) - @mutex = Mutex.new - @size = size - @pools = {} - end - end - end -end diff --git a/lib/finch-api/type.rb b/lib/finch-api/type.rb deleted file mode 100644 index 63e3c564..00000000 --- a/lib/finch-api/type.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - Unknown = FinchAPI::Type::Unknown - - BooleanModel = FinchAPI::Type::BooleanModel - - Enum = FinchAPI::Type::Enum - - Union = FinchAPI::Type::Union - - ArrayOf = FinchAPI::Type::ArrayOf - - HashOf = FinchAPI::Type::HashOf - - BaseModel = FinchAPI::Type::BaseModel - - RequestParameters = FinchAPI::Type::RequestParameters - - # This module contains various type declarations. - module Type - end -end diff --git a/lib/finch-api/type/array_of.rb b/lib/finch-api/type/array_of.rb deleted file mode 100644 index 0982bfab..00000000 --- a/lib/finch-api/type/array_of.rb +++ /dev/null @@ -1,110 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - # - # @abstract - # - # Array of items of a given type. - class ArrayOf - include FinchAPI::Type::Converter - - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::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) = other.is_a?(Array) && other.all?(item_type) - - # @param other [Object] - # - # @return [Boolean] - def ==(other) = other.is_a?(FinchAPI::ArrayOf) && other.nilable? == nilable? && other.item_type == item_type - - # @api private - # - # @param value [Enumerable, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Array, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - - unless value.is_a?(Array) - exactness[:no] += 1 - return value - end - - target = item_type - exactness[:yes] += 1 - value - .map do |item| - case [nilable?, item] - in [true, nil] - exactness[:yes] += 1 - nil - else - FinchAPI::Type::Converter.coerce(target, item, state: state) - end - end - end - - # @api private - # - # @param value [Enumerable, Object] - # - # @return [Array, Object] - def dump(value) - target = item_type - value.is_a?(Array) ? value.map { FinchAPI::Type::Converter.dump(target, _1) } : super - end - - # @api private - # - # @return [FinchAPI::Type::Converter, Class] - protected def item_type = @item_type_fn.call - - # @api private - # - # @return [Boolean] - protected def nilable? = @nilable - - # @api private - # - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - def initialize(type_info, spec = {}) - @item_type_fn = FinchAPI::Type::Converter.type_info(type_info || spec) - @nilable = spec[:nil?] - end - end - end -end diff --git a/lib/finch-api/type/base_model.rb b/lib/finch-api/type/base_model.rb deleted file mode 100644 index 0bd19789..00000000 --- a/lib/finch-api/type/base_model.rb +++ /dev/null @@ -1,355 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @abstract - # - # @example - # # `operation_support_matrix` is a `FinchAPI::Models::OperationSupportMatrix` - # operation_support_matrix => { - # create: create, - # delete: delete, - # read: read - # } - class BaseModel - extend FinchAPI::Type::Converter - - class << self - # @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=>Hash{Symbol=>Object}}] - def fields - known_fields.transform_values do |field| - {**field.except(:type_fn), type: field.fetch(:type_fn).call} - end - end - - # @api private - # - # @param name_sym [Symbol] - # - # @param required [Boolean] - # - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::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 | FinchAPI::Type::Converter | Class - [FinchAPI::Type::Converter.type_info({**spec, union: type_info}), spec] - in Hash - [FinchAPI::Type::Converter.type_info(type_info), type_info] - end - - setter = "#{name_sym}=" - api_name = info.fetch(:api_name, name_sym) - nilable = info[:nil?] - const = required && !nilable ? info.fetch(:const, FinchAPI::Util::OMIT) : FinchAPI::Util::OMIT - - [name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym) - - known_fields[name_sym] = - { - mode: @mode, - api_name: api_name, - required: required, - nilable: nilable, - const: const, - type_fn: type_fn - } - - define_method(setter) { @data.store(name_sym, _1) } - - define_method(name_sym) do - target = type_fn.call - value = @data.fetch(name_sym) { const == FinchAPI::Util::OMIT ? nil : const } - state = {strictness: :strong, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} - if (nilable || !required) && value.nil? - nil - else - FinchAPI::Type::Converter.coerce( - target, - value, - state: state - ) - end - rescue StandardError - cls = self.class.name.split("::").last - message = "Failed to parse #{cls}.#{__method__} from #{value.class} to #{target.inspect}. To get the unparsed API response, use #{cls}[:#{__method__}]." - raise FinchAPI::ConversionError.new(message) - end - end - - # @api private - # - # @param name_sym [Symbol] - # - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::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 - - # @api private - # - # @param name_sym [Symbol] - # - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::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 - - # @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 - - # @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 - - # @param other [Object] - # - # @return [Boolean] - def ==(other) = other.is_a?(Class) && other <= FinchAPI::BaseModel && other.fields == fields - end - - # @param other [Object] - # - # @return [Boolean] - def ==(other) = self.class == other.class && @data == other.to_h - - class << self - # @api private - # - # @param value [FinchAPI::BaseModel, Hash{Object=>Object}, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [FinchAPI::BaseModel, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - - if value.is_a?(self.class) - exactness[:yes] += 1 - return value - end - - unless (val = FinchAPI::Util.coerce_hash(value)).is_a?(Hash) - exactness[:no] += 1 - return value - end - exactness[:yes] += 1 - - keys = val.keys.to_set - instance = new - data = instance.to_h - - fields.each do |name, field| - mode, required, target = field.fetch_values(:mode, :required, :type) - api_name, nilable, const = field.fetch_values(:api_name, :nilable, :const) - - unless val.key?(api_name) - if const != FinchAPI::Util::OMIT - exactness[:yes] += 1 - elsif required && mode != :dump - exactness[nilable ? :maybe : :no] += 1 - else - exactness[:yes] += 1 - end - next - end - - item = val.fetch(api_name) - keys.delete(api_name) - - converted = - if item.nil? && (nilable || !required) - exactness[nilable ? :yes : :maybe] += 1 - nil - else - coerced = FinchAPI::Type::Converter.coerce(target, item, state: state) - case target - in FinchAPI::Type::Converter | Symbol - coerced - else - item - end - end - data.store(name, converted) - end - - keys.each { data.store(_1, val.fetch(_1)) } - instance - 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 super - end - - acc = {} - - coerced.each do |key, val| - name = key.is_a?(String) ? key.to_sym : key - case (field = known_fields[name]) - in nil - acc.store(name, super(val)) - else - mode, api_name, type_fn = field.fetch_values(:mode, :api_name, :type_fn) - case mode - in :coerce - next - else - target = type_fn.call - acc.store(api_name, FinchAPI::Type::Converter.dump(target, val)) - end - end - end - - known_fields.each_value do |field| - mode, api_name, const = field.fetch_values(:mode, :api_name, :const) - next if mode == :coerce || acc.key?(api_name) || const == FinchAPI::Util::OMIT - acc.store(api_name, const) - end - - acc - 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. - # - # @param key [Symbol] - # - # @return [Object, nil] - def [](key) - unless key.instance_of?(Symbol) - raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") - end - - @data[key] - end - - # Returns a Hash of the data underlying this object. O(1) - # - # Keys are Symbols and values are the raw values from the response. The return - # value indicates which values were ever set on the object. i.e. there will be a - # key in this hash if they ever were, even if the set value was nil. - # - # This method is not recursive. The returned value is shared by the object, so it - # should not be mutated. - # - # @return [Hash{Symbol=>Object}] - def to_h = @data - - alias_method :to_hash, :to_h - - # @param keys [Array, nil] - # - # @return [Hash{Symbol=>Object}] - def deconstruct_keys(keys) - (keys || self.class.known_fields.keys) - .filter_map do |k| - unless self.class.known_fields.key?(k) - next - end - - [k, public_send(k)] - end - .to_h - end - - # Create a new instance of a model. - # - # @param data [Hash{Symbol=>Object}, FinchAPI::BaseModel] - def initialize(data = {}) - case FinchAPI::Util.coerce_hash(data) - in Hash => coerced - @data = coerced - else - raise ArgumentError.new("Expected a #{Hash} or #{FinchAPI::BaseModel}, got #{data.inspect}") - end - end - - # @return [String] - def inspect - rows = self.class.known_fields.keys.map do - "#{_1}=#{@data.key?(_1) ? public_send(_1) : ''}" - rescue FinchAPI::ConversionError - "#{_1}=#{@data.fetch(_1)}" - end - "#<#{self.class.name}:0x#{object_id.to_s(16)} #{rows.join(' ')}>" - end - end - end -end diff --git a/lib/finch-api/type/base_page.rb b/lib/finch-api/type/base_page.rb deleted file mode 100644 index 9cd0d228..00000000 --- a/lib/finch-api/type/base_page.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @example - # if page.has_next? - # page = page.next_page - # end - # - # @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::Type::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 - - # @api private - # - # @param client [FinchAPI::Transport::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 -end diff --git a/lib/finch-api/type/boolean_model.rb b/lib/finch-api/type/boolean_model.rb deleted file mode 100644 index 38735b00..00000000 --- a/lib/finch-api/type/boolean_model.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - # - # @abstract - # - # Ruby has no Boolean class; this is something for models to refer to. - class BooleanModel - extend FinchAPI::Type::Converter - - # @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 - - class << self - # @api private - # - # @param value [Boolean, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Boolean, Object] - def coerce(value, state:) - state.fetch(:exactness)[value == true || value == false ? :yes : :no] += 1 - value - end - - # @!parse - # # @api private - # # - # # @param value [Boolean, Object] - # # - # # @return [Boolean, Object] - # def dump(value) = super - end - end - end -end diff --git a/lib/finch-api/type/converter.rb b/lib/finch-api/type/converter.rb deleted file mode 100644 index 911c1e34..00000000 --- a/lib/finch-api/type/converter.rb +++ /dev/null @@ -1,211 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - module Converter - # rubocop:disable Lint/UnusedMethodArgument - - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(value, state:) = (raise NotImplementedError) - - # @api private - # - # @param value [Object] - # - # @return [Object] - def dump(value) - case value - in Array - value.map { FinchAPI::Unknown.dump(_1) } - in Hash - value.transform_values { FinchAPI::Unknown.dump(_1) } - in FinchAPI::BaseModel - value.class.dump(value) - else - value - end - end - - # rubocop:enable Lint/UnusedMethodArgument - - class << self - # @api private - # - # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Type::Converter, Class] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - # - # @return [Proc] - def type_info(spec) - case spec - in Proc - spec - in Hash - type_info(spec.slice(:const, :enum, :union).first&.last) - in true | false - -> { FinchAPI::BooleanModel } - in FinchAPI::Type::Converter | Class | Symbol - -> { spec } - in NilClass | Integer | Float - -> { spec.class } - end - 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 - # - # The coercion process is subject to improvement between minor release versions. - # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode - # - # @param target [FinchAPI::Type::Converter, Class] - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] The `strictness` is one of `true`, `false`, or `:strong`. This informs the - # coercion strategy when we have to decide between multiple possible conversion - # targets: - # - # - `true`: the conversion must be exact, with minimum coercion. - # - `false`: the conversion can be approximate, with some coercion. - # - `:strong`: the conversion must be exact, with no coercion, and raise an error - # if not possible. - # - # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For - # any given conversion attempt, the exactness will be updated based on how closely - # the value recursively matches the target type: - # - # - `yes`: the value can be converted to the target type with minimum coercion. - # - `maybe`: the value can be converted to the target type with some reasonable - # coercion. - # - `no`: the value cannot be converted to the target type. - # - # See implementation below for more details. - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce( - target, - value, - state: {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} - ) - strictness, exactness = state.fetch_values(:strictness, :exactness) - - case target - in FinchAPI::Type::Converter - return target.coerce(value, state: state) - in Class - if value.is_a?(target) - exactness[:yes] += 1 - return value - end - - case target - in -> { _1 <= NilClass } - exactness[value.nil? ? :yes : :maybe] += 1 - return nil - in -> { _1 <= Integer } - if value.is_a?(Integer) - exactness[:yes] += 1 - return value - elsif strictness == :strong - message = "no implicit conversion of #{value.class} into #{target.inspect}" - raise TypeError.new(message) - else - Kernel.then do - return Integer(value).tap { exactness[:maybe] += 1 } - rescue ArgumentError, TypeError - end - end - in -> { _1 <= Float } - if value.is_a?(Numeric) - exactness[:yes] += 1 - return Float(value) - elsif strictness == :strong - message = "no implicit conversion of #{value.class} into #{target.inspect}" - raise TypeError.new(message) - else - Kernel.then do - return Float(value).tap { exactness[:maybe] += 1 } - rescue ArgumentError, TypeError - end - end - in -> { _1 <= String } - case value - in String | Symbol | Numeric - exactness[value.is_a?(Numeric) ? :maybe : :yes] += 1 - return value.to_s - else - if strictness == :strong - message = "no implicit conversion of #{value.class} into #{target.inspect}" - raise TypeError.new(message) - end - end - in -> { _1 <= Date || _1 <= Time } - Kernel.then do - return target.parse(value).tap { exactness[:yes] += 1 } - rescue ArgumentError, TypeError => e - raise e if strictness == :strong - end - in -> { _1 <= IO } if value.is_a?(String) - exactness[:yes] += 1 - return StringIO.new(value.b) - else - end - in Symbol - if (value.is_a?(Symbol) || value.is_a?(String)) && value.to_sym == target - exactness[:yes] += 1 - return target - elsif strictness == :strong - message = "cannot convert non-matching #{value.class} into #{target.inspect}" - raise ArgumentError.new(message) - end - else - end - - exactness[:no] += 1 - value - end - - # @api private - # - # @param target [FinchAPI::Type::Converter, Class] - # @param value [Object] - # - # @return [Object] - def dump(target, value) - target.is_a?(FinchAPI::Type::Converter) ? target.dump(value) : FinchAPI::Unknown.dump(value) - end - end - end - end -end diff --git a/lib/finch-api/type/enum.rb b/lib/finch-api/type/enum.rb deleted file mode 100644 index 57e80499..00000000 --- a/lib/finch-api/type/enum.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @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. - # - # @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::Type::Converter - - # All of the valid Symbol values for this enum. - # - # @return [Array] - def values = (@values ||= constants.map { const_get(_1) }) - - # @api private - # - # Guard against thread safety issues by instantiating `@values`. - private def finalize! = values - - # @param other [Object] - # - # @return [Boolean] - def ===(other) = values.include?(other) - - # @param other [Object] - # - # @return [Boolean] - def ==(other) - other.is_a?(Module) && other.singleton_class <= FinchAPI::Enum && other.values.to_set == values.to_set - end - - # @api private - # - # Unlike with primitives, `Enum` additionally validates that the value is a member - # of the enum. - # - # @param value [String, Symbol, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Symbol, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - val = value.is_a?(String) ? value.to_sym : value - - if values.include?(val) - exactness[:yes] += 1 - val - else - exactness[values.first&.class == val.class ? :maybe : :no] += 1 - value - end - end - - # @!parse - # # @api private - # # - # # @param value [Symbol, Object] - # # - # # @return [Symbol, Object] - # def dump(value) = super - end - end -end diff --git a/lib/finch-api/type/hash_of.rb b/lib/finch-api/type/hash_of.rb deleted file mode 100644 index 061e8f1c..00000000 --- a/lib/finch-api/type/hash_of.rb +++ /dev/null @@ -1,136 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - # - # @abstract - # - # Hash of items of a given type. - class HashOf - include FinchAPI::Type::Converter - - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::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 - in Hash - other.all? do |key, val| - case [key, val] - in [Symbol | String, ^type] - true - else - false - end - end - else - false - end - end - - # @param other [Object] - # - # @return [Boolean] - def ==(other) = other.is_a?(FinchAPI::HashOf) && other.nilable? == nilable? && other.item_type == item_type - - # @api private - # - # @param value [Hash{Object=>Object}, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Hash{Symbol=>Object}, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - - unless value.is_a?(Hash) - exactness[:no] += 1 - return value - end - - target = item_type - exactness[:yes] += 1 - value - .to_h do |key, val| - k = key.is_a?(String) ? key.to_sym : key - v = - case [nilable?, val] - in [true, nil] - exactness[:yes] += 1 - nil - else - FinchAPI::Type::Converter.coerce(target, val, state: state) - end - - exactness[:no] += 1 unless k.is_a?(Symbol) - [k, v] - end - end - - # @api private - # - # @param value [Hash{Object=>Object}, Object] - # - # @return [Hash{Symbol=>Object}, Object] - def dump(value) - target = item_type - if value.is_a?(Hash) - value.transform_values do - FinchAPI::Type::Converter.dump(target, _1) - end - else - super - end - end - - # @api private - # - # @return [FinchAPI::Type::Converter, Class] - protected def item_type = @item_type_fn.call - - # @api private - # - # @return [Boolean] - protected def nilable? = @nilable - - # @api private - # - # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - def initialize(type_info, spec = {}) - @item_type_fn = FinchAPI::Type::Converter.type_info(type_info || spec) - @nilable = spec[:nil?] - end - end - end -end diff --git a/lib/finch-api/type/request_parameters.rb b/lib/finch-api/type/request_parameters.rb deleted file mode 100644 index fad5d1c4..00000000 --- a/lib/finch-api/type/request_parameters.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - module RequestParameters - # @!parse - # # Options to specify HTTP behaviour for this request. - # # @return [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # attr_accessor :request_options - - # @param mod [Module] - def self.included(mod) - return unless mod <= FinchAPI::BaseModel - - mod.extend(FinchAPI::Type::RequestParameters::Converter) - mod.optional(:request_options, FinchAPI::RequestOptions) - end - - # @api private - module Converter - # @api private - # - # @param params [Object] - # - # @return [Array(Object, Hash{Symbol=>Object})] - def dump_request(params) - case (dumped = dump(params)) - in Hash - [dumped.except(:request_options), dumped[:request_options]] - else - [dumped, nil] - end - end - end - end - end -end diff --git a/lib/finch-api/type/union.rb b/lib/finch-api/type/union.rb deleted file mode 100644 index 3b73e76d..00000000 --- a/lib/finch-api/type/union.rb +++ /dev/null @@ -1,204 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - # - # @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 - # - # @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::Type::Converter - - # @api private - # - # All of the specified variant info for this union. - # - # @return [Array] - private def known_variants = (@known_variants ||= []) - - # @api private - # - # @return [Array] - protected def derefed_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) - - # @api private - # - # @param property [Symbol] - private def discriminator(property) - case property - in Symbol - @discriminator = property - end - end - - # @api private - # - # @param key [Symbol, Hash{Symbol=>Object}, Proc, FinchAPI::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Type::Converter, Class] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - private def variant(key, spec = nil) - variant_info = - case key - in Symbol - [key, FinchAPI::Type::Converter.type_info(spec)] - in Proc | FinchAPI::Type::Converter | Class | Hash - [nil, FinchAPI::Type::Converter.type_info(key)] - end - - known_variants << variant_info - end - - # @api private - # - # @param value [Object] - # - # @return [FinchAPI::Type::Converter, Class, nil] - private def resolve_variant(value) - case [@discriminator, value] - in [_, FinchAPI::BaseModel] - value.class - in [Symbol, Hash] - key = value.fetch(@discriminator) do - value.fetch(@discriminator.to_s, FinchAPI::Util::OMIT) - end - - return nil if key == FinchAPI::Util::OMIT - - key = key.to_sym if key.is_a?(String) - known_variants.find { |k,| k == key }&.last&.call - else - nil - end - end - - # rubocop:disable Style/HashEachMethods - # rubocop:disable Style/CaseEquality - - # @param other [Object] - # - # @return [Boolean] - def ===(other) - known_variants.any? do |_, variant_fn| - variant_fn.call === other - end - end - - # @param other [Object] - # - # @return [Boolean] - def ==(other) - other.is_a?(Module) && other.singleton_class <= FinchAPI::Union && other.derefed_variants == derefed_variants - end - - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(value, state:) - if (target = resolve_variant(value)) - return FinchAPI::Type::Converter.coerce(target, value, state: state) - end - - strictness = state.fetch(:strictness) - exactness = state.fetch(:exactness) - state[:strictness] = strictness == :strong ? true : strictness - - alternatives = [] - known_variants.each do |_, variant_fn| - target = variant_fn.call - exact = state[:exactness] = {yes: 0, no: 0, maybe: 0} - state[:branched] += 1 - - coerced = FinchAPI::Type::Converter.coerce(target, value, state: state) - yes, no, maybe = exact.values - if (no + maybe).zero? || (!strictness && yes.positive?) - exact.each { exactness[_1] += _2 } - state[:exactness] = exactness - return coerced - elsif maybe.positive? - alternatives << [[-yes, -maybe, no], exact, coerced] - end - end - - case alternatives.sort_by(&:first) - in [] - exactness[:no] += 1 - if strictness == :strong - message = "no possible conversion of #{value.class} into a variant of #{target.inspect}" - raise ArgumentError.new(message) - end - value - in [[_, exact, coerced], *] - exact.each { exactness[_1] += _2 } - coerced - end - .tap { state[:exactness] = exactness } - ensure - state[:strictness] = strictness - end - - # @api private - # - # @param value [Object] - # - # @return [Object] - def dump(value) - if (target = resolve_variant(value)) - return FinchAPI::Type::Converter.dump(target, value) - end - - known_variants.each do - target = _2.call - return FinchAPI::Type::Converter.dump(target, value) if target === value - end - - super - end - - # rubocop:enable Style/CaseEquality - # rubocop:enable Style/HashEachMethods - end - end -end diff --git a/lib/finch-api/type/unknown.rb b/lib/finch-api/type/unknown.rb deleted file mode 100644 index 3b93a847..00000000 --- a/lib/finch-api/type/unknown.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - module Type - # @api private - # - # @abstract - # - # When we don't know what to expect for the value. - class Unknown - extend FinchAPI::Type::Converter - - # rubocop:disable Lint/UnusedMethodArgument - - # @param other [Object] - # - # @return [Boolean] - def self.===(other) = true - - # @param other [Object] - # - # @return [Boolean] - def self.==(other) = other.is_a?(Class) && other <= FinchAPI::Unknown - - class << self - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean, :strong] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(value, state:) - state.fetch(:exactness)[:yes] += 1 - value - end - - # @!parse - # # @api private - # # - # # @param value [Object] - # # - # # @return [Object] - # def dump(value) = super - end - - # rubocop:enable Lint/UnusedMethodArgument - end - end -end diff --git a/lib/finch-api/util.rb b/lib/finch-api/util.rb deleted file mode 100644 index 92ab9d3d..00000000 --- a/lib/finch-api/util.rb +++ /dev/null @@ -1,726 +0,0 @@ -# frozen_string_literal: true - -module FinchAPI - # rubocop:disable Metrics/ModuleLength - - # @api private - module Util - # @api private - # - # @return [Float] - def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) - - class << self - # @api private - # - # @return [String] - def arch - case (arch = RbConfig::CONFIG["arch"])&.downcase - in nil - "unknown" - in /aarch64|arm64/ - "arm64" - in /x86_64/ - "x64" - in /arm/ - "arm" - else - "other:#{arch}" - end - end - - # @api private - # - # @return [String] - def os - case (host = RbConfig::CONFIG["host_os"])&.downcase - in nil - "Unknown" - in /linux/ - "Linux" - in /darwin/ - "MacOS" - in /freebsd/ - "FreeBSD" - in /openbsd/ - "OpenBSD" - in /mswin|mingw|cygwin|ucrt/ - "Windows" - else - "Other:#{host}" - end - end - end - - class << self - # @api private - # - # @param input [Object] - # - # @return [Boolean] - def primitive?(input) - case input - in true | false | Integer | Float | Symbol | String - true - else - false - end - end - - # @api private - # - # @param input [Object] - # - # @return [Boolean, Object] - def coerce_boolean(input) - case input.is_a?(String) ? input.downcase : input - in Numeric - input.nonzero? - in "true" - true - in "false" - false - else - input - end - end - - # @api private - # - # @param input [Object] - # - # @raise [ArgumentError] - # @return [Boolean, nil] - def coerce_boolean!(input) - case coerce_boolean(input) - in true | false | nil => coerced - coerced - else - raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") - end - end - - # @api private - # - # @param input [Object] - # - # @return [Integer, Object] - def coerce_integer(input) - case input - in true - 1 - in false - 0 - else - Integer(input, exception: false) || input - end - end - - # @api private - # - # @param input [Object] - # - # @return [Float, Object] - def coerce_float(input) - case input - in true - 1.0 - in false - 0.0 - else - Float(input, exception: false) || input - end - end - - # @api private - # - # @param input [Object] - # - # @return [Hash{Object=>Object}, Object] - def coerce_hash(input) - case input - in NilClass | Array | Set | Enumerator - input - else - input.respond_to?(:to_h) ? input.to_h : input - end - end - end - - # Use this to indicate that a value should be explicitly removed from a data - # structure when using `FinchAPI::Util.deep_merge`. - # - # e.g. merging `{a: 1}` and `{a: OMIT}` should produce `{}`, where merging - # `{a: 1}` and `{}` would produce `{a: 1}`. - OMIT = Object.new.freeze - - class << self - # @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, _] - rhs_cleaned = rhs.reject { _2 == FinchAPI::Util::OMIT } - lhs - .reject { |key, _| rhs[key] == FinchAPI::Util::OMIT } - .merge(rhs_cleaned) do |_, old_val, new_val| - deep_merge_lr(old_val, new_val, concat: concat) - end - in [Array, Array, true] - lhs.concat(rhs) - else - rhs - end - end - - # @api private - # - # Recursively merge one hash with another. If the values at a given key are not - # both hashes, just take the new value. - # - # @param values [Array] - # - # @param sentinel [Object, nil] the value to return if no values are provided. - # - # @param concat [Boolean] whether to merge sequences by concatenation. - # - # @return [Object] - def deep_merge(*values, sentinel: nil, concat: false) - case values - in [value, *values] - values.reduce(value) do |acc, val| - deep_merge_lr(acc, val, concat: concat) - end - else - sentinel - end - end - - # @api private - # - # @param data [Hash{Symbol=>Object}, Array, Object] - # @param pick [Symbol, Integer, Array, nil] - # @param sentinel [Object, nil] - # @param blk [Proc, nil] - # - # @return [Object, nil] - def dig(data, pick, sentinel = nil, &blk) - case [data, pick, blk] - in [_, nil, nil] - data - in [Hash, Symbol, _] | [Array, Integer, _] - blk.nil? ? data.fetch(pick, sentinel) : data.fetch(pick, &blk) - in [Hash | Array, Array, _] - pick.reduce(data) do |acc, key| - case acc - in Hash if acc.key?(key) - acc.fetch(key) - in Array if key.is_a?(Integer) && key < acc.length - acc[key] - else - return blk.nil? ? sentinel : blk.call - end - end - in _ - blk.nil? ? sentinel : blk.call - end - end - end - - class << self - # @api private - # - # @param uri [URI::Generic] - # - # @return [String] - def uri_origin(uri) - "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" - end - - # @api private - # - # @param path [String, Array] - # - # @return [String] - def interpolate_path(path) - case path - in String - path - in [] - "" - in [String, *interpolations] - encoded = interpolations.map { ERB::Util.url_encode(_1) } - path.first % encoded - end - end - end - - class << self - # @api private - # - # @param query [String, nil] - # - # @return [Hash{String=>Array}] - def decode_query(query) - CGI.parse(query.to_s) - end - - # @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 - # @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 - - # @api private - # - # @param parsed [Hash{Symbol=>String, Integer, nil}] . - # - # @option parsed [String, nil] :scheme - # - # @option parsed [String, nil] :host - # - # @option parsed [Integer, nil] :port - # - # @option parsed [String, nil] :path - # - # @option parsed [Hash{String=>Array}] :query - # - # @return [URI::Generic] - def unparse_uri(parsed) - URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) - end - - # @api private - # - # @param lhs [Hash{Symbol=>String, Integer, nil}] . - # - # @option lhs [String, nil] :scheme - # - # @option lhs [String, nil] :host - # - # @option lhs [Integer, nil] :port - # - # @option lhs [String, nil] :path - # - # @option lhs [Hash{String=>Array}] :query - # - # @param rhs [Hash{Symbol=>String, Integer, nil}] . - # - # @option rhs [String, nil] :scheme - # - # @option rhs [String, nil] :host - # - # @option rhs [Integer, nil] :port - # - # @option rhs [String, nil] :path - # - # @option rhs [Hash{String=>Array}] :query - # - # @return [URI::Generic] - def join_parsed_uri(lhs, rhs) - base_path, base_query = lhs.fetch_values(:path, :query) - slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" - - parsed_path, parsed_query = parse_uri(rhs.fetch(:path)).fetch_values(:path, :query) - override = URI::Generic.build(**rhs.slice(:scheme, :host, :port), path: parsed_path) - - joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) - query = deep_merge( - joined.path == base_path ? base_query : {}, - parsed_query, - rhs[:query].to_h, - concat: true - ) - - joined.query = encode_query(query) - joined - end - end - - class << self - # @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| - 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 - 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 - # @param blk [Proc] - # - # @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(y, boundary:, key:, val:) - y << "--#{boundary}\r\n" - y << "Content-Disposition: form-data" - unless key.nil? - name = ERB::Util.url_encode(key.to_s) - y << "; name=\"#{name}\"" - end - if val.is_a?(IO) - filename = ERB::Util.url_encode(File.basename(val.to_path)) - y << "; filename=\"#{filename}\"" - end - y << "\r\n" - case val - 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 - y << "Content-Type: application/octet-stream\r\n\r\n" - y << val.to_s - in true | false | Integer | Float | Symbol - y << "Content-Type: text/plain\r\n\r\n" - y << val.to_s - else - y << "Content-Type: application/json\r\n\r\n" - y << JSON.fast_generate(val) - end - y << "\r\n" - end - - # 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 [%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, strio = encode_multipart_streaming(body) - headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} - [headers, strio] - in [_, StringIO] - [headers, body.string] - else - [headers, body] - end - end - - # @api private - # - # @param headers [Hash{String=>String}, Net::HTTPHeader] - # @param stream [Enumerable] - # @param suppress_error [Boolean] - # - # @raise [JSON::ParserError] - # @return [Object] - def decode_content(headers, stream:, suppress_error: false) - case headers["content-type"] - in %r{^application/(?:vnd\.api\+)?json} - json = stream.to_a.join - begin - JSON.parse(json, symbolize_names: true) - rescue JSON::ParserError => e - raise e unless suppress_error - json - end - in %r{^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 - # TODO: parsing other response types - StringIO.new(stream.to_a.join) - end - end - end - - class << self - # @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, external: false, &close) - fused = false - iter = Enumerator.new do |y| - next if fused - - fused = true - if external - loop { y << enum.next } - else - enum.each(&y) - end - ensure - close&.call - close = nil - end - - iter.define_singleton_method(:rewind) do - fused = true - self - end - iter - end - - # @api private - # - # @param enum [Enumerable, nil] - def close_fused!(enum) - return unless enum.is_a?(Enumerator) - - # rubocop:disable Lint/UnreachableLoop - enum.rewind.each { break } - # rubocop:enable Lint/UnreachableLoop - end - - # @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) } - end - end - - class << self - # @api private - # - # @param enum [Enumerable] - # - # @return [Enumerable] - def decode_lines(enum) - re = /(\r\n|\r|\n)/ - buffer = String.new.b - cr_seen = nil - - chain_fused(enum) do |y| - enum.each do |row| - offset = buffer.bytesize - buffer << row - 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 - - # @api private - # - # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream - # - # @param lines [Enumerable] - # - # @return [Hash{Symbol=>Object}] - 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.sub(/\R$/, "") - in "" - next if current.empty? - y << {**blank, **current} - current = {} - in /^:/ - next - in /^([^:]+):\s?(.*)$/ - field, value = Regexp.last_match.captures - case field - in "event" - current.merge!(event: value) - in "data" - (current[:data] ||= String.new.b) << (value << "\n") - in "id" unless value.include?("\0") - current.merge!(id: value) - in "retry" if /^\d+$/ =~ value - current.merge!(retry: Integer(value)) - else - end - else - end - end - # rubocop:enable Metrics/BlockLength - - y << {**blank, **current} unless current.empty? - end - end - end - end - - # rubocop:enable Metrics/ModuleLength -end diff --git a/lib/finch_api.rb b/lib/finch_api.rb new file mode 100644 index 00000000..5ffeb67e --- /dev/null +++ b/lib/finch_api.rb @@ -0,0 +1,216 @@ +# frozen_string_literal: true + +# Standard libraries. +require "English" +require "cgi" +require "date" +require "erb" +require "etc" +require "json" +require "net/http" +require "pathname" +require "rbconfig" +require "securerandom" +require "set" +require "stringio" +require "time" +require "uri" + +# 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.chain([$PROGRAM_NAME]).chain(ARGV).grep(/tapioca/) + 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 + +# Gems. +require "connection_pool" + +# Package files. +require_relative "finch_api/version" +require_relative "finch_api/internal/util" +require_relative "finch_api/internal/type/converter" +require_relative "finch_api/internal/type/unknown" +require_relative "finch_api/internal/type/boolean_model" +require_relative "finch_api/internal/type/enum" +require_relative "finch_api/internal/type/union" +require_relative "finch_api/internal/type/array_of" +require_relative "finch_api/internal/type/hash_of" +require_relative "finch_api/internal/type/base_model" +require_relative "finch_api/internal/type/base_page" +require_relative "finch_api/internal/type/request_parameters" +require_relative "finch_api/internal" +require_relative "finch_api/request_options" +require_relative "finch_api/errors" +require_relative "finch_api/internal/transport/base_client" +require_relative "finch_api/internal/transport/pooled_net_requester" +require_relative "finch_api/client" +require_relative "finch_api/internal/individuals_page" +require_relative "finch_api/internal/page" +require_relative "finch_api/internal/responses_page" +require_relative "finch_api/internal/single_page" +require_relative "finch_api/models/base_webhook_event" +require_relative "finch_api/models/hris/benefit_contribution" +require_relative "finch_api/models/sandbox/jobs/sandbox_job_configuration" +require_relative "finch_api/models/access_token_create_params" +require_relative "finch_api/models/account_disconnect_params" +require_relative "finch_api/models/account_introspect_params" +require_relative "finch_api/models/account_update_event" +require_relative "finch_api/models/company_event" +require_relative "finch_api/models/connect/session_new_params" +require_relative "finch_api/models/connect/session_new_response" +require_relative "finch_api/models/connect/session_reauthenticate_params" +require_relative "finch_api/models/connect/session_reauthenticate_response" +require_relative "finch_api/models/connection_status_type" +require_relative "finch_api/models/create_access_token_response" +require_relative "finch_api/models/directory_event" +require_relative "finch_api/models/disconnect_response" +require_relative "finch_api/models/employment_event" +require_relative "finch_api/models/hris/benefit_create_params" +require_relative "finch_api/models/hris/benefit_features_and_operations" +require_relative "finch_api/models/hris/benefit_frequency" +require_relative "finch_api/models/hris/benefit_list_params" +require_relative "finch_api/models/hris/benefit_list_supported_benefits_params" +require_relative "finch_api/models/hris/benefit_retrieve_params" +require_relative "finch_api/models/hris/benefits/enrolled_individual" +require_relative "finch_api/models/hris/benefits/individual_benefit" +require_relative "finch_api/models/hris/benefits/individual_enrolled_ids_params" +require_relative "finch_api/models/hris/benefits/individual_enrolled_ids_response" +require_relative "finch_api/models/hris/benefits/individual_enroll_many_params" +require_relative "finch_api/models/hris/benefits/individual_retrieve_many_benefits_params" +require_relative "finch_api/models/hris/benefits/individual_unenroll_many_params" +require_relative "finch_api/models/hris/benefits/unenrolled_individual" +require_relative "finch_api/models/hris/benefits_support" +require_relative "finch_api/models/hris/benefit_type" +require_relative "finch_api/models/hris/benefit_update_params" +require_relative "finch_api/models/hris/benfit_contribution" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_create_params" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_create_response" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_delete_params" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_delete_response" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_list_params" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_list_response" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_update_params" +require_relative "finch_api/models/hris/company/pay_statement_item/rule_update_response" +require_relative "finch_api/models/hris/company/pay_statement_item_list_params" +require_relative "finch_api/models/hris/company/pay_statement_item_list_response" +require_relative "finch_api/models/hris/company_benefit" +require_relative "finch_api/models/hris/company_retrieve_params" +require_relative "finch_api/models/hris/create_company_benefits_response" +require_relative "finch_api/models/hris/directory_list_individuals_params" +require_relative "finch_api/models/hris/directory_list_params" +require_relative "finch_api/models/hris/document_list_params" +require_relative "finch_api/models/hris/document_list_response" +require_relative "finch_api/models/hris/document_response" +require_relative "finch_api/models/hris/document_retreive_params" +require_relative "finch_api/models/hris/document_retreive_response" +require_relative "finch_api/models/hris/employment_data" +require_relative "finch_api/models/hris/employment_data_response" +require_relative "finch_api/models/hris/employment_retrieve_many_params" +require_relative "finch_api/models/hris/company" +require_relative "finch_api/models/hris/individual" +require_relative "finch_api/models/hris/individual_in_directory" +require_relative "finch_api/models/hris/individual_response" +require_relative "finch_api/models/hris/individual_retrieve_many_params" +require_relative "finch_api/models/hris/payment" +require_relative "finch_api/models/hris/payment_list_params" +require_relative "finch_api/models/hris/pay_statement" +require_relative "finch_api/models/hris/pay_statement_response" +require_relative "finch_api/models/hris/pay_statement_response_body" +require_relative "finch_api/models/hris/pay_statement_retrieve_many_params" +require_relative "finch_api/models/hris/supported_benefit" +require_relative "finch_api/models/hris/support_per_benefit_type" +require_relative "finch_api/models/hris/update_company_benefit_response" +require_relative "finch_api/models/hris/w42005" +require_relative "finch_api/models/hris/w42020" +require_relative "finch_api/models/income" +require_relative "finch_api/models/individual_event" +require_relative "finch_api/models/introspection" +require_relative "finch_api/models/job_completion_event" +require_relative "finch_api/models/jobs/automated_async_job" +require_relative "finch_api/models/jobs/automated_create_params" +require_relative "finch_api/models/jobs/automated_create_response" +require_relative "finch_api/models/jobs/automated_list_params" +require_relative "finch_api/models/jobs/automated_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" +require_relative "finch_api/models/location" +require_relative "finch_api/models/money" +require_relative "finch_api/models/operation_support" +require_relative "finch_api/models/operation_support_matrix" +require_relative "finch_api/models/paging" +require_relative "finch_api/models/payment_event" +require_relative "finch_api/models/payroll/pay_group_list_params" +require_relative "finch_api/models/payroll/pay_group_list_response" +require_relative "finch_api/models/payroll/pay_group_retrieve_params" +require_relative "finch_api/models/payroll/pay_group_retrieve_response" +require_relative "finch_api/models/pay_statement_event" +require_relative "finch_api/models/provider" +require_relative "finch_api/models/provider_list_params" +require_relative "finch_api/models/request_forwarding_forward_params" +require_relative "finch_api/models/request_forwarding_forward_response" +require_relative "finch_api/models/sandbox/company_update_params" +require_relative "finch_api/models/sandbox/company_update_response" +require_relative "finch_api/models/sandbox/connection_create_params" +require_relative "finch_api/models/sandbox/connection_create_response" +require_relative "finch_api/models/sandbox/connections/account_create_params" +require_relative "finch_api/models/sandbox/connections/account_create_response" +require_relative "finch_api/models/sandbox/connections/account_update_params" +require_relative "finch_api/models/sandbox/connections/account_update_response" +require_relative "finch_api/models/sandbox/directory_create_params" +require_relative "finch_api/models/sandbox/directory_create_response" +require_relative "finch_api/models/sandbox/employment_update_params" +require_relative "finch_api/models/sandbox/employment_update_response" +require_relative "finch_api/models/sandbox/individual_update_params" +require_relative "finch_api/models/sandbox/individual_update_response" +require_relative "finch_api/models/sandbox/job_create_params" +require_relative "finch_api/models/sandbox/job_create_response" +require_relative "finch_api/models/sandbox/jobs/configuration_retrieve_params" +require_relative "finch_api/models/sandbox/jobs/configuration_retrieve_response" +require_relative "finch_api/models/sandbox/jobs/configuration_update_params" +require_relative "finch_api/models/sandbox/payment_create_params" +require_relative "finch_api/models/sandbox/payment_create_response" +require_relative "finch_api/models/webhook_event" +require_relative "finch_api/resources/access_tokens" +require_relative "finch_api/resources/account" +require_relative "finch_api/resources/connect" +require_relative "finch_api/resources/connect/sessions" +require_relative "finch_api/resources/hris" +require_relative "finch_api/resources/hris/benefits" +require_relative "finch_api/resources/hris/benefits/individuals" +require_relative "finch_api/resources/hris/company" +require_relative "finch_api/resources/hris/company/pay_statement_item" +require_relative "finch_api/resources/hris/company/pay_statement_item/rules" +require_relative "finch_api/resources/hris/directory" +require_relative "finch_api/resources/hris/documents" +require_relative "finch_api/resources/hris/employments" +require_relative "finch_api/resources/hris/individuals" +require_relative "finch_api/resources/hris/payments" +require_relative "finch_api/resources/hris/pay_statements" +require_relative "finch_api/resources/jobs" +require_relative "finch_api/resources/jobs/automated" +require_relative "finch_api/resources/jobs/manual" +require_relative "finch_api/resources/payroll" +require_relative "finch_api/resources/payroll/pay_groups" +require_relative "finch_api/resources/providers" +require_relative "finch_api/resources/request_forwarding" +require_relative "finch_api/resources/sandbox" +require_relative "finch_api/resources/sandbox/company" +require_relative "finch_api/resources/sandbox/connections" +require_relative "finch_api/resources/sandbox/connections/accounts" +require_relative "finch_api/resources/sandbox/directory" +require_relative "finch_api/resources/sandbox/employment" +require_relative "finch_api/resources/sandbox/individual" +require_relative "finch_api/resources/sandbox/jobs" +require_relative "finch_api/resources/sandbox/jobs/configuration" +require_relative "finch_api/resources/sandbox/payment" +require_relative "finch_api/resources/webhooks" diff --git a/lib/finch-api/client.rb b/lib/finch_api/client.rb similarity index 98% rename from lib/finch-api/client.rb rename to lib/finch_api/client.rb index 9450ff86..f9f95917 100644 --- a/lib/finch-api/client.rb +++ b/lib/finch_api/client.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module FinchAPI - class Client < FinchAPI::Transport::BaseClient + class Client < FinchAPI::Internal::Transport::BaseClient # Default max number of retries to attempt after a failed retryable request. DEFAULT_MAX_RETRIES = 2 @@ -82,14 +82,14 @@ class Client < FinchAPI::Transport::BaseClient # Creates and returns a new client for interacting with the API. # - # @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` - # - # @param access_token [String, nil] - # # @param client_id [String, nil] Defaults to `ENV["FINCH_CLIENT_ID"]` # # @param client_secret [String, nil] Defaults to `ENV["FINCH_CLIENT_SECRET"]` # + # @param access_token [String, nil] + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + # # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. # # @param timeout [Float] @@ -98,10 +98,10 @@ class Client < FinchAPI::Transport::BaseClient # # @param max_retry_delay [Float] def initialize( - base_url: nil, - access_token: nil, client_id: ENV["FINCH_CLIENT_ID"], client_secret: ENV["FINCH_CLIENT_SECRET"], + access_token: nil, + base_url: nil, max_retries: DEFAULT_MAX_RETRIES, timeout: DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, @@ -113,9 +113,9 @@ def initialize( "finch-api-version" => "2020-09-17" } - @access_token = access_token&.to_s @client_id = client_id&.to_s @client_secret = client_secret&.to_s + @access_token = access_token&.to_s super( base_url: base_url, diff --git a/lib/finch_api/errors.rb b/lib/finch_api/errors.rb new file mode 100644 index 00000000..ff221b67 --- /dev/null +++ b/lib/finch_api/errors.rb @@ -0,0 +1,192 @@ +# frozen_string_literal: true + +module FinchAPI + module Errors + class Error < StandardError + # @!parse + # # @return [StandardError, nil] + # attr_accessor :cause + end + + class ConversionError < FinchAPI::Errors::Error + end + + class APIError < FinchAPI::Errors::Error + # @return [URI::Generic] + attr_accessor :url + + # @return [Integer, nil] + attr_accessor :status + + # @return [Object, nil] + attr_accessor :body + + # @api private + # + # @param url [URI::Generic] + # @param status [Integer, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + @url = url + @status = status + @body = body + @request = request + @response = response + super(message) + end + end + + class APIConnectionError < FinchAPI::Errors::APIError + # @!parse + # # @return [nil] + # attr_accessor :status + + # @!parse + # # @return [nil] + # attr_accessor :body + + # @api private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) + super + end + end + + class APITimeoutError < FinchAPI::Errors::APIConnectionError + # @api private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) + super + end + end + + class APIStatusError < FinchAPI::Errors::APIError + # @api private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + # @return [FinchAPI::Errors::APIStatusError] + def self.for(url:, status:, body:, request:, response:, message: nil) + kwargs = { + url: url, + status: status, + body: body, + request: request, + response: response, + message: message + } + + case status + in 400 + FinchAPI::Errors::BadRequestError.new(**kwargs) + in 401 + FinchAPI::Errors::AuthenticationError.new(**kwargs) + in 403 + FinchAPI::Errors::PermissionDeniedError.new(**kwargs) + in 404 + FinchAPI::Errors::NotFoundError.new(**kwargs) + in 409 + FinchAPI::Errors::ConflictError.new(**kwargs) + in 422 + FinchAPI::Errors::UnprocessableEntityError.new(**kwargs) + in 429 + FinchAPI::Errors::RateLimitError.new(**kwargs) + in (500..) + FinchAPI::Errors::InternalServerError.new(**kwargs) + else + FinchAPI::Errors::APIStatusError.new(**kwargs) + end + end + + # @!parse + # # @return [Integer] + # attr_accessor :status + + # @api private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize(url:, status:, body:, request:, response:, message: nil) + message ||= {url: url.to_s, status: status, body: body} + super( + url: url, + status: status, + body: body, + request: request, + response: response, + message: message&.to_s + ) + end + end + + class BadRequestError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = (500..) + end + end +end diff --git a/lib/finch_api/internal.rb b/lib/finch_api/internal.rb new file mode 100644 index 00000000..34eea5eb --- /dev/null +++ b/lib/finch_api/internal.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module FinchAPI + # @api private + module Internal + OMIT = Object.new.freeze + end +end diff --git a/lib/finch_api/internal/individuals_page.rb b/lib/finch_api/internal/individuals_page.rb new file mode 100644 index 00000000..0cf48ca0 --- /dev/null +++ b/lib/finch_api/internal/individuals_page.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + # @generic Elem + # + # @example + # if individuals_page.has_next? + # individuals_page = individuals_page.next_page + # end + # + # @example + # individuals_page.auto_paging_each do |directory| + # puts(directory) + # end + class IndividualsPage + include FinchAPI::Internal::Type::BasePage + + # @return [Array>, nil] + attr_accessor :individuals + + # @return [FinchAPI::Models::Paging] + attr_accessor :paging + + # @api private + # + # @param client [FinchAPI::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super + model = req.fetch(:model) + + case page_data + in {individuals: Array | nil => individuals} + @individuals = individuals&.map { FinchAPI::Internal::Type::Converter.coerce(model, _1) } + else + end + + case page_data + in {paging: Hash | nil => paging} + @paging = FinchAPI::Internal::Type::Converter.coerce(FinchAPI::Models::Paging, paging) + else + end + end + + # @return [Boolean] + def next_page? + paging&.offset.to_i + individuals.to_a.size < paging&.count.to_i + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::Internal::IndividualsPage] + def next_page + unless next_page? + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) + end + + req = FinchAPI::Internal::Util.deep_merge( + @req, + {query: {offset: paging&.offset.to_i + individuals.to_a.size}} + ) + @client.request(req) + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + page = self + loop do + page.individuals&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} individuals=#{individuals.inspect} paging=#{paging.inspect}>" + end + end + end +end diff --git a/lib/finch_api/internal/page.rb b/lib/finch_api/internal/page.rb new file mode 100644 index 00000000..69114f76 --- /dev/null +++ b/lib/finch_api/internal/page.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + # @generic Elem + # + # @example + # if page.has_next? + # page = page.next_page + # end + # + # @example + # page.auto_paging_each do |item| + # puts(item) + # end + class Page + include FinchAPI::Internal::Type::BasePage + + # @return [Array>, nil] + attr_accessor :data + + # @return [FinchAPI::Models::Paging] + attr_accessor :paging + + # @api private + # + # @param client [FinchAPI::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super + model = req.fetch(:model) + + case page_data + in {data: Array | nil => data} + @data = data&.map { FinchAPI::Internal::Type::Converter.coerce(model, _1) } + else + end + + case page_data + in {paging: Hash | nil => paging} + @paging = FinchAPI::Internal::Type::Converter.coerce(FinchAPI::Models::Paging, paging) + else + end + end + + # @return [Boolean] + def next_page? + paging&.offset.to_i + data.to_a.size < paging&.count.to_i + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::Internal::Page] + def next_page + unless next_page? + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) + end + + req = FinchAPI::Internal::Util.deep_merge( + @req, + {query: {offset: paging&.offset.to_i + data.to_a.size}} + ) + @client.request(req) + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + page = self + loop do + page.data&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} paging=#{paging.inspect}>" + end + end + end +end diff --git a/lib/finch_api/internal/responses_page.rb b/lib/finch_api/internal/responses_page.rb new file mode 100644 index 00000000..dbf6c63f --- /dev/null +++ b/lib/finch_api/internal/responses_page.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + # @generic Elem + # + # @example + # if responses_page.has_next? + # responses_page = responses_page.next_page + # end + # + # @example + # responses_page.auto_paging_each do |pay_statement_item| + # puts(pay_statement_item) + # end + class ResponsesPage + include FinchAPI::Internal::Type::BasePage + + # @return [Array>, nil] + attr_accessor :responses + + # @api private + # + # @param client [FinchAPI::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Array] + def initialize(client:, req:, headers:, page_data:) + super + model = req.fetch(:model) + + case page_data + in {responses: Array | nil => responses} + @responses = responses&.map { FinchAPI::Internal::Type::Converter.coerce(model, _1) } + else + end + end + + # @return [Boolean] + def next_page? + false + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::Internal::ResponsesPage] + def next_page + RuntimeError.new("No more pages available.") + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + page = self + loop do + page.responses&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} responses=#{responses.inspect}>" + end + end + end +end diff --git a/lib/finch_api/internal/single_page.rb b/lib/finch_api/internal/single_page.rb new file mode 100644 index 00000000..e421bb66 --- /dev/null +++ b/lib/finch_api/internal/single_page.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + # @generic Elem + # + # @example + # if single_page.has_next? + # single_page = single_page.next_page + # end + # + # @example + # single_page.auto_paging_each do |payment| + # puts(payment) + # end + class SinglePage < ::Array + include FinchAPI::Internal::Type::BasePage + + # @api private + # + # @param client [FinchAPI::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Array] + def initialize(client:, req:, headers:, page_data:) + super + model = req.fetch(:model) + + case page_data + in Array + replace(page_data.map { FinchAPI::Internal::Type::Converter.coerce(model, _1) }) + else + end + end + + # @return [Boolean] + def next_page? + false + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::Internal::SinglePage] + def next_page + RuntimeError.new("No more pages available.") + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + page = self + loop do + page.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)}>" + end + end + end +end diff --git a/lib/finch_api/internal/transport/base_client.rb b/lib/finch_api/internal/transport/base_client.rb new file mode 100644 index 00000000..ef75eb28 --- /dev/null +++ b/lib/finch_api/internal/transport/base_client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Transport + # @api private + # + # @abstract + class BaseClient + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + # rubocop:disable Style/MutableConstant + PLATFORM_HEADERS = + { + "x-stainless-arch" => FinchAPI::Internal::Util.arch, + "x-stainless-lang" => "ruby", + "x-stainless-os" => FinchAPI::Internal::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 + # @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 + in Hash + req.each_key do |k| + unless keys.include?(k) + raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") + end + end + + # @api private + # + # @param status [Integer] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # + # @return [Boolean] + def should_retry?(status, headers:) + coerced = FinchAPI::Internal::Util.coerce_boolean(headers["x-should-retry"]) + case [coerced, status] + in [true | false, _] + coerced + in [_, 408 | 409 | 429 | (500..)] + # retry on: + # 408: timeouts + # 409: locks + # 429: rate limits + # 500+: unknown errors + true + else + false + end + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param status [Integer] + # + # @param response_headers [Hash{String=>String}, Net::HTTPHeader] + # + # @return [Hash{Symbol=>Object}] + def follow_redirect(request, status:, response_headers:) + method, url, headers = request.fetch_values(:method, :url, :headers) + location = + Kernel.then do + URI.join(url, response_headers["location"]) + rescue ArgumentError + message = "Server responded with status #{status} but no valid location header." + raise FinchAPI::Errors::APIConnectionError.new(url: url, message: message) + end + + request = {**request, url: location} + + case [url.scheme, location.scheme] + in ["https", "http"] + message = "Tried to redirect to a insecure URL" + raise FinchAPI::Errors::APIConnectionError.new(url: url, message: message) + else + nil + end + + # from whatwg fetch spec + case [status, method] + in [301 | 302, :post] | [303, _] + drop = %w[content-encoding content-language content-length content-location content-type] + request = { + **request, + method: method == :head ? :head : :get, + headers: headers.except(*drop), + body: nil + } + else + end + + # from undici + if FinchAPI::Internal::Util.uri_origin(url) != FinchAPI::Internal::Util.uri_origin(location) + drop = %w[authorization cookie host proxy-authorization] + request = {**request, headers: request.fetch(:headers).except(*drop)} + end + + request + end + + # @api private + # + # @param status [Integer, FinchAPI::Errors::APIConnectionError] + # @param stream [Enumerable, nil] + def reap_connection!(status, stream:) + case status + in (..199) | (300..499) + stream&.each { next } + in FinchAPI::Errors::APIConnectionError | (500..) + FinchAPI::Internal::Util.close_fused!(stream) + else + end + end + end + + # @api private + # @return [FinchAPI::Internal::Transport::PooledNetRequester] + attr_accessor :requester + + # @api private + # + # @param base_url [String] + # @param timeout [Float] + # @param max_retries [Integer] + # @param initial_retry_delay [Float] + # @param max_retry_delay [Float] + # @param headers [Hash{String=>String, Integer, Array, nil}] + # @param idempotency_header [String, nil] + def initialize( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + @requester = FinchAPI::Internal::Transport::PooledNetRequester.new + @headers = FinchAPI::Internal::Util.normalized_headers( + self.class::PLATFORM_HEADERS, + { + "accept" => "application/json", + "content-type" => "application/json" + }, + headers + ) + @base_url = FinchAPI::Internal::Util.parse_uri(base_url) + @idempotency_header = idempotency_header&.to_s&.downcase + @max_retries = max_retries + @timeout = timeout + @initial_retry_delay = initial_retry_delay + @max_retry_delay = max_retry_delay + end + + # @api private + # + # @return [Hash{String=>String}] + private def auth_headers = {} + + # @api private + # + # @return [String] + private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" + + # @api private + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Class, nil] :stream + # + # @option req [FinchAPI::Internal::Type::Converter, Class, nil] :model + # + # @param opts [Hash{Symbol=>Object}] . + # + # @option opts [String, nil] :idempotency_key + # + # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option opts [Hash{String=>String, nil}, nil] :extra_headers + # + # @option opts [Object, nil] :extra_body + # + # @option opts [Integer, nil] :max_retries + # + # @option opts [Float, nil] :timeout + # + # @return [Hash{Symbol=>Object}] + private def build_request(req, opts) + method, uninterpolated_path = req.fetch_values(:method, :path) + + path = FinchAPI::Internal::Util.interpolate_path(uninterpolated_path) + + query = FinchAPI::Internal::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) + + headers = FinchAPI::Internal::Util.normalized_headers( + @headers, + auth_headers, + req[:headers].to_h, + opts[:extra_headers].to_h + ) + + if @idempotency_header && + !headers.key?(@idempotency_header) && + !Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) + headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } + end + + unless headers.key?("x-stainless-retry-count") + headers["x-stainless-retry-count"] = "0" + end + + timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..)) + unless headers.key?("x-stainless-timeout") || timeout.zero? + headers["x-stainless-timeout"] = timeout.to_s + end + + headers.reject! { |_, v| v.to_s.empty? } + + body = + case method + in :get | :head | :options | :trace + nil + else + FinchAPI::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) + end + + headers, encoded = FinchAPI::Internal::Util.encode_content(headers, body) + { + method: method, + url: FinchAPI::Internal::Util.join_parsed_uri(@base_url, {**req, path: path, query: query}), + headers: headers, + body: encoded, + max_retries: opts.fetch(:max_retries, @max_retries), + timeout: timeout + } + end + + # @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 } + return span if span + + retry_header = headers["retry-after"] + return span if (span = Float(retry_header, exception: false)) + + span = retry_header&.then do + Time.httpdate(_1) - Time.now + rescue ArgumentError + nil + end + return span if span + + scale = retry_count**2 + jitter = 1 - (0.25 * rand) + (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param redirect_count [Integer] + # + # @param retry_count [Integer] + # + # @param send_retry_header [Boolean] + # + # @raise [FinchAPI::Errors::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::Internal::Util.monotonic_secs + timeout} + + if send_retry_header + headers["x-stainless-retry-count"] = retry_count.to_s + end + + begin + status, response, stream = @requester.execute(input) + rescue FinchAPI::Errors::APIConnectionError => e + status = e + end + + case status + in ..299 + [status, response, stream] + in 300..399 if redirect_count >= self.class::MAX_REDIRECTS + self.class.reap_connection!(status, stream: stream) + + message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." + raise FinchAPI::Errors::APIConnectionError.new(url: url, message: message) + in 300..399 + self.class.reap_connection!(status, stream: stream) + + request = self.class.follow_redirect(request, status: status, response_headers: response) + send_request( + request, + redirect_count: redirect_count + 1, + retry_count: retry_count, + send_retry_header: send_retry_header + ) + in FinchAPI::Errors::APIConnectionError if retry_count >= max_retries + raise status + in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response) + decoded = Kernel.then do + FinchAPI::Internal::Util.decode_content(response, stream: stream, suppress_error: true) + ensure + self.class.reap_connection!(status, stream: stream) + end + + raise FinchAPI::Errors::APIStatusError.for( + url: url, + status: status, + body: decoded, + request: nil, + response: response + ) + in (400..) | FinchAPI::Errors::APIConnectionError + self.class.reap_connection!(status, stream: stream) + + delay = retry_delay(response, retry_count: retry_count) + sleep(delay) + + send_request( + request, + redirect_count: redirect_count, + retry_count: retry_count + 1, + send_retry_header: send_retry_header + ) + end + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, options: {}) + # + # @param method [Symbol] + # + # @param path [String, Array] + # + # @param query [Hash{String=>Array, String, nil}, nil] + # + # @param headers [Hash{String=>String, Integer, Array, nil}, nil] + # + # @param body [Object, nil] + # + # @param unwrap [Symbol, nil] + # + # @param page [Class, nil] + # + # @param stream [Class, nil] + # + # @param model [FinchAPI::Internal::Type::Converter, Class, nil] + # + # @param options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] . + # + # @option options [String, nil] :idempotency_key + # + # @option options [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option options [Hash{String=>String, nil}, nil] :extra_headers + # + # @option options [Object, nil] :extra_body + # + # @option options [Integer, nil] :max_retries + # + # @option options [Float, nil] :timeout + # + # @raise [FinchAPI::Errors::APIError] + # @return [Object] + def request(req) + self.class.validate!(req) + model = req.fetch(:model) { FinchAPI::Internal::Type::Unknown } + opts = req[:options].to_h + FinchAPI::RequestOptions.validate!(opts) + request = build_request(req.except(:options), opts) + url = request.fetch(:url) + + # Don't send the current retry count in the headers if the caller modified the header defaults. + send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" + status, response, stream = send_request( + request, + redirect_count: 0, + retry_count: 0, + send_retry_header: send_retry_header + ) + + decoded = FinchAPI::Internal::Util.decode_content(response, stream: stream) + case req + in { stream: Class => st } + st.new(model: model, url: url, status: status, response: response, stream: decoded) + in { page: Class => page } + page.new(client: self, req: req, headers: response, page_data: decoded) + else + unwrapped = FinchAPI::Internal::Util.dig(decoded, req[:unwrap]) + FinchAPI::Internal::Type::Converter.coerce(model, unwrapped) + end + end + + # @return [String] + def inspect + # rubocop:disable Layout/LineLength + base_url = FinchAPI::Internal::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 + end +end diff --git a/lib/finch_api/internal/transport/pooled_net_requester.rb b/lib/finch_api/internal/transport/pooled_net_requester.rb new file mode 100644 index 00000000..210fbc45 --- /dev/null +++ b/lib/finch_api/internal/transport/pooled_net_requester.rb @@ -0,0 +1,184 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Transport + # @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 + # @api private + # + # @param url [URI::Generic] + # + # @return [Net::HTTP] + def connect(url) + port = + case [url.port, url.scheme] + in [Integer, _] + url.port + in [nil, "http" | "ws"] + Net::HTTP.http_default_port + in [nil, "https" | "wss"] + Net::HTTP.https_default_port + end + + Net::HTTP.new(url.host, port).tap do + _1.use_ssl = %w[https wss].include?(url.scheme) + _1.max_retries = 0 + end + end + + # @api private + # + # @param conn [Net::HTTP] + # @param deadline [Float] + def calibrate_socket_timeout(conn, deadline) + timeout = deadline - FinchAPI::Internal::Util.monotonic_secs + conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @param blk [Proc] + # + # @yieldparam [String] + # @return [Net::HTTPGenericRequest] + def build_request(request, &blk) + method, url, headers, body = request.fetch_values(:method, :url, :headers, :body) + req = Net::HTTPGenericRequest.new( + method.to_s.upcase, + !body.nil?, + method != :head, + url.to_s + ) + + headers.each { req[_1] = _2 } + + case body + in nil + nil + in String + req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] + req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk) + in StringIO + req["content-length"] ||= body.size.to_s unless req["transfer-encoding"] + req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk) + in IO | Enumerator + req["transfer-encoding"] ||= "chunked" unless req["content-length"] + req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk) + end + + req + end + end + + # @api private + # + # @param url [URI::Generic] + # @param deadline [Float] + # @param blk [Proc] + # + # @raise [Timeout::Error] + # @yieldparam [Net::HTTP] + private def with_pool(url, deadline:, &blk) + origin = FinchAPI::Internal::Util.uri_origin(url) + timeout = deadline - FinchAPI::Internal::Util.monotonic_secs + pool = + @mutex.synchronize do + @pools[origin] ||= ConnectionPool.new(size: @size) do + self.class.connect(url) + end + end + + pool.with(timeout: timeout, &blk) + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Float] :deadline + # + # @return [Array(Integer, Net::HTTPResponse, Enumerable)] + def execute(request) + url, deadline = request.fetch_values(:url, :deadline) + + eof = false + finished = false + enum = Enumerator.new do |y| + 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) + 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, req, rsp] + break if finished + + rsp.read_body do |bytes| + y << bytes + break if finished + + self.class.calibrate_socket_timeout(conn, deadline) + end + eof = true + end + end + rescue Timeout::Error + raise FinchAPI::Errors::APITimeoutError + end + + conn, _, response = enum.next + body = FinchAPI::Internal::Util.fused_enum(enum, external: true) do + finished = true + tap do + enum.next + rescue StopIteration + nil + end + conn.finish if !eof && conn&.started? + end + [Integer(response.code), response, (response.body = body)] + end + + # @api private + # + # @param size [Integer] + def initialize(size: Etc.nprocessors) + @mutex = Mutex.new + @size = size + @pools = {} + end + end + end + end +end diff --git a/lib/finch_api/internal/type/array_of.rb b/lib/finch_api/internal/type/array_of.rb new file mode 100644 index 00000000..b552bbfe --- /dev/null +++ b/lib/finch_api/internal/type/array_of.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @api private + # + # @abstract + # + # @generic Elem + # + # Array of items of a given type. + class ArrayOf + include FinchAPI::Internal::Type::Converter + + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::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) = other.is_a?(Array) && other.all?(item_type) + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + # rubocop:disable Layout/LineLength + other.is_a?(FinchAPI::Internal::Type::ArrayOf) && other.nilable? == nilable? && other.item_type == item_type + # rubocop:enable Layout/LineLength + end + + # @api private + # + # @param value [Array, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Array, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + + unless value.is_a?(Array) + exactness[:no] += 1 + return value + end + + target = item_type + exactness[:yes] += 1 + value + .map do |item| + case [nilable?, item] + in [true, nil] + exactness[:yes] += 1 + nil + else + FinchAPI::Internal::Type::Converter.coerce(target, item, state: state) + end + end + end + + # @api private + # + # @param value [Array, Object] + # + # @return [Array, Object] + def dump(value) + target = item_type + if value.is_a?(Array) + value.map do + FinchAPI::Internal::Type::Converter.dump(target, _1) + end + else + super + end + end + + # @api private + # + # @return [generic] + protected def item_type = @item_type_fn.call + + # @api private + # + # @return [Boolean] + protected def nilable? = @nilable + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def initialize(type_info, spec = {}) + @item_type_fn = FinchAPI::Internal::Type::Converter.type_info(type_info || spec) + @nilable = spec[:nil?] + end + end + end + end +end diff --git a/lib/finch_api/internal/type/base_model.rb b/lib/finch_api/internal/type/base_model.rb new file mode 100644 index 00000000..338c570c --- /dev/null +++ b/lib/finch_api/internal/type/base_model.rb @@ -0,0 +1,376 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @abstract + # + # @example + # # `operation_support_matrix` is a `FinchAPI::Models::OperationSupportMatrix` + # operation_support_matrix => { + # create: create, + # delete: delete, + # read: read + # } + class BaseModel + extend FinchAPI::Internal::Type::Converter + + class << self + # @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::Internal::Type::BaseModel ? superclass.known_fields.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 + + # @api private + # + # @param name_sym [Symbol] + # + # @param required [Boolean] + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::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 | FinchAPI::Internal::Type::Converter | Class + [FinchAPI::Internal::Type::Converter.type_info({**spec, union: type_info}), spec] + in Hash + [FinchAPI::Internal::Type::Converter.type_info(type_info), type_info] + end + + setter = "#{name_sym}=" + api_name = info.fetch(:api_name, name_sym) + nilable = info[:nil?] + const = if required && !nilable + info.fetch( + :const, + FinchAPI::Internal::OMIT + ) + else + FinchAPI::Internal::OMIT + end + + [name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym) + + known_fields[name_sym] = + { + mode: @mode, + api_name: api_name, + required: required, + nilable: nilable, + const: const, + type_fn: type_fn + } + + define_method(setter) { @data.store(name_sym, _1) } + + define_method(name_sym) do + target = type_fn.call + value = @data.fetch(name_sym) { const == FinchAPI::Internal::OMIT ? nil : const } + state = {strictness: :strong, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} + if (nilable || !required) && value.nil? + nil + else + FinchAPI::Internal::Type::Converter.coerce( + target, + value, + state: state + ) + end + rescue StandardError + cls = self.class.name.split("::").last + # rubocop:disable Layout/LineLength + message = "Failed to parse #{cls}.#{__method__} from #{value.class} to #{target.inspect}. To get the unparsed API response, use #{cls}[:#{__method__}]." + # rubocop:enable Layout/LineLength + raise FinchAPI::Errors::ConversionError.new(message) + end + end + + # @api private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::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 + + # @api private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::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 + + # @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 + + # @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 + + # @param other [Object] + # + # @return [Boolean] + def ==(other) = other.is_a?(Class) && other <= FinchAPI::Internal::Type::BaseModel && other.fields == fields + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) = self.class == other.class && @data == other.to_h + + class << self + # @api private + # + # @param value [FinchAPI::Internal::Type::BaseModel, Hash{Object=>Object}, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [FinchAPI::Internal::Type::BaseModel, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + + if value.is_a?(self.class) + exactness[:yes] += 1 + return value + end + + unless (val = FinchAPI::Internal::Util.coerce_hash(value)).is_a?(Hash) + exactness[:no] += 1 + return value + end + exactness[:yes] += 1 + + keys = val.keys.to_set + instance = new + data = instance.to_h + + # rubocop:disable Metrics/BlockLength + fields.each do |name, field| + mode, required, target = field.fetch_values(:mode, :required, :type) + api_name, nilable, const = field.fetch_values(:api_name, :nilable, :const) + + unless val.key?(api_name) + if required && mode != :dump && const == FinchAPI::Internal::OMIT + exactness[nilable ? :maybe : :no] += 1 + else + exactness[:yes] += 1 + end + next + end + + item = val.fetch(api_name) + keys.delete(api_name) + + converted = + if item.nil? && (nilable || !required) + exactness[nilable ? :yes : :maybe] += 1 + nil + else + coerced = FinchAPI::Internal::Type::Converter.coerce(target, item, state: state) + case target + in FinchAPI::Internal::Type::Converter | Symbol + coerced + else + item + end + end + data.store(name, converted) + end + # rubocop:enable Metrics/BlockLength + + keys.each { data.store(_1, val.fetch(_1)) } + instance + end + + # @api private + # + # @param value [FinchAPI::Internal::Type::BaseModel, Object] + # + # @return [Hash{Object=>Object}, Object] + def dump(value) + unless (coerced = FinchAPI::Internal::Util.coerce_hash(value)).is_a?(Hash) + return super + end + + acc = {} + + coerced.each do |key, val| + name = key.is_a?(String) ? key.to_sym : key + case (field = known_fields[name]) + in nil + acc.store(name, super(val)) + else + mode, api_name, type_fn = field.fetch_values(:mode, :api_name, :type_fn) + case mode + in :coerce + next + else + target = type_fn.call + acc.store(api_name, FinchAPI::Internal::Type::Converter.dump(target, val)) + end + end + end + + known_fields.each_value do |field| + mode, api_name, const = field.fetch_values(:mode, :api_name, :const) + next if mode == :coerce || acc.key?(api_name) || const == FinchAPI::Internal::OMIT + acc.store(api_name, const) + end + + acc + 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. + # + # @param key [Symbol] + # + # @return [Object, nil] + def [](key) + unless key.instance_of?(Symbol) + raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") + end + + @data[key] + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + # + # @return [Hash{Symbol=>Object}] + def to_h = @data + + alias_method :to_hash, :to_h + + # @param keys [Array, nil] + # + # @return [Hash{Symbol=>Object}] + def deconstruct_keys(keys) + (keys || self.class.known_fields.keys) + .filter_map do |k| + unless self.class.known_fields.key?(k) + next + end + + [k, public_send(k)] + end + .to_h + end + + # @param a [Object] + # + # @return [String] + def to_json(*a) = self.class.dump(self).to_json(*a) + + # @param a [Object] + # + # @return [String] + def to_yaml(*a) = self.class.dump(self).to_yaml(*a) + + # Create a new instance of a model. + # + # @param data [Hash{Symbol=>Object}, FinchAPI::Internal::Type::BaseModel] + def initialize(data = {}) + case FinchAPI::Internal::Util.coerce_hash(data) + in Hash => coerced + @data = coerced + else + raise ArgumentError.new("Expected a #{Hash} or #{FinchAPI::Internal::Type::BaseModel}, got #{data.inspect}") + end + end + + # @return [String] + def inspect + rows = self.class.known_fields.keys.map do + "#{_1}=#{@data.key?(_1) ? public_send(_1) : ''}" + rescue FinchAPI::ConversionError + "#{_1}=#{@data.fetch(_1)}" + end + "#<#{self.class.name}:0x#{object_id.to_s(16)} #{rows.join(' ')}>" + end + end + end + end +end diff --git a/lib/finch_api/internal/type/base_page.rb b/lib/finch_api/internal/type/base_page.rb new file mode 100644 index 00000000..7ba6bbfd --- /dev/null +++ b/lib/finch_api/internal/type/base_page.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @generic Elem + # + # This module provides a base implementation for paginated responses in the SDK. + module BasePage + # rubocop:disable Lint/UnusedMethodArgument + + # @return [Boolean] + def next_page? = (raise NotImplementedError) + + # @raise [FinchAPI::Errors::APIError] + # @return [FinchAPI::Internal::Type::BasePage] + def next_page = (raise NotImplementedError) + + # @param blk [Proc] + # + # @yieldparam [generic] + # @return [void] + def auto_paging_each(&blk) = (raise NotImplementedError) + + # @return [Enumerable>] + def to_enum = super(:auto_paging_each) + + alias_method :enum_for, :to_enum + + # @api private + # + # @param client [FinchAPI::Internal::Transport::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 + end +end diff --git a/lib/finch_api/internal/type/boolean_model.rb b/lib/finch_api/internal/type/boolean_model.rb new file mode 100644 index 00000000..9a6e6099 --- /dev/null +++ b/lib/finch_api/internal/type/boolean_model.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @api private + # + # @abstract + # + # Ruby has no Boolean class; this is something for models to refer to. + class BooleanModel + extend FinchAPI::Internal::Type::Converter + + # @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::Internal::Type::BooleanModel + + class << self + # @api private + # + # @param value [Boolean, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Boolean, Object] + def coerce(value, state:) + state.fetch(:exactness)[value == true || value == false ? :yes : :no] += 1 + value + end + + # @!parse + # # @api private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # def dump(value) = super + end + end + end + end +end diff --git a/lib/finch_api/internal/type/converter.rb b/lib/finch_api/internal/type/converter.rb new file mode 100644 index 00000000..c02896b6 --- /dev/null +++ b/lib/finch_api/internal/type/converter.rb @@ -0,0 +1,219 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # rubocop:disable Metrics/ModuleLength + # @api private + module Converter + # rubocop:disable Lint/UnusedMethodArgument + + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(value, state:) = (raise NotImplementedError) + + # @api private + # + # @param value [Object] + # + # @return [Object] + def dump(value) + case value + in Array + value.map { FinchAPI::Internal::Type::Unknown.dump(_1) } + in Hash + value.transform_values { FinchAPI::Internal::Type::Unknown.dump(_1) } + in FinchAPI::Internal::Type::BaseModel + value.class.dump(value) + else + value + end + end + + # rubocop:enable Lint/UnusedMethodArgument + + class << self + # @api private + # + # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [Proc] + def type_info(spec) + case spec + in Proc + spec + in Hash + type_info(spec.slice(:const, :enum, :union).first&.last) + in true | false + -> { FinchAPI::Internal::Type::BooleanModel } + in FinchAPI::Internal::Type::Converter | Class | Symbol + -> { spec } + in NilClass | Integer | Float + -> { spec.class } + end + 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 + # + # The coercion process is subject to improvement between minor release versions. + # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode + # + # @param target [FinchAPI::Internal::Type::Converter, Class] + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] The `strictness` is one of `true`, `false`, or `:strong`. This informs the + # coercion strategy when we have to decide between multiple possible conversion + # targets: + # + # - `true`: the conversion must be exact, with minimum coercion. + # - `false`: the conversion can be approximate, with some coercion. + # - `:strong`: the conversion must be exact, with no coercion, and raise an error + # if not possible. + # + # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For + # any given conversion attempt, the exactness will be updated based on how closely + # the value recursively matches the target type: + # + # - `yes`: the value can be converted to the target type with minimum coercion. + # - `maybe`: the value can be converted to the target type with some reasonable + # coercion. + # - `no`: the value cannot be converted to the target type. + # + # See implementation below for more details. + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce( + target, + value, + state: {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} + ) + # rubocop:disable Lint/SuppressedException + # rubocop:disable Metrics/BlockNesting + strictness, exactness = state.fetch_values(:strictness, :exactness) + + case target + in FinchAPI::Internal::Type::Converter + return target.coerce(value, state: state) + in Class + if value.is_a?(target) + exactness[:yes] += 1 + return value + end + + case target + in -> { _1 <= NilClass } + exactness[value.nil? ? :yes : :maybe] += 1 + return nil + in -> { _1 <= Integer } + if value.is_a?(Integer) + exactness[:yes] += 1 + return value + elsif strictness == :strong + message = "no implicit conversion of #{value.class} into #{target.inspect}" + raise TypeError.new(message) + else + Kernel.then do + return Integer(value).tap { exactness[:maybe] += 1 } + rescue ArgumentError, TypeError + end + end + in -> { _1 <= Float } + if value.is_a?(Numeric) + exactness[:yes] += 1 + return Float(value) + elsif strictness == :strong + message = "no implicit conversion of #{value.class} into #{target.inspect}" + raise TypeError.new(message) + else + Kernel.then do + return Float(value).tap { exactness[:maybe] += 1 } + rescue ArgumentError, TypeError + end + end + in -> { _1 <= String } + case value + in String | Symbol | Numeric + exactness[value.is_a?(Numeric) ? :maybe : :yes] += 1 + return value.to_s + else + if strictness == :strong + message = "no implicit conversion of #{value.class} into #{target.inspect}" + raise TypeError.new(message) + end + end + in -> { _1 <= Date || _1 <= Time } + Kernel.then do + return target.parse(value).tap { exactness[:yes] += 1 } + rescue ArgumentError, TypeError => e + raise e if strictness == :strong + end + in -> { _1 <= IO } if value.is_a?(String) + exactness[:yes] += 1 + return StringIO.new(value.b) + else + end + in Symbol + if (value.is_a?(Symbol) || value.is_a?(String)) && value.to_sym == target + exactness[:yes] += 1 + return target + elsif strictness == :strong + message = "cannot convert non-matching #{value.class} into #{target.inspect}" + raise ArgumentError.new(message) + end + else + end + + exactness[:no] += 1 + value + # rubocop:enable Metrics/BlockNesting + # rubocop:enable Lint/SuppressedException + end + + # @api private + # + # @param target [FinchAPI::Internal::Type::Converter, Class] + # @param value [Object] + # + # @return [Object] + def dump(target, value) + target.is_a?(FinchAPI::Internal::Type::Converter) ? target.dump(value) : FinchAPI::Internal::Type::Unknown.dump(value) + end + end + end + # rubocop:enable Metrics/ModuleLength + end + end +end diff --git a/lib/finch_api/internal/type/enum.rb b/lib/finch_api/internal/type/enum.rb new file mode 100644 index 00000000..5051454f --- /dev/null +++ b/lib/finch_api/internal/type/enum.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @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. + # + # @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::Internal::Type::Converter + + # All of the valid Symbol values for this enum. + # + # @return [Array] + def values = (@values ||= constants.map { const_get(_1) }) + + # @api private + # + # Guard against thread safety issues by instantiating `@values`. + private def finalize! = values + + # @param other [Object] + # + # @return [Boolean] + def ===(other) = values.include?(other) + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + other.is_a?(Module) && other.singleton_class <= FinchAPI::Internal::Type::Enum && other.values.to_set == values.to_set + end + + # @api private + # + # Unlike with primitives, `Enum` additionally validates that the value is a member + # of the enum. + # + # @param value [String, Symbol, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Symbol, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + val = value.is_a?(String) ? value.to_sym : value + + if values.include?(val) + exactness[:yes] += 1 + val + else + exactness[values.first&.class == val.class ? :maybe : :no] += 1 + value + end + end + + # @!parse + # # @api private + # # + # # @param value [Symbol, Object] + # # + # # @return [Symbol, Object] + # def dump(value) = super + end + end + end +end diff --git a/lib/finch_api/internal/type/hash_of.rb b/lib/finch_api/internal/type/hash_of.rb new file mode 100644 index 00000000..01fc545d --- /dev/null +++ b/lib/finch_api/internal/type/hash_of.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @api private + # + # @abstract + # + # @generic Elem + # + # Hash of items of a given type. + class HashOf + include FinchAPI::Internal::Type::Converter + + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::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 + in Hash + other.all? do |key, val| + case [key, val] + in [Symbol | String, ^type] + true + else + false + end + end + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + # rubocop:disable Layout/LineLength + other.is_a?(FinchAPI::Internal::Type::HashOf) && other.nilable? == nilable? && other.item_type == item_type + # rubocop:enable Layout/LineLength + end + + # @api private + # + # @param value [Hash{Object=>Object}, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Hash{Symbol=>Object}, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + + unless value.is_a?(Hash) + exactness[:no] += 1 + return value + end + + target = item_type + exactness[:yes] += 1 + value + .to_h do |key, val| + k = key.is_a?(String) ? key.to_sym : key + v = + case [nilable?, val] + in [true, nil] + exactness[:yes] += 1 + nil + else + FinchAPI::Internal::Type::Converter.coerce(target, val, state: state) + end + + exactness[:no] += 1 unless k.is_a?(Symbol) + [k, v] + end + end + + # @api private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + def dump(value) + target = item_type + if value.is_a?(Hash) + value.transform_values do + FinchAPI::Internal::Type::Converter.dump(target, _1) + end + else + super + end + end + + # @api private + # + # @return [generic] + protected def item_type = @item_type_fn.call + + # @api private + # + # @return [Boolean] + protected def nilable? = @nilable + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def initialize(type_info, spec = {}) + @item_type_fn = FinchAPI::Internal::Type::Converter.type_info(type_info || spec) + @nilable = spec[:nil?] + end + end + end + end +end diff --git a/lib/finch_api/internal/type/request_parameters.rb b/lib/finch_api/internal/type/request_parameters.rb new file mode 100644 index 00000000..b966a96c --- /dev/null +++ b/lib/finch_api/internal/type/request_parameters.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @api private + module RequestParameters + # @!parse + # # Options to specify HTTP behaviour for this request. + # # @return [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # attr_accessor :request_options + + # @param mod [Module] + def self.included(mod) + return unless mod <= FinchAPI::Internal::Type::BaseModel + + mod.extend(FinchAPI::Internal::Type::RequestParameters::Converter) + mod.optional(:request_options, FinchAPI::RequestOptions) + end + + # @api private + module Converter + # @api private + # + # @param params [Object] + # + # @return [Array(Object, Hash{Symbol=>Object})] + def dump_request(params) + case (dumped = dump(params)) + in Hash + [dumped.except(:request_options), dumped[:request_options]] + else + [dumped, nil] + end + end + end + end + end + end +end diff --git a/lib/finch_api/internal/type/union.rb b/lib/finch_api/internal/type/union.rb new file mode 100644 index 00000000..fb7d14b7 --- /dev/null +++ b/lib/finch_api/internal/type/union.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @api private + # + # @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 + # + # @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::Internal::Type::Converter + + # @api private + # + # All of the specified variant info for this union. + # + # @return [Array] + private def known_variants = (@known_variants ||= []) + + # @api private + # + # @return [Array] + protected def derefed_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) + + # @api private + # + # @param property [Symbol] + private def discriminator(property) + case property + in Symbol + @discriminator = property + end + end + + # @api private + # + # @param key [Symbol, Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Internal::Type::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + private def variant(key, spec = nil) + variant_info = + case key + in Symbol + [key, FinchAPI::Internal::Type::Converter.type_info(spec)] + in Proc | FinchAPI::Internal::Type::Converter | Class | Hash + [nil, FinchAPI::Internal::Type::Converter.type_info(key)] + end + + known_variants << variant_info + end + + # @api private + # + # @param value [Object] + # + # @return [FinchAPI::Internal::Type::Converter, Class, nil] + private def resolve_variant(value) + case [@discriminator, value] + in [_, FinchAPI::Internal::Type::BaseModel] + value.class + in [Symbol, Hash] + key = value.fetch(@discriminator) do + value.fetch(@discriminator.to_s, FinchAPI::Internal::OMIT) + end + + return nil if key == FinchAPI::Internal::OMIT + + key = key.to_sym if key.is_a?(String) + known_variants.find { |k,| k == key }&.last&.call + else + nil + end + end + + # rubocop:disable Style/HashEachMethods + # rubocop:disable Style/CaseEquality + + # @param other [Object] + # + # @return [Boolean] + def ===(other) + known_variants.any? do |_, variant_fn| + variant_fn.call === other + end + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + # rubocop:disable Layout/LineLength + other.is_a?(Module) && other.singleton_class <= FinchAPI::Internal::Type::Union && other.derefed_variants == derefed_variants + # rubocop:enable Layout/LineLength + end + + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(value, state:) + if (target = resolve_variant(value)) + return FinchAPI::Internal::Type::Converter.coerce(target, value, state: state) + end + + strictness = state.fetch(:strictness) + exactness = state.fetch(:exactness) + state[:strictness] = strictness == :strong ? true : strictness + + alternatives = [] + known_variants.each do |_, variant_fn| + target = variant_fn.call + exact = state[:exactness] = {yes: 0, no: 0, maybe: 0} + state[:branched] += 1 + + coerced = FinchAPI::Internal::Type::Converter.coerce(target, value, state: state) + yes, no, maybe = exact.values + if (no + maybe).zero? || (!strictness && yes.positive?) + exact.each { exactness[_1] += _2 } + state[:exactness] = exactness + return coerced + elsif maybe.positive? + alternatives << [[-yes, -maybe, no], exact, coerced] + end + end + + case alternatives.sort_by(&:first) + in [] + exactness[:no] += 1 + if strictness == :strong + message = "no possible conversion of #{value.class} into a variant of #{target.inspect}" + raise ArgumentError.new(message) + end + value + in [[_, exact, coerced], *] + exact.each { exactness[_1] += _2 } + coerced + end + .tap { state[:exactness] = exactness } + ensure + state[:strictness] = strictness + end + + # @api private + # + # @param value [Object] + # + # @return [Object] + def dump(value) + if (target = resolve_variant(value)) + return FinchAPI::Internal::Type::Converter.dump(target, value) + end + + known_variants.each do + target = _2.call + return FinchAPI::Internal::Type::Converter.dump(target, value) if target === value + end + + super + end + + # rubocop:enable Style/CaseEquality + # rubocop:enable Style/HashEachMethods + end + end + end +end diff --git a/lib/finch_api/internal/type/unknown.rb b/lib/finch_api/internal/type/unknown.rb new file mode 100644 index 00000000..8235a43c --- /dev/null +++ b/lib/finch_api/internal/type/unknown.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + module Type + # @api private + # + # @abstract + # + # When we don't know what to expect for the value. + class Unknown + extend FinchAPI::Internal::Type::Converter + + # rubocop:disable Lint/UnusedMethodArgument + + # @param other [Object] + # + # @return [Boolean] + def self.===(other) = true + + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= FinchAPI::Internal::Type::Unknown + + class << self + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean, :strong] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(value, state:) + state.fetch(:exactness)[:yes] += 1 + value + end + + # @!parse + # # @api private + # # + # # @param value [Object] + # # + # # @return [Object] + # def dump(value) = super + end + + # rubocop:enable Lint/UnusedMethodArgument + end + end + end +end diff --git a/lib/finch_api/internal/util.rb b/lib/finch_api/internal/util.rb new file mode 100644 index 00000000..c66e018b --- /dev/null +++ b/lib/finch_api/internal/util.rb @@ -0,0 +1,717 @@ +# frozen_string_literal: true + +module FinchAPI + module Internal + # rubocop:disable Metrics/ModuleLength + + # @api private + module Util + # @api private + # + # @return [Float] + def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) + + class << self + # @api private + # + # @return [String] + def arch + case (arch = RbConfig::CONFIG["arch"])&.downcase + in nil + "unknown" + in /aarch64|arm64/ + "arm64" + in /x86_64/ + "x64" + in /arm/ + "arm" + else + "other:#{arch}" + end + end + + # @api private + # + # @return [String] + def os + case (host = RbConfig::CONFIG["host_os"])&.downcase + in nil + "Unknown" + in /linux/ + "Linux" + in /darwin/ + "MacOS" + in /freebsd/ + "FreeBSD" + in /openbsd/ + "OpenBSD" + in /mswin|mingw|cygwin|ucrt/ + "Windows" + else + "Other:#{host}" + end + end + end + + class << self + # @api private + # + # @param input [Object] + # + # @return [Boolean] + def primitive?(input) + case input + in true | false | Integer | Float | Symbol | String + true + else + false + end + end + + # @api private + # + # @param input [Object] + # + # @return [Boolean, Object] + def coerce_boolean(input) + case input.is_a?(String) ? input.downcase : input + in Numeric + input.nonzero? + in "true" + true + in "false" + false + else + input + end + end + + # @api private + # + # @param input [Object] + # + # @raise [ArgumentError] + # @return [Boolean, nil] + def coerce_boolean!(input) + case coerce_boolean(input) + in true | false | nil => coerced + coerced + else + raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") + end + end + + # @api private + # + # @param input [Object] + # + # @return [Integer, Object] + def coerce_integer(input) + case input + in true + 1 + in false + 0 + else + Integer(input, exception: false) || input + end + end + + # @api private + # + # @param input [Object] + # + # @return [Float, Object] + def coerce_float(input) + case input + in true + 1.0 + in false + 0.0 + else + Float(input, exception: false) || input + end + end + + # @api private + # + # @param input [Object] + # + # @return [Hash{Object=>Object}, Object] + def coerce_hash(input) + case input + in NilClass | Array | Set | Enumerator + input + else + input.respond_to?(:to_h) ? input.to_h : input + end + end + end + + class << self + # @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, _] + rhs_cleaned = rhs.reject { _2 == FinchAPI::Internal::OMIT } + lhs + .reject { |key, _| rhs[key] == FinchAPI::Internal::OMIT } + .merge(rhs_cleaned) do |_, old_val, new_val| + deep_merge_lr(old_val, new_val, concat: concat) + end + in [Array, Array, true] + lhs.concat(rhs) + else + rhs + end + end + + # @api private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + # + # @param values [Array] + # + # @param sentinel [Object, nil] the value to return if no values are provided. + # + # @param concat [Boolean] whether to merge sequences by concatenation. + # + # @return [Object] + def deep_merge(*values, sentinel: nil, concat: false) + case values + in [value, *values] + values.reduce(value) do |acc, val| + deep_merge_lr(acc, val, concat: concat) + end + else + sentinel + end + end + + # @api private + # + # @param data [Hash{Symbol=>Object}, Array, Object] + # @param pick [Symbol, Integer, Array, nil] + # @param sentinel [Object, nil] + # @param blk [Proc, nil] + # + # @return [Object, nil] + def dig(data, pick, sentinel = nil, &blk) + case [data, pick, blk] + in [_, nil, nil] + data + in [Hash, Symbol, _] | [Array, Integer, _] + blk.nil? ? data.fetch(pick, sentinel) : data.fetch(pick, &blk) + in [Hash | Array, Array, _] + pick.reduce(data) do |acc, key| + case acc + in Hash if acc.key?(key) + acc.fetch(key) + in Array if key.is_a?(Integer) && key < acc.length + acc[key] + else + return blk.nil? ? sentinel : blk.call + end + end + in _ + blk.nil? ? sentinel : blk.call + end + end + end + + class << self + # @api private + # + # @param uri [URI::Generic] + # + # @return [String] + def uri_origin(uri) + "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" + end + + # @api private + # + # @param path [String, Array] + # + # @return [String] + def interpolate_path(path) + case path + in String + path + in [] + "" + in [String => p, *interpolations] + encoded = interpolations.map { ERB::Util.url_encode(_1) } + format(p, *encoded) + end + end + end + + class << self + # @api private + # + # @param query [String, nil] + # + # @return [Hash{String=>Array}] + def decode_query(query) + CGI.parse(query.to_s) + end + + # @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 + # @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 + + # @api private + # + # @param parsed [Hash{Symbol=>String, Integer, nil}] . + # + # @option parsed [String, nil] :scheme + # + # @option parsed [String, nil] :host + # + # @option parsed [Integer, nil] :port + # + # @option parsed [String, nil] :path + # + # @option parsed [Hash{String=>Array}] :query + # + # @return [URI::Generic] + def unparse_uri(parsed) + URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) + end + + # @api private + # + # @param lhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option lhs [String, nil] :scheme + # + # @option lhs [String, nil] :host + # + # @option lhs [Integer, nil] :port + # + # @option lhs [String, nil] :path + # + # @option lhs [Hash{String=>Array}] :query + # + # @param rhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option rhs [String, nil] :scheme + # + # @option rhs [String, nil] :host + # + # @option rhs [Integer, nil] :port + # + # @option rhs [String, nil] :path + # + # @option rhs [Hash{String=>Array}] :query + # + # @return [URI::Generic] + def join_parsed_uri(lhs, rhs) + base_path, base_query = lhs.fetch_values(:path, :query) + slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" + + parsed_path, parsed_query = parse_uri(rhs.fetch(:path)).fetch_values(:path, :query) + override = URI::Generic.build(**rhs.slice(:scheme, :host, :port), path: parsed_path) + + joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) + query = deep_merge( + joined.path == base_path ? base_query : {}, + parsed_query, + rhs[:query].to_h, + concat: true + ) + + joined.query = encode_query(query) + joined + end + end + + class << self + # @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| + 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 + 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 + # @param blk [Proc] + # + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] + def writable_enum(&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 + # @api private + # + # @param y [Enumerator::Yielder] + # @param boundary [String] + # @param key [Symbol, String] + # @param val [Object] + private def write_multipart_chunk(y, boundary:, key:, val:) + y << "--#{boundary}\r\n" + y << "Content-Disposition: form-data" + unless key.nil? + name = ERB::Util.url_encode(key.to_s) + y << "; name=\"#{name}\"" + end + if val.is_a?(IO) + filename = ERB::Util.url_encode(File.basename(val.to_path)) + y << "; filename=\"#{filename}\"" + end + y << "\r\n" + case val + 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 + y << "Content-Type: application/octet-stream\r\n\r\n" + y << val.to_s + in true | false | Integer | Float | Symbol + y << "Content-Type: text/plain\r\n\r\n" + y << val.to_s + else + y << "Content-Type: application/json\r\n\r\n" + y << JSON.fast_generate(val) + end + y << "\r\n" + end + + # @api private + # + # @param body [Object] + # + # @return [Array(String, Enumerable)] + private def encode_multipart_streaming(body) + boundary = SecureRandom.urlsafe_base64(60) + + strio = writable_enum do |y| + case body + in Hash + body.each do |key, val| + case val + in Array if val.all? { primitive?(_1) } + val.each do |v| + write_multipart_chunk(y, boundary: boundary, key: key, val: v) + end + else + write_multipart_chunk(y, boundary: boundary, key: key, val: val) + end + end + else + write_multipart_chunk(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 [%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, strio = encode_multipart_streaming(body) + headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} + [headers, strio] + in [_, StringIO] + [headers, body.string] + else + [headers, body] + end + end + + # @api private + # + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param stream [Enumerable] + # @param suppress_error [Boolean] + # + # @raise [JSON::ParserError] + # @return [Object] + def decode_content(headers, stream:, suppress_error: false) + case headers["content-type"] + in %r{^application/(?:vnd\.api\+)?json} + json = stream.to_a.join + begin + JSON.parse(json, symbolize_names: true) + rescue JSON::ParserError => e + raise e unless suppress_error + json + end + in %r{^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 + # TODO: parsing other response types + StringIO.new(stream.to_a.join) + end + end + end + + class << self + # @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, external: false, &close) + fused = false + iter = Enumerator.new do |y| + next if fused + + fused = true + if external + loop { y << enum.next } + else + enum.each(&y) + end + ensure + close&.call + close = nil + end + + iter.define_singleton_method(:rewind) do + fused = true + self + end + iter + end + + # @api private + # + # @param enum [Enumerable, nil] + def close_fused!(enum) + return unless enum.is_a?(Enumerator) + + # rubocop:disable Lint/UnreachableLoop + enum.rewind.each { break } + # rubocop:enable Lint/UnreachableLoop + end + + # @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) } + end + end + + class << self + # @api private + # + # @param enum [Enumerable] + # + # @return [Enumerable] + def decode_lines(enum) + re = /(\r\n|\r|\n)/ + buffer = String.new.b + cr_seen = nil + + chain_fused(enum) do |y| + enum.each do |row| + offset = buffer.bytesize + buffer << row + 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 + + # @api private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + # + # @param lines [Enumerable] + # + # @return [Hash{Symbol=>Object}] + 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.sub(/\R$/, "") + in "" + next if current.empty? + y << {**blank, **current} + current = {} + in /^:/ + next + in /^([^:]+):\s?(.*)$/ + field, value = Regexp.last_match.captures + case field + in "event" + current.merge!(event: value) + in "data" + (current[:data] ||= String.new.b) << (value << "\n") + in "id" unless value.include?("\0") + current.merge!(id: value) + in "retry" if /^\d+$/ =~ value + current.merge!(retry: Integer(value)) + else + end + else + end + end + # rubocop:enable Metrics/BlockLength + + y << {**blank, **current} unless current.empty? + end + end + end + end + + # rubocop:enable Metrics/ModuleLength + end +end diff --git a/lib/finch-api/models/access_token_create_params.rb b/lib/finch_api/models/access_token_create_params.rb similarity index 77% rename from lib/finch-api/models/access_token_create_params.rb rename to lib/finch_api/models/access_token_create_params.rb index 525948b3..eb27d419 100644 --- a/lib/finch-api/models/access_token_create_params.rb +++ b/lib/finch_api/models/access_token_create_params.rb @@ -2,10 +2,11 @@ module FinchAPI module Models - class AccessTokenCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::AccessTokens#create + class AccessTokenCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute code # @@ -48,7 +49,7 @@ class AccessTokenCreateParams < FinchAPI::BaseModel # # # def initialize(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch_api/models/account_disconnect_params.rb b/lib/finch_api/models/account_disconnect_params.rb new file mode 100644 index 00000000..2381218b --- /dev/null +++ b/lib/finch_api/models/account_disconnect_params.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + # @see FinchAPI::Resources::Account#disconnect + class AccountDisconnectParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end +end diff --git a/lib/finch_api/models/account_introspect_params.rb b/lib/finch_api/models/account_introspect_params.rb new file mode 100644 index 00000000..a7ffc921 --- /dev/null +++ b/lib/finch_api/models/account_introspect_params.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + # @see FinchAPI::Resources::Account#introspect + class AccountIntrospectParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/account_update_event.rb b/lib/finch_api/models/account_update_event.rb similarity index 77% rename from lib/finch-api/models/account_update_event.rb rename to lib/finch_api/models/account_update_event.rb index a9f16bb9..ee0f5d54 100644 --- a/lib/finch-api/models/account_update_event.rb +++ b/lib/finch_api/models/account_update_event.rb @@ -27,9 +27,9 @@ class AccountUpdateEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute authentication_method # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod] @@ -46,9 +46,10 @@ class Data < FinchAPI::BaseModel # # # def initialize(authentication_method:, status:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class AuthenticationMethod < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data#authentication_method + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel # @!attribute benefits_support # Each benefit type and their supported features. If the benefit type is not # supported, the property will be null @@ -81,9 +82,10 @@ class AuthenticationMethod < FinchAPI::BaseModel # # # def initialize(benefits_support: nil, supported_fields: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class SupportedFields < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod#supported_fields + class SupportedFields < FinchAPI::Internal::Type::BaseModel # @!attribute [r] company # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, nil] @@ -178,13 +180,14 @@ class SupportedFields < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Company < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#company + class Company < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -213,7 +216,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] ein # # @return [Boolean, nil] - optional :ein, FinchAPI::BooleanModel + optional :ein, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -232,7 +235,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] legal_name # # @return [Boolean, nil] - optional :legal_name, FinchAPI::BooleanModel + optional :legal_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -251,7 +254,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] primary_email # # @return [Boolean, nil] - optional :primary_email, FinchAPI::BooleanModel + optional :primary_email, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -260,7 +263,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] primary_phone_number # # @return [Boolean, nil] - optional :primary_phone_number, FinchAPI::BooleanModel + optional :primary_phone_number, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -292,13 +295,14 @@ class Company < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Accounts < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company#accounts + class Accounts < FinchAPI::Internal::Type::BaseModel # @!attribute [r] account_name # # @return [Boolean, nil] - optional :account_name, FinchAPI::BooleanModel + optional :account_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -307,7 +311,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] account_number # # @return [Boolean, nil] - optional :account_number, FinchAPI::BooleanModel + optional :account_number, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -316,7 +320,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] account_type # # @return [Boolean, nil] - optional :account_type, FinchAPI::BooleanModel + optional :account_type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -325,7 +329,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] institution_name # # @return [Boolean, nil] - optional :institution_name, FinchAPI::BooleanModel + optional :institution_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -334,7 +338,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] routing_number # # @return [Boolean, nil] - optional :routing_number, FinchAPI::BooleanModel + optional :routing_number, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -349,14 +353,15 @@ class Accounts < FinchAPI::BaseModel # # # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Departments < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company#departments + class Departments < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -378,13 +383,14 @@ class Departments < FinchAPI::BaseModel # # # def initialize(name: nil, parent: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Parent < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments#parent + class Parent < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -395,15 +401,16 @@ class Parent < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Entity < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company#entity + class Entity < FinchAPI::Internal::Type::BaseModel # @!attribute [r] subtype # # @return [Boolean, nil] - optional :subtype, FinchAPI::BooleanModel + optional :subtype, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -412,7 +419,7 @@ class Entity < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -424,14 +431,15 @@ class Entity < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Locations < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company#locations + class Locations < FinchAPI::Internal::Type::BaseModel # @!attribute [r] city # # @return [Boolean, nil] - optional :city, FinchAPI::BooleanModel + optional :city, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -440,7 +448,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] country # # @return [Boolean, nil] - optional :country, FinchAPI::BooleanModel + optional :country, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -449,7 +457,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] line1 # # @return [Boolean, nil] - optional :line1, FinchAPI::BooleanModel + optional :line1, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -458,7 +466,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] line2 # # @return [Boolean, nil] - optional :line2, FinchAPI::BooleanModel + optional :line2, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -467,7 +475,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] postal_code # # @return [Boolean, nil] - optional :postal_code, FinchAPI::BooleanModel + optional :postal_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -476,7 +484,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] state # # @return [Boolean, nil] - optional :state, FinchAPI::BooleanModel + optional :state, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -492,11 +500,12 @@ class Locations < FinchAPI::BaseModel # # # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Directory < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#directory + class Directory < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individuals # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, nil] @@ -523,13 +532,14 @@ class Directory < FinchAPI::BaseModel # # # def initialize(individuals: nil, paging: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Individuals < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory#individuals + class Individuals < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -538,7 +548,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] department # # @return [Boolean, nil] - optional :department, FinchAPI::BooleanModel + optional :department, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -547,7 +557,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] first_name # # @return [Boolean, nil] - optional :first_name, FinchAPI::BooleanModel + optional :first_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -556,7 +566,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] is_active # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel + optional :is_active, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -565,7 +575,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] last_name # # @return [Boolean, nil] - optional :last_name, FinchAPI::BooleanModel + optional :last_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -584,7 +594,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] middle_name # # @return [Boolean, nil] - optional :middle_name, FinchAPI::BooleanModel + optional :middle_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -612,13 +622,14 @@ class Individuals < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -629,15 +640,16 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Paging < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory#paging + class Paging < FinchAPI::Internal::Type::BaseModel # @!attribute [r] count # # @return [Boolean, nil] - optional :count, FinchAPI::BooleanModel + optional :count, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -646,7 +658,7 @@ class Paging < FinchAPI::BaseModel # @!attribute [r] offset # # @return [Boolean, nil] - optional :offset, FinchAPI::BooleanModel + optional :offset, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -658,15 +670,16 @@ class Paging < FinchAPI::BaseModel # # # def initialize(count: nil, offset: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -675,7 +688,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] class_code # # @return [Boolean, nil] - optional :class_code, FinchAPI::BooleanModel + optional :class_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -684,7 +697,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] custom_fields # # @return [Boolean, nil] - optional :custom_fields, FinchAPI::BooleanModel + optional :custom_fields, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -713,7 +726,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] employment_status # # @return [Boolean, nil] - optional :employment_status, FinchAPI::BooleanModel + optional :employment_status, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -722,7 +735,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] end_date # # @return [Boolean, nil] - optional :end_date, FinchAPI::BooleanModel + optional :end_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -731,7 +744,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] first_name # # @return [Boolean, nil] - optional :first_name, FinchAPI::BooleanModel + optional :first_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -750,7 +763,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] income_history # # @return [Boolean, nil] - optional :income_history, FinchAPI::BooleanModel + optional :income_history, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -759,7 +772,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] is_active # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel + optional :is_active, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -768,7 +781,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] last_name # # @return [Boolean, nil] - optional :last_name, FinchAPI::BooleanModel + optional :last_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -797,7 +810,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] middle_name # # @return [Boolean, nil] - optional :middle_name, FinchAPI::BooleanModel + optional :middle_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -806,7 +819,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] start_date # # @return [Boolean, nil] - optional :start_date, FinchAPI::BooleanModel + optional :start_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -815,7 +828,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] title # # @return [Boolean, nil] - optional :title, FinchAPI::BooleanModel + optional :title, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -863,13 +876,14 @@ class Employment < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Department < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment#department + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -880,14 +894,15 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] subtype # # @return [Boolean, nil] - optional :subtype, FinchAPI::BooleanModel + optional :subtype, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -896,7 +911,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -908,14 +923,15 @@ class Employment < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Income < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment#income + class Income < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -924,7 +940,7 @@ class Income < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -933,7 +949,7 @@ class Income < FinchAPI::BaseModel # @!attribute [r] unit # # @return [Boolean, nil] - optional :unit, FinchAPI::BooleanModel + optional :unit, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -946,14 +962,15 @@ class Income < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, unit: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Location < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment#location + class Location < FinchAPI::Internal::Type::BaseModel # @!attribute [r] city # # @return [Boolean, nil] - optional :city, FinchAPI::BooleanModel + optional :city, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -962,7 +979,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] country # # @return [Boolean, nil] - optional :country, FinchAPI::BooleanModel + optional :country, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -971,7 +988,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] line1 # # @return [Boolean, nil] - optional :line1, FinchAPI::BooleanModel + optional :line1, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -980,7 +997,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] line2 # # @return [Boolean, nil] - optional :line2, FinchAPI::BooleanModel + optional :line2, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -989,7 +1006,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] postal_code # # @return [Boolean, nil] - optional :postal_code, FinchAPI::BooleanModel + optional :postal_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -998,7 +1015,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] state # # @return [Boolean, nil] - optional :state, FinchAPI::BooleanModel + optional :state, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1014,14 +1031,15 @@ class Location < FinchAPI::BaseModel # # # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1032,15 +1050,16 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Individual < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#individual + class Individual < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1049,7 +1068,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] dob # # @return [Boolean, nil] - optional :dob, FinchAPI::BooleanModel + optional :dob, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1068,7 +1087,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] encrypted_ssn # # @return [Boolean, nil] - optional :encrypted_ssn, FinchAPI::BooleanModel + optional :encrypted_ssn, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1077,7 +1096,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] ethnicity # # @return [Boolean, nil] - optional :ethnicity, FinchAPI::BooleanModel + optional :ethnicity, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1086,7 +1105,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] first_name # # @return [Boolean, nil] - optional :first_name, FinchAPI::BooleanModel + optional :first_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1095,7 +1114,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] gender # # @return [Boolean, nil] - optional :gender, FinchAPI::BooleanModel + optional :gender, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1104,7 +1123,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] last_name # # @return [Boolean, nil] - optional :last_name, FinchAPI::BooleanModel + optional :last_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1113,7 +1132,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] middle_name # # @return [Boolean, nil] - optional :middle_name, FinchAPI::BooleanModel + optional :middle_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1132,7 +1151,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] preferred_name # # @return [Boolean, nil] - optional :preferred_name, FinchAPI::BooleanModel + optional :preferred_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1151,7 +1170,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] ssn # # @return [Boolean, nil] - optional :ssn, FinchAPI::BooleanModel + optional :ssn, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1191,13 +1210,14 @@ class Individual < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Emails < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual#emails + class Emails < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [Boolean, nil] - optional :data, FinchAPI::BooleanModel + optional :data, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1206,7 +1226,7 @@ class Emails < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1218,14 +1238,15 @@ class Emails < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PhoneNumbers < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual#phone_numbers + class PhoneNumbers < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [Boolean, nil] - optional :data, FinchAPI::BooleanModel + optional :data, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1234,7 +1255,7 @@ class PhoneNumbers < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1246,14 +1267,15 @@ class PhoneNumbers < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Residence < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual#residence + class Residence < FinchAPI::Internal::Type::BaseModel # @!attribute [r] city # # @return [Boolean, nil] - optional :city, FinchAPI::BooleanModel + optional :city, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1262,7 +1284,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] country # # @return [Boolean, nil] - optional :country, FinchAPI::BooleanModel + optional :country, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1271,7 +1293,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] line1 # # @return [Boolean, nil] - optional :line1, FinchAPI::BooleanModel + optional :line1, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1280,7 +1302,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] line2 # # @return [Boolean, nil] - optional :line2, FinchAPI::BooleanModel + optional :line2, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1289,7 +1311,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] postal_code # # @return [Boolean, nil] - optional :postal_code, FinchAPI::BooleanModel + optional :postal_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1298,7 +1320,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] state # # @return [Boolean, nil] - optional :state, FinchAPI::BooleanModel + optional :state, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1314,15 +1336,16 @@ class Residence < FinchAPI::BaseModel # # # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class PayGroup < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#pay_group + class PayGroup < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1331,7 +1354,7 @@ class PayGroup < FinchAPI::BaseModel # @!attribute [r] individual_ids # # @return [Boolean, nil] - optional :individual_ids, FinchAPI::BooleanModel + optional :individual_ids, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1340,7 +1363,7 @@ class PayGroup < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1349,7 +1372,7 @@ class PayGroup < FinchAPI::BaseModel # @!attribute [r] pay_frequencies # # @return [Boolean, nil] - optional :pay_frequencies, FinchAPI::BooleanModel + optional :pay_frequencies, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1363,10 +1386,11 @@ class PayGroup < FinchAPI::BaseModel # # # def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PayStatement < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#pay_statement + class PayStatement < FinchAPI::Internal::Type::BaseModel # @!attribute [r] paging # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, nil] @@ -1393,18 +1417,19 @@ class PayStatement < FinchAPI::BaseModel # # # def initialize(paging: nil, pay_statements: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Paging < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement#paging + class Paging < FinchAPI::Internal::Type::BaseModel # @!attribute count # # @return [Boolean] - required :count, FinchAPI::BooleanModel + required :count, FinchAPI::Internal::Type::BooleanModel # @!attribute offset # # @return [Boolean] - required :offset, FinchAPI::BooleanModel + required :offset, FinchAPI::Internal::Type::BooleanModel # @!parse # # @param count [Boolean] @@ -1412,10 +1437,11 @@ class Paging < FinchAPI::BaseModel # # # def initialize(count:, offset:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PayStatements < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement#pay_statements + class PayStatements < FinchAPI::Internal::Type::BaseModel # @!attribute [r] earnings # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, nil] @@ -1449,7 +1475,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] gross_pay # # @return [Boolean, nil] - optional :gross_pay, FinchAPI::BooleanModel + optional :gross_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1458,7 +1484,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] individual_id # # @return [Boolean, nil] - optional :individual_id, FinchAPI::BooleanModel + optional :individual_id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1467,7 +1493,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] net_pay # # @return [Boolean, nil] - optional :net_pay, FinchAPI::BooleanModel + optional :net_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1476,7 +1502,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] payment_method # # @return [Boolean, nil] - optional :payment_method, FinchAPI::BooleanModel + optional :payment_method, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1495,7 +1521,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] total_hours # # @return [Boolean, nil] - optional :total_hours, FinchAPI::BooleanModel + optional :total_hours, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1504,7 +1530,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1538,13 +1564,14 @@ class PayStatements < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Earnings < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#earnings + class Earnings < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1553,7 +1580,7 @@ class Earnings < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1562,7 +1589,7 @@ class Earnings < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1571,7 +1598,7 @@ class Earnings < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1585,14 +1612,15 @@ class Earnings < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class EmployeeDeductions < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#employee_deductions + class EmployeeDeductions < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1601,7 +1629,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1610,7 +1638,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1619,7 +1647,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] pre_tax # # @return [Boolean, nil] - optional :pre_tax, FinchAPI::BooleanModel + optional :pre_tax, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1628,7 +1656,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1643,14 +1671,15 @@ class EmployeeDeductions < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class EmployerContributions < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#employer_contributions + class EmployerContributions < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1659,7 +1688,7 @@ class EmployerContributions < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1668,7 +1697,7 @@ class EmployerContributions < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1681,14 +1710,15 @@ class EmployerContributions < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Taxes < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#taxes + class Taxes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1697,7 +1727,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1706,7 +1736,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] employer # # @return [Boolean, nil] - optional :employer, FinchAPI::BooleanModel + optional :employer, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1715,7 +1745,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1724,7 +1754,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1739,16 +1769,17 @@ class Taxes < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end - class Payment < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields#payment + class Payment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1757,7 +1788,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] company_debit # # @return [Boolean, nil] - optional :company_debit, FinchAPI::BooleanModel + optional :company_debit, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1766,7 +1797,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] debit_date # # @return [Boolean, nil] - optional :debit_date, FinchAPI::BooleanModel + optional :debit_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1775,7 +1806,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] employee_taxes # # @return [Boolean, nil] - optional :employee_taxes, FinchAPI::BooleanModel + optional :employee_taxes, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1784,7 +1815,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] employer_taxes # # @return [Boolean, nil] - optional :employer_taxes, FinchAPI::BooleanModel + optional :employer_taxes, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1793,7 +1824,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] gross_pay # # @return [Boolean, nil] - optional :gross_pay, FinchAPI::BooleanModel + optional :gross_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1802,7 +1833,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] individual_ids # # @return [Boolean, nil] - optional :individual_ids, FinchAPI::BooleanModel + optional :individual_ids, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1811,7 +1842,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] net_pay # # @return [Boolean, nil] - optional :net_pay, FinchAPI::BooleanModel + optional :net_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1820,7 +1851,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] pay_date # # @return [Boolean, nil] - optional :pay_date, FinchAPI::BooleanModel + optional :pay_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1829,7 +1860,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] pay_frequencies # # @return [Boolean, nil] - optional :pay_frequencies, FinchAPI::BooleanModel + optional :pay_frequencies, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1838,7 +1869,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] pay_group_ids # # @return [Boolean, nil] - optional :pay_group_ids, FinchAPI::BooleanModel + optional :pay_group_ids, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1886,13 +1917,14 @@ class Payment < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class PayPeriod < FinchAPI::BaseModel + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment#pay_period + class PayPeriod < FinchAPI::Internal::Type::BaseModel # @!attribute [r] end_date # # @return [Boolean, nil] - optional :end_date, FinchAPI::BooleanModel + optional :end_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1901,7 +1933,7 @@ class PayPeriod < FinchAPI::BaseModel # @!attribute [r] start_date # # @return [Boolean, nil] - optional :start_date, FinchAPI::BooleanModel + optional :start_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1913,14 +1945,16 @@ class PayPeriod < FinchAPI::BaseModel # # # def initialize(end_date: nil, start_date: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end # The type of authentication method. + # + # @see FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED = :assisted CREDENTIAL = :credential @@ -1938,7 +1972,7 @@ module Type end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACCOUNT_UPDATED = :"account.updated" diff --git a/lib/finch-api/models/base_webhook_event.rb b/lib/finch_api/models/base_webhook_event.rb similarity index 89% rename from lib/finch-api/models/base_webhook_event.rb rename to lib/finch_api/models/base_webhook_event.rb index a71bee98..ffa9dbe5 100644 --- a/lib/finch-api/models/base_webhook_event.rb +++ b/lib/finch_api/models/base_webhook_event.rb @@ -2,7 +2,7 @@ module FinchAPI module Models - class BaseWebhookEvent < FinchAPI::BaseModel + class BaseWebhookEvent < FinchAPI::Internal::Type::BaseModel # @!attribute account_id # [DEPRECATED] Unique Finch ID of the employer account used to make this # connection. Use `connection_id` instead to identify the connection associated @@ -35,7 +35,7 @@ class BaseWebhookEvent < FinchAPI::BaseModel # # # def initialize(account_id:, company_id:, connection_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/company_event.rb b/lib/finch_api/models/company_event.rb similarity index 81% rename from lib/finch-api/models/company_event.rb rename to lib/finch_api/models/company_event.rb index c8f57e27..fb0b6eb2 100644 --- a/lib/finch-api/models/company_event.rb +++ b/lib/finch_api/models/company_event.rb @@ -6,7 +6,7 @@ class CompanyEvent < FinchAPI::Models::BaseWebhookEvent # @!attribute data # # @return [Hash{Symbol=>Object}, nil] - optional :data, FinchAPI::HashOf[FinchAPI::Unknown], nil?: true + optional :data, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown], nil?: true # @!attribute [r] event_type # @@ -23,10 +23,10 @@ class CompanyEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPANY_UPDATED = :"company.updated" diff --git a/lib/finch-api/models/connect/session_new_params.rb b/lib/finch_api/models/connect/session_new_params.rb similarity index 82% rename from lib/finch-api/models/connect/session_new_params.rb rename to lib/finch_api/models/connect/session_new_params.rb index 00cca690..9242b140 100644 --- a/lib/finch-api/models/connect/session_new_params.rb +++ b/lib/finch_api/models/connect/session_new_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Connect - class SessionNewParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Connect::Sessions#new + class SessionNewParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute customer_id # @@ -21,7 +22,8 @@ class SessionNewParams < FinchAPI::BaseModel # @!attribute products # # @return [Array] - required :products, -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Connect::SessionNewParams::Product] } + required :products, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::Connect::SessionNewParams::Product] } # @!attribute customer_email # @@ -36,7 +38,7 @@ class SessionNewParams < FinchAPI::BaseModel # @!attribute manual # # @return [Boolean, nil] - optional :manual, FinchAPI::BooleanModel, nil?: true + optional :manual, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute minutes_to_expire # The number of minutes until the session expires (defaults to 43,200, which is 30 @@ -83,11 +85,11 @@ class SessionNewParams < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The Finch products that can be requested during the Connect flow. module Product - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPANY = :company DIRECTORY = :directory @@ -105,7 +107,7 @@ module Product # def self.values; end end - class Integration < FinchAPI::BaseModel + class Integration < FinchAPI::Internal::Type::BaseModel # @!attribute auth_method # # @return [Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod, nil] @@ -124,10 +126,11 @@ class Integration < FinchAPI::BaseModel # # # def initialize(auth_method: nil, provider: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Connect::SessionNewParams::Integration#auth_method module AuthMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED = :assisted CREDENTIAL = :credential @@ -143,7 +146,7 @@ module AuthMethod end module Sandbox - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FINCH = :finch PROVIDER = :provider diff --git a/lib/finch-api/models/connect/session_new_response.rb b/lib/finch_api/models/connect/session_new_response.rb similarity index 76% rename from lib/finch-api/models/connect/session_new_response.rb rename to lib/finch_api/models/connect/session_new_response.rb index e21b6e76..bc3ddb43 100644 --- a/lib/finch-api/models/connect/session_new_response.rb +++ b/lib/finch_api/models/connect/session_new_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Connect - class SessionNewResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Connect::Sessions#new + class SessionNewResponse < FinchAPI::Internal::Type::BaseModel # @!attribute connect_url # The Connect URL to redirect the user to for authentication # @@ -22,7 +23,7 @@ class SessionNewResponse < FinchAPI::BaseModel # # # def initialize(connect_url:, session_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 79% rename from lib/finch-api/models/connect/session_reauthenticate_params.rb rename to lib/finch_api/models/connect/session_reauthenticate_params.rb index 7b76bcb4..7ce17b5c 100644 --- a/lib/finch-api/models/connect/session_reauthenticate_params.rb +++ b/lib/finch_api/models/connect/session_reauthenticate_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Connect - class SessionReauthenticateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Connect::Sessions#reauthenticate + class SessionReauthenticateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute connection_id # The ID of the existing connection to reauthenticate @@ -26,7 +27,7 @@ class SessionReauthenticateParams < FinchAPI::BaseModel # # @return [Array, nil] optional :products, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Connect::SessionReauthenticateParams::Product] }, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::Connect::SessionReauthenticateParams::Product] }, nil?: true # @!attribute redirect_uri @@ -44,11 +45,11 @@ class SessionReauthenticateParams < FinchAPI::BaseModel # # # def initialize(connection_id:, minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The Finch products that can be requested during the Connect flow. module Product - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPANY = :company DIRECTORY = :directory diff --git a/lib/finch-api/models/connect/session_reauthenticate_response.rb b/lib/finch_api/models/connect/session_reauthenticate_response.rb similarity index 74% rename from lib/finch-api/models/connect/session_reauthenticate_response.rb rename to lib/finch_api/models/connect/session_reauthenticate_response.rb index 35e40476..4970f6d1 100644 --- a/lib/finch-api/models/connect/session_reauthenticate_response.rb +++ b/lib/finch_api/models/connect/session_reauthenticate_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Connect - class SessionReauthenticateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Connect::Sessions#reauthenticate + class SessionReauthenticateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute connect_url # The Connect URL to redirect the user to for reauthentication # @@ -22,7 +23,7 @@ class SessionReauthenticateResponse < FinchAPI::BaseModel # # # def initialize(connect_url:, session_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/connection_status_type.rb b/lib/finch_api/models/connection_status_type.rb similarity index 90% rename from lib/finch-api/models/connection_status_type.rb rename to lib/finch_api/models/connection_status_type.rb index 60299526..4ab74521 100644 --- a/lib/finch-api/models/connection_status_type.rb +++ b/lib/finch_api/models/connection_status_type.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module ConnectionStatusType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PENDING = :pending PROCESSING = :processing diff --git a/lib/finch-api/models/create_access_token_response.rb b/lib/finch_api/models/create_access_token_response.rb similarity index 88% rename from lib/finch-api/models/create_access_token_response.rb rename to lib/finch_api/models/create_access_token_response.rb index b651790b..45cbc8ca 100644 --- a/lib/finch-api/models/create_access_token_response.rb +++ b/lib/finch_api/models/create_access_token_response.rb @@ -2,7 +2,8 @@ module FinchAPI module Models - class CreateAccessTokenResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::AccessTokens#create + class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel # @!attribute access_token # The access token for the connection. # @@ -48,7 +49,7 @@ class CreateAccessTokenResponse < FinchAPI::BaseModel # An array of the authorized products associated with the `access_token`. # # @return [Array] - required :products, FinchAPI::ArrayOf[String] + required :products, FinchAPI::Internal::Type::ArrayOf[String] # @!attribute provider_id # The ID of the provider associated with the `access_token`. @@ -101,11 +102,13 @@ class CreateAccessTokenResponse < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of application associated with a token. + # + # @see FinchAPI::Models::CreateAccessTokenResponse#client_type module ClientType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PRODUCTION = :production DEVELOPMENT = :development @@ -122,8 +125,10 @@ module ClientType # # - `provider` - connection to an external provider # - `finch` - finch-generated data. + # + # @see FinchAPI::Models::CreateAccessTokenResponse#connection_type module ConnectionType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PROVIDER = :provider FINCH = :finch diff --git a/lib/finch-api/models/directory_event.rb b/lib/finch_api/models/directory_event.rb similarity index 86% rename from lib/finch-api/models/directory_event.rb rename to lib/finch_api/models/directory_event.rb index 5bb8ff07..c5eec46c 100644 --- a/lib/finch-api/models/directory_event.rb +++ b/lib/finch_api/models/directory_event.rb @@ -27,9 +27,9 @@ class DirectoryEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individual_id # The ID of the individual related to the event. # @@ -45,11 +45,11 @@ class Data < FinchAPI::BaseModel # # # def initialize(individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DIRECTORY_CREATED = :"directory.created" DIRECTORY_UPDATED = :"directory.updated" diff --git a/lib/finch-api/models/disconnect_response.rb b/lib/finch_api/models/disconnect_response.rb similarity index 65% rename from lib/finch-api/models/disconnect_response.rb rename to lib/finch_api/models/disconnect_response.rb index 0c0370ef..2f29ea1b 100644 --- a/lib/finch-api/models/disconnect_response.rb +++ b/lib/finch_api/models/disconnect_response.rb @@ -2,7 +2,8 @@ module FinchAPI module Models - class DisconnectResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Account#disconnect + class DisconnectResponse < FinchAPI::Internal::Type::BaseModel # @!attribute status # If the request is successful, Finch will return “success” (HTTP 200 status). # @@ -14,7 +15,7 @@ class DisconnectResponse < FinchAPI::BaseModel # # # def initialize(status:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/employment_event.rb b/lib/finch_api/models/employment_event.rb similarity index 86% rename from lib/finch-api/models/employment_event.rb rename to lib/finch_api/models/employment_event.rb index 86f18c5f..f3ac983d 100644 --- a/lib/finch-api/models/employment_event.rb +++ b/lib/finch_api/models/employment_event.rb @@ -27,9 +27,9 @@ class EmploymentEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individual_id # The ID of the individual related to the event. # @@ -45,11 +45,11 @@ class Data < FinchAPI::BaseModel # # # def initialize(individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYMENT_CREATED = :"employment.created" EMPLOYMENT_UPDATED = :"employment.updated" diff --git a/lib/finch-api/models/hris/benefit_contribution.rb b/lib/finch_api/models/hris/benefit_contribution.rb similarity index 79% rename from lib/finch-api/models/hris/benefit_contribution.rb rename to lib/finch_api/models/hris/benefit_contribution.rb index 4c57ebe4..ec5826a7 100644 --- a/lib/finch-api/models/hris/benefit_contribution.rb +++ b/lib/finch_api/models/hris/benefit_contribution.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class BenefitContribution < FinchAPI::BaseModel + class BenefitContribution < FinchAPI::Internal::Type::BaseModel # @!attribute amount # Contribution amount in cents (if `fixed`) or basis points (if `percent`). # @@ -22,11 +22,13 @@ class BenefitContribution < FinchAPI::BaseModel # # # def initialize(amount: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # Contribution type. + # + # @see FinchAPI::Models::HRIS::BenefitContribution#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent diff --git a/lib/finch-api/models/hris/benefit_create_params.rb b/lib/finch_api/models/hris/benefit_create_params.rb similarity index 77% rename from lib/finch-api/models/hris/benefit_create_params.rb rename to lib/finch_api/models/hris/benefit_create_params.rb index c5561dfa..184ea121 100644 --- a/lib/finch-api/models/hris/benefit_create_params.rb +++ b/lib/finch_api/models/hris/benefit_create_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module HRIS - class BenefitCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits#create + class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] description # Name of the benefit as it appears in the provider and pay statements. Recommend @@ -21,6 +22,7 @@ class BenefitCreateParams < FinchAPI::BaseModel # attr_writer :description # @!attribute frequency + # The frequency of the benefit deduction/contribution. # # @return [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] optional :frequency, enum: -> { FinchAPI::Models::HRIS::BenefitFrequency }, nil?: true @@ -39,7 +41,7 @@ class BenefitCreateParams < FinchAPI::BaseModel # # # def initialize(description: nil, frequency: nil, type: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 85% rename from lib/finch-api/models/hris/benefit_features_and_operations.rb rename to lib/finch_api/models/hris/benefit_features_and_operations.rb index 9d7f186d..e51d417d 100644 --- a/lib/finch-api/models/hris/benefit_features_and_operations.rb +++ b/lib/finch_api/models/hris/benefit_features_and_operations.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class BenefitFeaturesAndOperations < FinchAPI::BaseModel + class BenefitFeaturesAndOperations < FinchAPI::Internal::Type::BaseModel # @!attribute [r] supported_features # # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, nil] @@ -29,21 +29,22 @@ class BenefitFeaturesAndOperations < FinchAPI::BaseModel # # # def initialize(supported_features: nil, supported_operations: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class SupportedFeatures < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::BenefitFeaturesAndOperations#supported_features + class SupportedFeatures < FinchAPI::Internal::Type::BaseModel # @!attribute annual_maximum # Whether the provider supports an annual maximum for this benefit. # # @return [Boolean, nil] - optional :annual_maximum, FinchAPI::BooleanModel, nil?: true + optional :annual_maximum, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute catch_up # Whether the provider supports catch up for this benefit. This field will only be # true for retirement benefits. # # @return [Boolean, nil] - optional :catch_up, FinchAPI::BooleanModel, nil?: true + optional :catch_up, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute company_contribution # Supported contribution types. An empty array indicates contributions are not @@ -52,7 +53,7 @@ class SupportedFeatures < FinchAPI::BaseModel # @return [Array, nil] optional :company_contribution, -> do - FinchAPI::ArrayOf[ + FinchAPI::Internal::Type::ArrayOf[ enum: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution, nil?: true ] end, @@ -70,7 +71,7 @@ class SupportedFeatures < FinchAPI::BaseModel # @return [Array, nil] optional :employee_deduction, -> do - FinchAPI::ArrayOf[ + FinchAPI::Internal::Type::ArrayOf[ enum: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction, nil?: true ] end, @@ -81,7 +82,7 @@ class SupportedFeatures < FinchAPI::BaseModel # # @return [Array, nil] optional :frequencies, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true] } + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true] } # @!parse # # @return [Array] @@ -94,7 +95,7 @@ class SupportedFeatures < FinchAPI::BaseModel # @return [Array, nil] optional :hsa_contribution_limit, -> do - FinchAPI::ArrayOf[ + FinchAPI::Internal::Type::ArrayOf[ enum: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit, nil?: true ] end, @@ -122,10 +123,10 @@ class SupportedFeatures < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module CompanyContribution - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent @@ -138,7 +139,7 @@ module CompanyContribution end module EmployeeDeduction - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent @@ -151,7 +152,7 @@ module EmployeeDeduction end module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL = :individual FAMILY = :family diff --git a/lib/finch-api/models/hris/benefit_frequency.rb b/lib/finch_api/models/hris/benefit_frequency.rb similarity index 76% rename from lib/finch-api/models/hris/benefit_frequency.rb rename to lib/finch_api/models/hris/benefit_frequency.rb index d882c80c..84a275c8 100644 --- a/lib/finch-api/models/hris/benefit_frequency.rb +++ b/lib/finch_api/models/hris/benefit_frequency.rb @@ -3,8 +3,9 @@ module FinchAPI module Models module HRIS + # The frequency of the benefit deduction/contribution. module BenefitFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ONE_TIME = :one_time EVERY_PAYCHECK = :every_paycheck diff --git a/lib/finch_api/models/hris/benefit_list_params.rb b/lib/finch_api/models/hris/benefit_list_params.rb new file mode 100644 index 00000000..21c0e2d0 --- /dev/null +++ b/lib/finch_api/models/hris/benefit_list_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @see FinchAPI::Resources::HRIS::Benefits#list + class BenefitListParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch_api/models/hris/benefit_list_supported_benefits_params.rb b/lib/finch_api/models/hris/benefit_list_supported_benefits_params.rb new file mode 100644 index 00000000..4994b198 --- /dev/null +++ b/lib/finch_api/models/hris/benefit_list_supported_benefits_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @see FinchAPI::Resources::HRIS::Benefits#list_supported_benefits + class BenefitListSupportedBenefitsParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch_api/models/hris/benefit_retrieve_params.rb b/lib/finch_api/models/hris/benefit_retrieve_params.rb new file mode 100644 index 00000000..881287ce --- /dev/null +++ b/lib/finch_api/models/hris/benefit_retrieve_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @see FinchAPI::Resources::HRIS::Benefits#retrieve + class BenefitRetrieveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_type.rb b/lib/finch_api/models/hris/benefit_type.rb similarity index 67% rename from lib/finch-api/models/hris/benefit_type.rb rename to lib/finch_api/models/hris/benefit_type.rb index b78cb3fa..569fcd4c 100644 --- a/lib/finch-api/models/hris/benefit_type.rb +++ b/lib/finch_api/models/hris/benefit_type.rb @@ -5,15 +5,15 @@ module Models module HRIS # Type of benefit. module BenefitType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum - NUMBER_401K = :"401k" - NUMBER_401K_ROTH = :"401k_roth" - NUMBER_401K_LOAN = :"401k_loan" - NUMBER_403B = :"403b" - NUMBER_403B_ROTH = :"403b_roth" - NUMBER_457 = :"457" - NUMBER_457_ROTH = :"457_roth" + BENEFIT_TYPE_401K = :"401k" + BENEFIT_TYPE_401K_ROTH = :"401k_roth" + BENEFIT_TYPE_401K_LOAN = :"401k_loan" + BENEFIT_TYPE_403B = :"403b" + BENEFIT_TYPE_403B_ROTH = :"403b_roth" + BENEFIT_TYPE_457 = :"457" + BENEFIT_TYPE_457_ROTH = :"457_roth" S125_MEDICAL = :s125_medical S125_DENTAL = :s125_dental S125_VISION = :s125_vision diff --git a/lib/finch-api/models/hris/benefit_update_params.rb b/lib/finch_api/models/hris/benefit_update_params.rb similarity index 64% rename from lib/finch-api/models/hris/benefit_update_params.rb rename to lib/finch_api/models/hris/benefit_update_params.rb index 618c81e1..43047dac 100644 --- a/lib/finch-api/models/hris/benefit_update_params.rb +++ b/lib/finch_api/models/hris/benefit_update_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module HRIS - class BenefitUpdateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits#update + class BenefitUpdateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] description # Updated name or description. @@ -24,7 +25,7 @@ class BenefitUpdateParams < FinchAPI::BaseModel # # # def initialize(description: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 80% rename from lib/finch-api/models/hris/benefits/enrolled_individual.rb rename to lib/finch_api/models/hris/benefits/enrolled_individual.rb index b55a4731..92175eff 100644 --- a/lib/finch-api/models/hris/benefits/enrolled_individual.rb +++ b/lib/finch_api/models/hris/benefits/enrolled_individual.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module HRIS module Benefits - class EnrolledIndividual < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#enroll_many + class EnrolledIndividual < FinchAPI::Internal::Type::BaseModel # @!attribute [r] body # # @return [FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, nil] @@ -40,11 +41,12 @@ class EnrolledIndividual < FinchAPI::BaseModel # # # def initialize(body: nil, code: nil, individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Body < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Benefits::EnrolledIndividual#body + class Body < FinchAPI::Internal::Type::BaseModel # @!attribute finch_code - # A descriptive identifier for the response + # A descriptive identifier for the response. # # @return [String, nil] optional :finch_code, String, nil?: true @@ -68,12 +70,14 @@ class Body < FinchAPI::BaseModel # # # def initialize(finch_code: nil, message: nil, name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end # HTTP status code. Either 201 or 200 + # + # @see FinchAPI::Models::HRIS::Benefits::EnrolledIndividual#code module Code - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum OK = 200 CREATED = 201 diff --git a/lib/finch-api/models/hris/benefits/individual_benefit.rb b/lib/finch_api/models/hris/benefits/individual_benefit.rb similarity index 84% rename from lib/finch-api/models/hris/benefits/individual_benefit.rb rename to lib/finch_api/models/hris/benefits/individual_benefit.rb index e6203e58..26db30af 100644 --- a/lib/finch-api/models/hris/benefits/individual_benefit.rb +++ b/lib/finch_api/models/hris/benefits/individual_benefit.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualBenefit < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#retrieve_many_benefits + class IndividualBenefit < FinchAPI::Internal::Type::BaseModel # @!attribute [r] body # # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, nil] @@ -39,9 +40,10 @@ class IndividualBenefit < FinchAPI::BaseModel # # # def initialize(body: nil, code: nil, individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Body < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit#body + class Body < FinchAPI::Internal::Type::BaseModel # @!attribute annual_maximum # If the benefit supports annual maximum, the amount in cents for this individual. # @@ -53,7 +55,7 @@ class Body < FinchAPI::BaseModel # for this individual. # # @return [Boolean, nil] - optional :catch_up, FinchAPI::BooleanModel, nil?: true + optional :catch_up, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute company_contribution # @@ -91,11 +93,13 @@ class Body < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # Type for HSA contribution limit if the benefit is a HSA. + # + # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body#hsa_contribution_limit module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL = :individual FAMILY = :family 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 similarity index 78% rename from lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb rename to lib/finch_api/models/hris/benefits/individual_enroll_many_params.rb index 0f06b59f..7e1dca5d 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 @@ -4,17 +4,18 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualEnrollManyParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#enroll_many + class IndividualEnrollManyParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] individuals # Array of the individual_id to enroll and a configuration object. # # @return [Array, nil] optional :individuals, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] } # @!parse # # @return [Array] @@ -26,9 +27,9 @@ class IndividualEnrollManyParams < FinchAPI::BaseModel # # # def initialize(individuals: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel # @!attribute [r] configuration # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, nil] @@ -55,9 +56,10 @@ class Individual < FinchAPI::BaseModel # # # def initialize(configuration: nil, individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Configuration < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual#configuration + class Configuration < FinchAPI::Internal::Type::BaseModel # @!attribute [r] annual_contribution_limit # For HSA benefits only - whether the contribution limit is for an individual or # family @@ -80,7 +82,7 @@ class Configuration < FinchAPI::BaseModel # For retirement benefits only - whether catch up contributions are enabled # # @return [Boolean, nil] - optional :catch_up, FinchAPI::BooleanModel + optional :catch_up, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -96,6 +98,16 @@ class Configuration < FinchAPI::BaseModel # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution] # attr_writer :company_contribution + # @!attribute [r] effective_date + # The date the enrollment will take effect + # + # @return [Date, nil] + optional :effective_date, Date + + # @!parse + # # @return [Date] + # attr_writer :effective_date + # @!attribute [r] employee_deduction # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction, nil] @@ -111,6 +123,7 @@ class Configuration < FinchAPI::BaseModel # # @param annual_maximum [Integer, nil] # # @param catch_up [Boolean] # # @param company_contribution [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution] + # # @param effective_date [Date] # # @param employee_deduction [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction] # # # def initialize( @@ -118,18 +131,21 @@ class Configuration < FinchAPI::BaseModel # annual_maximum: nil, # catch_up: nil, # company_contribution: nil, + # effective_date: nil, # employee_deduction: nil, # ** # ) # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # For HSA benefits only - whether the contribution limit is for an individual or # family + # + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration#annual_contribution_limit module AnnualContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL = :individual FAMILY = :family @@ -141,7 +157,8 @@ module AnnualContributionLimit # def self.values; end end - class CompanyContribution < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration#company_contribution + class CompanyContribution < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # Amount in cents for fixed type or basis points (1/100th of a percent) for # percent type @@ -169,10 +186,11 @@ class CompanyContribution < FinchAPI::BaseModel # # # def initialize(amount: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent @@ -185,7 +203,8 @@ module Type end end - class EmployeeDeduction < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration#employee_deduction + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # Amount in cents for fixed type or basis points (1/100th of a percent) for # percent type @@ -213,10 +232,11 @@ class EmployeeDeduction < FinchAPI::BaseModel # # # def initialize(amount: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent diff --git a/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rb b/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rb new file mode 100644 index 00000000..f474ecfe --- /dev/null +++ b/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#enrolled_ids + class IndividualEnrolledIDsParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb b/lib/finch_api/models/hris/benefits/individual_enrolled_ids_response.rb similarity index 60% rename from lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb rename to lib/finch_api/models/hris/benefits/individual_enrolled_ids_response.rb index dbe284bd..3d108db4 100644 --- a/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb +++ b/lib/finch_api/models/hris/benefits/individual_enrolled_ids_response.rb @@ -4,8 +4,10 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualEnrolledIDsResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#enrolled_ids + class IndividualEnrolledIDsResponse < FinchAPI::Internal::Type::BaseModel # @!attribute benefit_id + # The id of the benefit. # # @return [String] required :benefit_id, String @@ -13,7 +15,7 @@ class IndividualEnrolledIDsResponse < FinchAPI::BaseModel # @!attribute individual_ids # # @return [Array] - required :individual_ids, FinchAPI::ArrayOf[String] + required :individual_ids, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @param benefit_id [String] @@ -21,7 +23,7 @@ class IndividualEnrolledIDsResponse < FinchAPI::BaseModel # # # def initialize(benefit_id:, individual_ids:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb b/lib/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rb similarity index 66% rename from lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb rename to lib/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rb index 76dcf11c..31eb0757 100644 --- a/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb +++ b/lib/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rb @@ -4,10 +4,11 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#retrieve_many_benefits + class IndividualRetrieveManyBenefitsParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] individual_ids # comma-delimited list of stable Finch uuids for each individual. If empty, @@ -26,7 +27,7 @@ class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel # # # def initialize(individual_ids: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb b/lib/finch_api/models/hris/benefits/individual_unenroll_many_params.rb similarity index 59% rename from lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb rename to lib/finch_api/models/hris/benefits/individual_unenroll_many_params.rb index f132f3a3..8bbec29f 100644 --- a/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb +++ b/lib/finch_api/models/hris/benefits/individual_unenroll_many_params.rb @@ -4,16 +4,17 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualUnenrollManyParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#unenroll_many + class IndividualUnenrollManyParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] individual_ids # Array of individual_ids to unenroll. # # @return [Array, nil] - optional :individual_ids, FinchAPI::ArrayOf[String] + optional :individual_ids, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -25,7 +26,7 @@ class IndividualUnenrollManyParams < FinchAPI::BaseModel # # # def initialize(individual_ids: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/benefits/unenrolled_individual.rb b/lib/finch_api/models/hris/benefits/unenrolled_individual.rb similarity index 83% rename from lib/finch-api/models/hris/benefits/unenrolled_individual.rb rename to lib/finch_api/models/hris/benefits/unenrolled_individual.rb index 569be98a..723d35e9 100644 --- a/lib/finch-api/models/hris/benefits/unenrolled_individual.rb +++ b/lib/finch_api/models/hris/benefits/unenrolled_individual.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module HRIS module Benefits - class UnenrolledIndividual < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits::Individuals#unenroll_many + class UnenrolledIndividual < FinchAPI::Internal::Type::BaseModel # @!attribute [r] body # # @return [FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, nil] @@ -40,9 +41,10 @@ class UnenrolledIndividual < FinchAPI::BaseModel # # # def initialize(body: nil, code: nil, individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Body < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual#body + class Body < FinchAPI::Internal::Type::BaseModel # @!attribute finch_code # A descriptive identifier for the response. # @@ -68,7 +70,7 @@ class Body < FinchAPI::BaseModel # # # def initialize(finch_code: nil, message: nil, name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/benefits_support.rb b/lib/finch_api/models/hris/benefits_support.rb similarity index 96% rename from lib/finch-api/models/hris/benefits_support.rb rename to lib/finch_api/models/hris/benefits_support.rb index a7770d06..ff5c0950 100644 --- a/lib/finch-api/models/hris/benefits_support.rb +++ b/lib/finch_api/models/hris/benefits_support.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class BenefitsSupport < FinchAPI::BaseModel + class BenefitsSupport < FinchAPI::Internal::Type::BaseModel # @!attribute commuter # # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] @@ -99,7 +99,7 @@ class BenefitsSupport < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/benfit_contribution.rb b/lib/finch_api/models/hris/benfit_contribution.rb similarity index 100% rename from lib/finch-api/models/hris/benfit_contribution.rb rename to lib/finch_api/models/hris/benfit_contribution.rb diff --git a/lib/finch-api/models/hris/company.rb b/lib/finch_api/models/hris/company.rb similarity index 81% rename from lib/finch-api/models/hris/company.rb rename to lib/finch_api/models/hris/company.rb index 94788671..71ade59d 100644 --- a/lib/finch-api/models/hris/company.rb +++ b/lib/finch_api/models/hris/company.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class HRISCompany < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Company#retrieve + class HRISCompany < FinchAPI::Internal::Type::BaseModel # @!attribute id # A stable Finch `id` (UUID v4) for the company. # @@ -14,14 +15,16 @@ class HRISCompany < FinchAPI::BaseModel # An array of bank account objects associated with the payroll/HRIS system. # # @return [Array, nil] - required :accounts, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Account] }, nil?: true + required :accounts, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Account] }, + nil?: true # @!attribute departments # The array of company departments. # # @return [Array, nil] required :departments, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Department, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Department, nil?: true] }, nil?: true # @!attribute ein @@ -45,7 +48,9 @@ class HRISCompany < FinchAPI::BaseModel # @!attribute locations # # @return [Array, nil] - required :locations, -> { FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true] }, nil?: true + required :locations, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Location, nil?: true] }, + nil?: true # @!attribute primary_email # The email of the main administrator on the account. @@ -85,9 +90,9 @@ class HRISCompany < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel # @!attribute account_name # The name of the bank associated in the payroll/HRIS system. # @@ -128,11 +133,13 @@ class Account < FinchAPI::BaseModel # # # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of bank account. + # + # @see FinchAPI::Models::HRIS::HRISCompany::Account#account_type module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECKING = :checking SAVINGS = :savings @@ -145,7 +152,7 @@ module AccountType end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The department name. # @@ -164,9 +171,10 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, parent: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Parent < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::HRISCompany::Department#parent + class Parent < FinchAPI::Internal::Type::BaseModel # @!attribute name # The parent department's name. # @@ -180,11 +188,12 @@ class Parent < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Entity < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::HRISCompany#entity + class Entity < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The tax payer subtype of the company. # @@ -205,11 +214,13 @@ class Entity < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The tax payer subtype of the company. + # + # @see FinchAPI::Models::HRIS::HRISCompany::Entity#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum S_CORPORATION = :s_corporation C_CORPORATION = :c_corporation @@ -223,8 +234,10 @@ module Subtype end # The tax payer type of the company. + # + # @see FinchAPI::Models::HRIS::HRISCompany::Entity#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum LLC = :llc LP = :lp diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rb new file mode 100644 index 00000000..5197bc40 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rb @@ -0,0 +1,176 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#create + class RuleCreateParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!attribute [r] attributes + # Specifies the fields to be applied when the condition is met. + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes] + # attr_writer :attributes + + # @!attribute [r] conditions + # + # @return [Array, nil] + optional :conditions, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition] } + + # @!parse + # # @return [Array] + # attr_writer :conditions + + # @!attribute effective_end_date + # Specifies when the rules should stop applying rules based on the date. + # + # @return [String, nil] + optional :effective_end_date, String, nil?: true + + # @!attribute effective_start_date + # Specifies when the rule should begin applying based on the date. + # + # @return [String, nil] + optional :effective_start_date, String, nil?: true + + # @!attribute [r] entity_type + # The entity type to which the rule is applied. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType, nil] + optional :entity_type, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType] + # attr_writer :entity_type + + # @!parse + # # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes] + # # @param conditions [Array] + # # @param effective_end_date [String, nil] + # # @param effective_start_date [String, nil] + # # @param entity_type [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # attributes: nil, + # conditions: nil, + # effective_end_date: nil, + # effective_start_date: nil, + # entity_type: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + class Attributes < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] metadata + # The metadata to be attached in the entity. It is a key-value pairs where the + # values can be of any type (string, number, boolean, object, array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # Specifies the fields to be applied when the condition is met. + # # + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] field + # The field to be checked in the rule. + # + # @return [String, nil] + optional :field, String + + # @!parse + # # @return [String] + # attr_writer :field + + # @!attribute [r] operator + # The operator to be used in the rule. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator, nil] + optional :operator, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator] + # attr_writer :operator + + # @!attribute [r] value + # The value of the field to be checked in the rule. + # + # @return [String, nil] + optional :value, String + + # @!parse + # # @return [String] + # attr_writer :value + + # @!parse + # # @param field [String] + # # @param operator [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator] + # # @param value [String] + # # + # def initialize(field: nil, operator: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # The operator to be used in the rule. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition#operator + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS = :equals + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # The entity type to which the rule is applied. + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM = :pay_statement_item + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_create_response.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_create_response.rb new file mode 100644 index 00000000..6d1f7d07 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_create_response.rb @@ -0,0 +1,221 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#create + class RuleCreateResponse < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] id + # Finch id (uuidv4) for the rule. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute [r] attributes + # Specifies the fields to be applied when the condition is met. + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes] + # attr_writer :attributes + + # @!attribute [r] conditions + # + # @return [Array, nil] + optional :conditions, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition] } + + # @!parse + # # @return [Array] + # attr_writer :conditions + + # @!attribute [r] created_at + # The datetime when the rule was created. + # + # @return [Time, nil] + optional :created_at, Time + + # @!parse + # # @return [Time] + # attr_writer :created_at + + # @!attribute effective_end_date + # Specifies when the rules should stop applying rules based on the date. + # + # @return [String, nil] + optional :effective_end_date, String, nil?: true + + # @!attribute effective_start_date + # Specifies when the rule should begin applying based on the date. + # + # @return [String, nil] + optional :effective_start_date, String, nil?: true + + # @!attribute [r] entity_type + # The entity type to which the rule is applied. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType, nil] + optional :entity_type, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType] + # attr_writer :entity_type + + # @!attribute [r] priority + # The priority of the rule. + # + # @return [Integer, nil] + optional :priority, Integer + + # @!parse + # # @return [Integer] + # attr_writer :priority + + # @!attribute [r] updated_at + # The datetime when the rule was last updated. + # + # @return [Time, nil] + optional :updated_at, Time + + # @!parse + # # @return [Time] + # attr_writer :updated_at + + # @!parse + # # @param id [String] + # # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes] + # # @param conditions [Array] + # # @param created_at [Time] + # # @param effective_end_date [String, nil] + # # @param effective_start_date [String, nil] + # # @param entity_type [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType] + # # @param priority [Integer] + # # @param updated_at [Time] + # # + # def initialize( + # id: nil, + # attributes: nil, + # conditions: nil, + # created_at: nil, + # effective_end_date: nil, + # effective_start_date: nil, + # entity_type: nil, + # priority: nil, + # updated_at: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] metadata + # The metadata to be attached in the entity. It is a key-value pairs where the + # values can be of any type (string, number, boolean, object, array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # Specifies the fields to be applied when the condition is met. + # # + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] field + # The field to be checked in the rule. + # + # @return [String, nil] + optional :field, String + + # @!parse + # # @return [String] + # attr_writer :field + + # @!attribute [r] operator + # The operator to be used in the rule. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator, nil] + optional :operator, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator] + # attr_writer :operator + + # @!attribute [r] value + # The value of the field to be checked in the rule. + # + # @return [String, nil] + optional :value, String + + # @!parse + # # @return [String] + # attr_writer :value + + # @!parse + # # @param field [String] + # # @param operator [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator] + # # @param value [String] + # # + # def initialize(field: nil, operator: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # The operator to be used in the rule. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition#operator + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS = :equals + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # The entity type to which the rule is applied. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse#entity_type + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM = :pay_statement_item + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rb new file mode 100644 index 00000000..274c9d57 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#delete + class RuleDeleteParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rb new file mode 100644 index 00000000..df3fe097 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rb @@ -0,0 +1,233 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#delete + class RuleDeleteResponse < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] id + # Finch id (uuidv4) for the rule. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute [r] attributes + # Specifies the fields to be applied when the condition is met. + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes] + # attr_writer :attributes + + # @!attribute [r] conditions + # + # @return [Array, nil] + optional :conditions, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition] } + + # @!parse + # # @return [Array] + # attr_writer :conditions + + # @!attribute [r] created_at + # The datetime when the rule was created. + # + # @return [Time, nil] + optional :created_at, Time + + # @!parse + # # @return [Time] + # attr_writer :created_at + + # @!attribute [r] deleted_at + # The datetime when the rule was deleted. + # + # @return [Time, nil] + optional :deleted_at, Time + + # @!parse + # # @return [Time] + # attr_writer :deleted_at + + # @!attribute effective_end_date + # Specifies when the rules should stop applying rules based on the date. + # + # @return [String, nil] + optional :effective_end_date, String, nil?: true + + # @!attribute effective_start_date + # Specifies when the rule should begin applying based on the date. + # + # @return [String, nil] + optional :effective_start_date, String, nil?: true + + # @!attribute [r] entity_type + # The entity type to which the rule is applied. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType, nil] + optional :entity_type, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType] + # attr_writer :entity_type + + # @!attribute [r] priority + # The priority of the rule. + # + # @return [Integer, nil] + optional :priority, Integer + + # @!parse + # # @return [Integer] + # attr_writer :priority + + # @!attribute [r] updated_at + # The datetime when the rule was last updated. + # + # @return [Time, nil] + optional :updated_at, Time + + # @!parse + # # @return [Time] + # attr_writer :updated_at + + # @!parse + # # @param id [String] + # # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes] + # # @param conditions [Array] + # # @param created_at [Time] + # # @param deleted_at [Time] + # # @param effective_end_date [String, nil] + # # @param effective_start_date [String, nil] + # # @param entity_type [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType] + # # @param priority [Integer] + # # @param updated_at [Time] + # # + # def initialize( + # id: nil, + # attributes: nil, + # conditions: nil, + # created_at: nil, + # deleted_at: nil, + # effective_end_date: nil, + # effective_start_date: nil, + # entity_type: nil, + # priority: nil, + # updated_at: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] metadata + # The metadata to be attached in the entity. It is a key-value pairs where the + # values can be of any type (string, number, boolean, object, array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # Specifies the fields to be applied when the condition is met. + # # + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] field + # The field to be checked in the rule. + # + # @return [String, nil] + optional :field, String + + # @!parse + # # @return [String] + # attr_writer :field + + # @!attribute [r] operator + # The operator to be used in the rule. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator, nil] + optional :operator, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator] + # attr_writer :operator + + # @!attribute [r] value + # The value of the field to be checked in the rule. + # + # @return [String, nil] + optional :value, String + + # @!parse + # # @return [String] + # attr_writer :value + + # @!parse + # # @param field [String] + # # @param operator [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator] + # # @param value [String] + # # + # def initialize(field: nil, operator: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # The operator to be used in the rule. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition#operator + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS = :equals + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # The entity type to which the rule is applied. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse#entity_type + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM = :pay_statement_item + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_list_params.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_list_params.rb new file mode 100644 index 00000000..c8f42f92 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_list_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#list + class RuleListParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_list_response.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_list_response.rb new file mode 100644 index 00000000..9f54a59b --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_list_response.rb @@ -0,0 +1,221 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#list + class RuleListResponse < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] id + # Finch id (uuidv4) for the rule. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute [r] attributes + # Specifies the fields to be applied when the condition is met. + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes] + # attr_writer :attributes + + # @!attribute [r] conditions + # + # @return [Array, nil] + optional :conditions, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition] } + + # @!parse + # # @return [Array] + # attr_writer :conditions + + # @!attribute [r] created_at + # The datetime when the rule was created. + # + # @return [Time, nil] + optional :created_at, Time + + # @!parse + # # @return [Time] + # attr_writer :created_at + + # @!attribute effective_end_date + # Specifies when the rules should stop applying rules based on the date. + # + # @return [String, nil] + optional :effective_end_date, String, nil?: true + + # @!attribute effective_start_date + # Specifies when the rule should begin applying based on the date. + # + # @return [String, nil] + optional :effective_start_date, String, nil?: true + + # @!attribute [r] entity_type + # The entity type to which the rule is applied. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType, nil] + optional :entity_type, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType] + # attr_writer :entity_type + + # @!attribute [r] priority + # The priority of the rule. + # + # @return [Integer, nil] + optional :priority, Integer + + # @!parse + # # @return [Integer] + # attr_writer :priority + + # @!attribute [r] updated_at + # The datetime when the rule was last updated. + # + # @return [Time, nil] + optional :updated_at, Time + + # @!parse + # # @return [Time] + # attr_writer :updated_at + + # @!parse + # # @param id [String] + # # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes] + # # @param conditions [Array] + # # @param created_at [Time] + # # @param effective_end_date [String, nil] + # # @param effective_start_date [String, nil] + # # @param entity_type [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType] + # # @param priority [Integer] + # # @param updated_at [Time] + # # + # def initialize( + # id: nil, + # attributes: nil, + # conditions: nil, + # created_at: nil, + # effective_end_date: nil, + # effective_start_date: nil, + # entity_type: nil, + # priority: nil, + # updated_at: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] metadata + # The metadata to be attached in the entity. It is a key-value pairs where the + # values can be of any type (string, number, boolean, object, array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # Specifies the fields to be applied when the condition is met. + # # + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] field + # The field to be checked in the rule. + # + # @return [String, nil] + optional :field, String + + # @!parse + # # @return [String] + # attr_writer :field + + # @!attribute [r] operator + # The operator to be used in the rule. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator, nil] + optional :operator, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator] + # attr_writer :operator + + # @!attribute [r] value + # The value of the field to be checked in the rule. + # + # @return [String, nil] + optional :value, String + + # @!parse + # # @return [String] + # attr_writer :value + + # @!parse + # # @param field [String] + # # @param operator [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator] + # # @param value [String] + # # + # def initialize(field: nil, operator: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # The operator to be used in the rule. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition#operator + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS = :equals + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # The entity type to which the rule is applied. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse#entity_type + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM = :pay_statement_item + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_update_params.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_update_params.rb new file mode 100644 index 00000000..08b67c91 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_update_params.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#update + class RuleUpdateParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!attribute [r] optional_property + # + # @return [Object, nil] + optional :optional_property, FinchAPI::Internal::Type::Unknown, api_name: :optionalProperty + + # @!parse + # # @return [Object] + # attr_writer :optional_property + + # @!parse + # # @param optional_property [Object] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(optional_property: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item/rule_update_response.rb b/lib/finch_api/models/hris/company/pay_statement_item/rule_update_response.rb new file mode 100644 index 00000000..33ab8123 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item/rule_update_response.rb @@ -0,0 +1,221 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules#update + class RuleUpdateResponse < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] id + # Finch id (uuidv4) for the rule. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute [r] attributes + # Specifies the fields to be applied when the condition is met. + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes] + # attr_writer :attributes + + # @!attribute [r] conditions + # + # @return [Array, nil] + optional :conditions, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition] } + + # @!parse + # # @return [Array] + # attr_writer :conditions + + # @!attribute [r] created_at + # The datetime when the rule was created. + # + # @return [Time, nil] + optional :created_at, Time + + # @!parse + # # @return [Time] + # attr_writer :created_at + + # @!attribute effective_end_date + # Specifies when the rules should stop applying rules based on the date. + # + # @return [String, nil] + optional :effective_end_date, String, nil?: true + + # @!attribute effective_start_date + # Specifies when the rule should begin applying based on the date. + # + # @return [String, nil] + optional :effective_start_date, String, nil?: true + + # @!attribute [r] entity_type + # The entity type to which the rule is applied. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType, nil] + optional :entity_type, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType] + # attr_writer :entity_type + + # @!attribute [r] priority + # The priority of the rule. + # + # @return [Integer, nil] + optional :priority, Integer + + # @!parse + # # @return [Integer] + # attr_writer :priority + + # @!attribute [r] updated_at + # The datetime when the rule was last updated. + # + # @return [Time, nil] + optional :updated_at, Time + + # @!parse + # # @return [Time] + # attr_writer :updated_at + + # @!parse + # # @param id [String] + # # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes] + # # @param conditions [Array] + # # @param created_at [Time] + # # @param effective_end_date [String, nil] + # # @param effective_start_date [String, nil] + # # @param entity_type [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType] + # # @param priority [Integer] + # # @param updated_at [Time] + # # + # def initialize( + # id: nil, + # attributes: nil, + # conditions: nil, + # created_at: nil, + # effective_end_date: nil, + # effective_start_date: nil, + # entity_type: nil, + # priority: nil, + # updated_at: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] metadata + # The metadata to be attached in the entity. It is a key-value pairs where the + # values can be of any type (string, number, boolean, object, array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # Specifies the fields to be applied when the condition is met. + # # + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] field + # The field to be checked in the rule. + # + # @return [String, nil] + optional :field, String + + # @!parse + # # @return [String] + # attr_writer :field + + # @!attribute [r] operator + # The operator to be used in the rule. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator, nil] + optional :operator, + enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator] + # attr_writer :operator + + # @!attribute [r] value + # The value of the field to be checked in the rule. + # + # @return [String, nil] + optional :value, String + + # @!parse + # # @return [String] + # attr_writer :value + + # @!parse + # # @param field [String] + # # @param operator [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator] + # # @param value [String] + # # + # def initialize(field: nil, operator: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # The operator to be used in the rule. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition#operator + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS = :equals + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # The entity type to which the rule is applied. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse#entity_type + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM = :pay_statement_item + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item_list_params.rb b/lib/finch_api/models/hris/company/pay_statement_item_list_params.rb new file mode 100644 index 00000000..d8110541 --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item_list_params.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem#list + class PayStatementItemListParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!attribute [r] categories + # Comma-delimited list of pay statement item categories to filter on. If empty, + # defaults to all categories. + # + # @return [Array, nil] + optional :categories, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category] } + + # @!parse + # # @return [Array] + # attr_writer :categories + + # @!attribute [r] end_date + # The end date to retrieve pay statement items by via their last seen pay date in + # `YYYY-MM-DD` format. + # + # @return [Date, nil] + optional :end_date, Date + + # @!parse + # # @return [Date] + # attr_writer :end_date + + # @!attribute [r] name + # Case-insensitive partial match search by pay statement item name. + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] start_date + # The start date to retrieve pay statement items by via their last seen pay date + # (inclusive) in `YYYY-MM-DD` format. + # + # @return [Date, nil] + optional :start_date, Date + + # @!parse + # # @return [Date] + # attr_writer :start_date + + # @!attribute [r] type + # String search by pay statement item type. + # + # @return [String, nil] + optional :type, String + + # @!parse + # # @return [String] + # attr_writer :type + + # @!parse + # # @param categories [Array] + # # @param end_date [Date] + # # @param name [String] + # # @param start_date [Date] + # # @param type [String] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(categories: nil, end_date: nil, name: nil, start_date: nil, type: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + module Category + extend FinchAPI::Internal::Type::Enum + + EARNINGS = :earnings + TAXES = :taxes + EMPLOYEE_DEDUCTIONS = :employee_deductions + EMPLOYER_CONTRIBUTIONS = :employer_contributions + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch_api/models/hris/company/pay_statement_item_list_response.rb b/lib/finch_api/models/hris/company/pay_statement_item_list_response.rb new file mode 100644 index 00000000..d455ce4e --- /dev/null +++ b/lib/finch_api/models/hris/company/pay_statement_item_list_response.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Company + # @see FinchAPI::Resources::HRIS::Company::PayStatementItem#list + class PayStatementItemListResponse < FinchAPI::Internal::Type::BaseModel + # @!attribute [r] attributes + # The attributes of the pay statement item. + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes, nil] + optional :attributes, -> { FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes] + # attr_writer :attributes + + # @!attribute [r] category + # The category of the pay statement item. + # + # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category, nil] + optional :category, enum: -> { FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category] + # attr_writer :category + + # @!attribute [r] name + # The name of the pay statement item. + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!parse + # # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes] + # # @param category [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category] + # # @param name [String] + # # + # def initialize(attributes: nil, category: nil, name: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + + # @see FinchAPI::Models::HRIS::Company::PayStatementItemListResponse#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel + # @!attribute employer + # `true` if the amount is paid by the employers. This field is only available for + # taxes. + # + # @return [Boolean, nil] + optional :employer, FinchAPI::Internal::Type::BooleanModel, nil?: true + + # @!attribute metadata + # The metadata of the pay statement item derived by the rules engine if available. + # Each attribute will be a key-value pair defined by a rule. + # + # @return [Object, nil] + optional :metadata, FinchAPI::Internal::Type::Unknown, nil?: true + + # @!attribute pre_tax + # `true` if the pay statement item is pre-tax. This field is only available for + # employee deductions. + # + # @return [Boolean, nil] + optional :pre_tax, FinchAPI::Internal::Type::BooleanModel, nil?: true + + # @!attribute type + # The type of the pay statement item. + # + # @return [String, nil] + optional :type, String, nil?: true + + # @!parse + # # The attributes of the pay statement item. + # # + # # @param employer [Boolean, nil] + # # @param metadata [Object, nil] + # # @param pre_tax [Boolean, nil] + # # @param type [String, nil] + # # + # def initialize(employer: nil, metadata: nil, pre_tax: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + + # The category of the pay statement item. + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItemListResponse#category + module Category + extend FinchAPI::Internal::Type::Enum + + EARNINGS = :earnings + TAXES = :taxes + EMPLOYEE_DEDUCTIONS = :employee_deductions + EMPLOYER_CONTRIBUTIONS = :employer_contributions + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/company_benefit.rb b/lib/finch_api/models/hris/company_benefit.rb similarity index 79% rename from lib/finch-api/models/hris/company_benefit.rb rename to lib/finch_api/models/hris/company_benefit.rb index b92f2879..ca971403 100644 --- a/lib/finch-api/models/hris/company_benefit.rb +++ b/lib/finch_api/models/hris/company_benefit.rb @@ -3,8 +3,10 @@ module FinchAPI module Models module HRIS - class CompanyBenefit < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits#retrieve + class CompanyBenefit < FinchAPI::Internal::Type::BaseModel # @!attribute benefit_id + # The id of the benefit. # # @return [String] required :benefit_id, String @@ -15,6 +17,7 @@ class CompanyBenefit < FinchAPI::BaseModel required :description, String, nil?: true # @!attribute frequency + # The frequency of the benefit deduction/contribution. # # @return [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] required :frequency, enum: -> { FinchAPI::Models::HRIS::BenefitFrequency }, nil?: true @@ -33,7 +36,7 @@ class CompanyBenefit < FinchAPI::BaseModel # # # def initialize(benefit_id:, description:, frequency:, type:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch_api/models/hris/company_retrieve_params.rb b/lib/finch_api/models/hris/company_retrieve_params.rb new file mode 100644 index 00000000..31b410bf --- /dev/null +++ b/lib/finch_api/models/hris/company_retrieve_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @see FinchAPI::Resources::HRIS::Company#retrieve + class CompanyRetrieveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/create_company_benefits_response.rb b/lib/finch_api/models/hris/create_company_benefits_response.rb similarity index 57% rename from lib/finch-api/models/hris/create_company_benefits_response.rb rename to lib/finch_api/models/hris/create_company_benefits_response.rb index 925680b9..95be88ab 100644 --- a/lib/finch-api/models/hris/create_company_benefits_response.rb +++ b/lib/finch_api/models/hris/create_company_benefits_response.rb @@ -3,8 +3,10 @@ module FinchAPI module Models module HRIS - class CreateCompanyBenefitsResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits#create + class CreateCompanyBenefitsResponse < FinchAPI::Internal::Type::BaseModel # @!attribute benefit_id + # The id of the benefit. # # @return [String] required :benefit_id, String @@ -14,7 +16,7 @@ class CreateCompanyBenefitsResponse < FinchAPI::BaseModel # # # def initialize(benefit_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/directory_list_individuals_params.rb b/lib/finch_api/models/hris/directory_list_individuals_params.rb similarity index 71% rename from lib/finch-api/models/hris/directory_list_individuals_params.rb rename to lib/finch_api/models/hris/directory_list_individuals_params.rb index 3835dd1d..f25027d2 100644 --- a/lib/finch-api/models/hris/directory_list_individuals_params.rb +++ b/lib/finch_api/models/hris/directory_list_individuals_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module HRIS - class DirectoryListIndividualsParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Directory#list_individuals + class DirectoryListIndividualsParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] limit # Number of employees to return (defaults to all) @@ -35,7 +36,7 @@ class DirectoryListIndividualsParams < FinchAPI::BaseModel # # # def initialize(limit: nil, offset: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/directory_list_params.rb b/lib/finch_api/models/hris/directory_list_params.rb similarity index 72% rename from lib/finch-api/models/hris/directory_list_params.rb rename to lib/finch_api/models/hris/directory_list_params.rb index c0bd6b93..069babc3 100644 --- a/lib/finch-api/models/hris/directory_list_params.rb +++ b/lib/finch_api/models/hris/directory_list_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module HRIS - class DirectoryListParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Directory#list + class DirectoryListParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] limit # Number of employees to return (defaults to all) @@ -35,7 +36,7 @@ class DirectoryListParams < FinchAPI::BaseModel # # # def initialize(limit: nil, offset: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 76% rename from lib/finch-api/models/hris/document_list_params.rb rename to lib/finch_api/models/hris/document_list_params.rb index 3b8aded9..ce4766a2 100644 --- a/lib/finch-api/models/hris/document_list_params.rb +++ b/lib/finch_api/models/hris/document_list_params.rb @@ -3,17 +3,18 @@ module FinchAPI module Models module HRIS - class DocumentListParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Documents#list + class DocumentListParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] individual_ids # Comma-delimited list of stable Finch uuids for each individual. If empty, # defaults to all individuals # # @return [Array, nil] - optional :individual_ids, FinchAPI::ArrayOf[String] + optional :individual_ids, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -44,7 +45,8 @@ class DocumentListParams < FinchAPI::BaseModel # types # # @return [Array, nil] - optional :types, -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::DocumentListParams::Type] } + optional :types, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::DocumentListParams::Type] } # @!parse # # @return [Array] @@ -59,10 +61,10 @@ class DocumentListParams < FinchAPI::BaseModel # # # def initialize(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2020 = :w4_2020 W4_2005 = :w4_2005 diff --git a/lib/finch-api/models/hris/document_list_response.rb b/lib/finch_api/models/hris/document_list_response.rb similarity index 65% rename from lib/finch-api/models/hris/document_list_response.rb rename to lib/finch_api/models/hris/document_list_response.rb index 9394c263..7614278f 100644 --- a/lib/finch-api/models/hris/document_list_response.rb +++ b/lib/finch_api/models/hris/document_list_response.rb @@ -3,11 +3,12 @@ module FinchAPI module Models module HRIS - class DocumentListResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Documents#list + class DocumentListResponse < FinchAPI::Internal::Type::BaseModel # @!attribute documents # # @return [Array] - required :documents, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::DocumentResponse] } + required :documents, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::DocumentResponse] } # @!attribute paging # @@ -20,7 +21,7 @@ class DocumentListResponse < FinchAPI::BaseModel # # # def initialize(documents:, paging:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/document_response.rb b/lib/finch_api/models/hris/document_response.rb similarity index 88% rename from lib/finch-api/models/hris/document_response.rb rename to lib/finch_api/models/hris/document_response.rb index bfafdc49..ff3d7e8b 100644 --- a/lib/finch-api/models/hris/document_response.rb +++ b/lib/finch_api/models/hris/document_response.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class DocumentResponse < FinchAPI::BaseModel + class DocumentResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch id for the document. # @@ -57,11 +57,13 @@ class DocumentResponse < FinchAPI::BaseModel # # # def initialize(id: nil, individual_id: nil, type: nil, url: nil, year: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of document. + # + # @see FinchAPI::Models::HRIS::DocumentResponse#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2020 = :w4_2020 W4_2005 = :w4_2005 diff --git a/lib/finch_api/models/hris/document_retreive_params.rb b/lib/finch_api/models/hris/document_retreive_params.rb new file mode 100644 index 00000000..7ded5dbb --- /dev/null +++ b/lib/finch_api/models/hris/document_retreive_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @see FinchAPI::Resources::HRIS::Documents#retreive + class DocumentRetreiveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/document_retreive_response.rb b/lib/finch_api/models/hris/document_retreive_response.rb similarity index 88% rename from lib/finch-api/models/hris/document_retreive_response.rb rename to lib/finch_api/models/hris/document_retreive_response.rb index 39e25456..9599ce84 100644 --- a/lib/finch-api/models/hris/document_retreive_response.rb +++ b/lib/finch_api/models/hris/document_retreive_response.rb @@ -5,8 +5,10 @@ module Models module HRIS # A 2020 version of the W-4 tax form containing information on an individual's # filing status, dependents, and withholding details. + # + # @see FinchAPI::Resources::HRIS::Documents#retreive module DocumentRetreiveResponse - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union discriminator :type diff --git a/lib/finch-api/models/hris/employment_data.rb b/lib/finch_api/models/hris/employment_data.rb similarity index 85% rename from lib/finch-api/models/hris/employment_data.rb rename to lib/finch_api/models/hris/employment_data.rb index b02e66f2..a447e548 100644 --- a/lib/finch-api/models/hris/employment_data.rb +++ b/lib/finch_api/models/hris/employment_data.rb @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class EmploymentData < FinchAPI::BaseModel + class EmploymentData < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id - # string A stable Finch `id` (UUID v4) for an individual in the company. + # A stable Finch `id` (UUID v4) for an individual in the company. # # @return [String, nil] optional :id, String @@ -26,7 +26,7 @@ class EmploymentData < FinchAPI::BaseModel # # @return [Array, nil] optional :custom_fields, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::EmploymentData::CustomField] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::EmploymentData::CustomField] }, nil?: true # @!attribute department @@ -73,13 +73,15 @@ class EmploymentData < FinchAPI::BaseModel # The array of income history. # # @return [Array, nil] - optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + optional :income_history, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Income, nil?: true] }, + nil?: true # @!attribute is_active # `true` if the individual an an active employee or contractor at the company. # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel, nil?: true + optional :is_active, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute last_name # The legal last name of the individual. @@ -180,9 +182,9 @@ class EmploymentData < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [String, nil] @@ -195,7 +197,7 @@ class CustomField < FinchAPI::BaseModel # @!attribute [r] value # # @return [Object, nil] - optional :value, FinchAPI::Unknown + optional :value, FinchAPI::Internal::Type::Unknown # @!parse # # @return [Object] @@ -207,10 +209,11 @@ class CustomField < FinchAPI::BaseModel # # # def initialize(name: nil, value: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Department < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::EmploymentData#department + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The name of the department associated with the individual. # @@ -224,10 +227,11 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::EmploymentData#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -249,12 +253,14 @@ class Employment < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @see FinchAPI::Models::HRIS::EmploymentData::Employment#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME = :full_time INTERN = :intern @@ -271,8 +277,10 @@ module Subtype end # The main employment type of the individual. + # + # @see FinchAPI::Models::HRIS::EmploymentData::Employment#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE = :employee CONTRACTOR = :contractor @@ -287,8 +295,10 @@ module Type # The detailed employment status of the individual. Available options: `active`, # `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + # + # @see FinchAPI::Models::HRIS::EmploymentData#employment_status module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE = :active DECEASED = :deceased @@ -305,7 +315,8 @@ module EmploymentStatus # def self.values; end end - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::EmploymentData#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -323,7 +334,7 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/employment_data_response.rb b/lib/finch_api/models/hris/employment_data_response.rb similarity index 78% rename from lib/finch-api/models/hris/employment_data_response.rb rename to lib/finch_api/models/hris/employment_data_response.rb index 414fce07..26f529f4 100644 --- a/lib/finch-api/models/hris/employment_data_response.rb +++ b/lib/finch_api/models/hris/employment_data_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class EmploymentDataResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Employments#retrieve_many + class EmploymentDataResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] body # # @return [FinchAPI::Models::HRIS::EmploymentData, nil] @@ -23,6 +24,7 @@ class EmploymentDataResponse < FinchAPI::BaseModel # attr_writer :code # @!attribute [r] individual_id + # A stable Finch `id` (UUID v4) for an individual in the company. # # @return [String, nil] optional :individual_id, String @@ -38,7 +40,7 @@ class EmploymentDataResponse < FinchAPI::BaseModel # # # def initialize(body: nil, code: nil, individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/employment_retrieve_many_params.rb b/lib/finch_api/models/hris/employment_retrieve_many_params.rb similarity index 65% rename from lib/finch-api/models/hris/employment_retrieve_many_params.rb rename to lib/finch_api/models/hris/employment_retrieve_many_params.rb index 33a8f7e5..06b6deca 100644 --- a/lib/finch-api/models/hris/employment_retrieve_many_params.rb +++ b/lib/finch_api/models/hris/employment_retrieve_many_params.rb @@ -3,17 +3,18 @@ module FinchAPI module Models module HRIS - class EmploymentRetrieveManyParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Employments#retrieve_many + class EmploymentRetrieveManyParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute requests # The array of batch requests. # # @return [Array] required :requests, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] } # @!parse # # @param requests [Array] @@ -21,9 +22,9 @@ class EmploymentRetrieveManyParams < FinchAPI::BaseModel # # # def initialize(requests:, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel # @!attribute individual_id # A stable Finch `id` (UUID v4) for an individual in the company. There is no # limit to the number of `individual_id` to send per request. It is preferantial @@ -37,7 +38,7 @@ class Request < FinchAPI::BaseModel # # # def initialize(individual_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/individual.rb b/lib/finch_api/models/hris/individual.rb similarity index 85% rename from lib/finch-api/models/hris/individual.rb rename to lib/finch_api/models/hris/individual.rb index 726ac4bd..7d5a82d1 100644 --- a/lib/finch-api/models/hris/individual.rb +++ b/lib/finch_api/models/hris/individual.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -22,7 +22,9 @@ class Individual < FinchAPI::BaseModel # @!attribute emails # # @return [Array, nil] - optional :emails, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::Individual::Email] }, nil?: true + optional :emails, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Individual::Email] }, + nil?: true # @!attribute encrypted_ssn # Social Security Number of the individual in **encrypted** format. This field is @@ -66,7 +68,7 @@ class Individual < FinchAPI::BaseModel # # @return [Array, nil] optional :phone_numbers, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::Individual::PhoneNumber, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Individual::PhoneNumber, nil?: true] }, nil?: true # @!attribute preferred_name @@ -123,9 +125,9 @@ class Individual < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [String, nil] @@ -146,10 +148,11 @@ class Email < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::HRIS::Individual::Email#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal @@ -163,8 +166,10 @@ module Type end # The EEOC-defined ethnicity of the individual. + # + # @see FinchAPI::Models::HRIS::Individual#ethnicity module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN = :asian WHITE = :white @@ -183,8 +188,10 @@ module Ethnicity end # The gender of the individual. + # + # @see FinchAPI::Models::HRIS::Individual#gender module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE = :female MALE = :male @@ -198,7 +205,7 @@ module Gender # def self.values; end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel # @!attribute data # # @return [String, nil] @@ -215,10 +222,11 @@ class PhoneNumber < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::HRIS::Individual::PhoneNumber#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal diff --git a/lib/finch-api/models/hris/individual_in_directory.rb b/lib/finch_api/models/hris/individual_in_directory.rb similarity index 79% rename from lib/finch-api/models/hris/individual_in_directory.rb rename to lib/finch_api/models/hris/individual_in_directory.rb index 31d761e7..d2130f2d 100644 --- a/lib/finch-api/models/hris/individual_in_directory.rb +++ b/lib/finch_api/models/hris/individual_in_directory.rb @@ -3,9 +3,10 @@ module FinchAPI module Models module HRIS - class IndividualInDirectory < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Directory#list + class IndividualInDirectory < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id - # A stable Finch id (UUID v4) for an individual in the company. + # A stable Finch `id` (UUID v4) for an individual in the company. # # @return [String, nil] optional :id, String @@ -30,7 +31,7 @@ class IndividualInDirectory < FinchAPI::BaseModel # `true` if the individual is an active employee or contractor at the company. # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel, nil?: true + optional :is_active, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute last_name # The legal last name of the individual. @@ -72,9 +73,10 @@ class IndividualInDirectory < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Department < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::IndividualInDirectory#department + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The name of the department. # @@ -88,10 +90,11 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::IndividualInDirectory#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -109,7 +112,7 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/individual_response.rb b/lib/finch_api/models/hris/individual_response.rb similarity index 83% rename from lib/finch-api/models/hris/individual_response.rb rename to lib/finch_api/models/hris/individual_response.rb index 4e1e9d94..bd486b17 100644 --- a/lib/finch-api/models/hris/individual_response.rb +++ b/lib/finch_api/models/hris/individual_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class IndividualResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Individuals#retrieve_many + class IndividualResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] body # # @return [FinchAPI::Models::HRIS::Individual, nil] @@ -38,7 +39,7 @@ class IndividualResponse < FinchAPI::BaseModel # # # def initialize(body: nil, code: nil, individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/individual_retrieve_many_params.rb b/lib/finch_api/models/hris/individual_retrieve_many_params.rb similarity index 68% rename from lib/finch-api/models/hris/individual_retrieve_many_params.rb rename to lib/finch_api/models/hris/individual_retrieve_many_params.rb index 31fe1f6c..778fa101 100644 --- a/lib/finch-api/models/hris/individual_retrieve_many_params.rb +++ b/lib/finch_api/models/hris/individual_retrieve_many_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module HRIS - class IndividualRetrieveManyParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Individuals#retrieve_many + class IndividualRetrieveManyParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute options # @@ -17,7 +18,7 @@ class IndividualRetrieveManyParams < FinchAPI::BaseModel # # @return [Array, nil] optional :requests, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] } # @!parse # # @return [Array] @@ -30,13 +31,13 @@ class IndividualRetrieveManyParams < FinchAPI::BaseModel # # # def initialize(options: nil, requests: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Options < FinchAPI::BaseModel + class Options < FinchAPI::Internal::Type::BaseModel # @!attribute [r] include # # @return [Array, nil] - optional :include, FinchAPI::ArrayOf[String] + optional :include, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -47,10 +48,10 @@ class Options < FinchAPI::BaseModel # # # def initialize(include: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individual_id # # @return [String, nil] @@ -65,7 +66,7 @@ class Request < FinchAPI::BaseModel # # # def initialize(individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/pay_statement.rb b/lib/finch_api/models/hris/pay_statement.rb similarity index 80% rename from lib/finch-api/models/hris/pay_statement.rb rename to lib/finch_api/models/hris/pay_statement.rb index 95f66e65..1865beb9 100644 --- a/lib/finch-api/models/hris/pay_statement.rb +++ b/lib/finch_api/models/hris/pay_statement.rb @@ -3,13 +3,13 @@ module FinchAPI module Models module HRIS - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel # @!attribute earnings # The array of earnings objects associated with this pay statement # # @return [Array, nil] optional :earnings, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::Earning, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::PayStatement::Earning, nil?: true] }, nil?: true # @!attribute employee_deductions @@ -17,14 +17,14 @@ class PayStatement < FinchAPI::BaseModel # # @return [Array, nil] optional :employee_deductions, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction, nil?: true] }, nil?: true # @!attribute employer_contributions # # @return [Array, nil] optional :employer_contributions, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::EmployerContribution, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::PayStatement::EmployerContribution, nil?: true] }, nil?: true # @!attribute gross_pay @@ -58,7 +58,7 @@ class PayStatement < FinchAPI::BaseModel # # @return [Array, nil] optional :taxes, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::Tax, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::PayStatement::Tax, nil?: true] }, nil?: true # @!attribute total_hours @@ -101,9 +101,9 @@ class PayStatement < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Earning < FinchAPI::BaseModel + class Earning < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The earnings amount in cents. # @@ -150,9 +150,10 @@ class Earning < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::Earning#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, nil] @@ -167,16 +168,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::Earning::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -187,13 +189,15 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end # The type of earning. + # + # @see FinchAPI::Models::HRIS::PayStatement::Earning#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum SALARY = :salary WAGE = :wage @@ -206,7 +210,7 @@ module Type BONUS = :bonus COMMISSION = :commission TIPS = :tips - NUMBER_1099 = :"1099" + TYPE_1099 = :"1099" OTHER = :other finalize! @@ -217,7 +221,7 @@ module Type end end - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The deduction amount in cents. # @@ -247,7 +251,7 @@ class EmployeeDeduction < FinchAPI::BaseModel # Boolean indicating if the deduction is pre-tax. # # @return [Boolean, nil] - optional :pre_tax, FinchAPI::BooleanModel, nil?: true + optional :pre_tax, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute type # Type of benefit. @@ -265,9 +269,10 @@ class EmployeeDeduction < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, nil] @@ -282,16 +287,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -302,12 +308,12 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end - class EmployerContribution < FinchAPI::BaseModel + class EmployerContribution < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The contribution amount in cents. # @@ -348,9 +354,10 @@ class EmployerContribution < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::EmployerContribution#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, nil] @@ -366,16 +373,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -386,14 +394,16 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end # The payment method. + # + # @see FinchAPI::Models::HRIS::PayStatement#payment_method module PaymentMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECK = :check DIRECT_DEPOSIT = :direct_deposit @@ -405,7 +415,7 @@ module PaymentMethod # def self.values; end end - class Tax < FinchAPI::BaseModel + class Tax < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The tax amount in cents. # @@ -427,7 +437,7 @@ class Tax < FinchAPI::BaseModel # `true` if the amount is paid by the employers. # # @return [Boolean, nil] - optional :employer, FinchAPI::BooleanModel, nil?: true + optional :employer, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute name # The exact name of tax from the pay statement. @@ -451,9 +461,10 @@ class Tax < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::Tax#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, nil] @@ -468,16 +479,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::PayStatement::Tax::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -488,13 +500,15 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end # The type of taxes. + # + # @see FinchAPI::Models::HRIS::PayStatement::Tax#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum STATE = :state FEDERAL = :federal @@ -510,8 +524,10 @@ module Type end # The type of the payment associated with the pay statement. + # + # @see FinchAPI::Models::HRIS::PayStatement#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum REGULAR_PAYROLL = :regular_payroll OFF_CYCLE_PAYROLL = :off_cycle_payroll diff --git a/lib/finch-api/models/hris/pay_statement_response.rb b/lib/finch_api/models/hris/pay_statement_response.rb similarity index 83% rename from lib/finch-api/models/hris/pay_statement_response.rb rename to lib/finch_api/models/hris/pay_statement_response.rb index a060deba..07dfda54 100644 --- a/lib/finch-api/models/hris/pay_statement_response.rb +++ b/lib/finch_api/models/hris/pay_statement_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class PayStatementResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::PayStatements#retrieve_many + class PayStatementResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] body # # @return [FinchAPI::Models::HRIS::PayStatementResponseBody, nil] @@ -38,7 +39,7 @@ class PayStatementResponse < FinchAPI::BaseModel # # # def initialize(body: nil, code: nil, payment_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/pay_statement_response_body.rb b/lib/finch_api/models/hris/pay_statement_response_body.rb similarity index 77% rename from lib/finch-api/models/hris/pay_statement_response_body.rb rename to lib/finch_api/models/hris/pay_statement_response_body.rb index f5c57c91..70c2593e 100644 --- a/lib/finch-api/models/hris/pay_statement_response_body.rb +++ b/lib/finch_api/models/hris/pay_statement_response_body.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class PayStatementResponseBody < FinchAPI::BaseModel + class PayStatementResponseBody < FinchAPI::Internal::Type::BaseModel # @!attribute [r] paging # # @return [FinchAPI::Models::Paging, nil] @@ -17,7 +17,7 @@ class PayStatementResponseBody < FinchAPI::BaseModel # The array of pay statements for the current payment. # # @return [Array, nil] - optional :pay_statements, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement] } + optional :pay_statements, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::PayStatement] } # @!parse # # @return [Array] @@ -29,7 +29,7 @@ class PayStatementResponseBody < FinchAPI::BaseModel # # # def initialize(paging: nil, pay_statements: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb b/lib/finch_api/models/hris/pay_statement_retrieve_many_params.rb similarity index 71% rename from lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb rename to lib/finch_api/models/hris/pay_statement_retrieve_many_params.rb index 14b1d4e2..30d02261 100644 --- a/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb +++ b/lib/finch_api/models/hris/pay_statement_retrieve_many_params.rb @@ -3,17 +3,18 @@ module FinchAPI module Models module HRIS - class PayStatementRetrieveManyParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::PayStatements#retrieve_many + class PayStatementRetrieveManyParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute requests # The array of batch requests. # # @return [Array] required :requests, - -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] } # @!parse # # @param requests [Array] @@ -21,9 +22,9 @@ class PayStatementRetrieveManyParams < FinchAPI::BaseModel # # # def initialize(requests:, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel # @!attribute payment_id # A stable Finch `id` (UUID v4) for a payment. # @@ -57,7 +58,7 @@ class Request < FinchAPI::BaseModel # # # def initialize(payment_id:, limit: nil, offset: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/payment.rb b/lib/finch_api/models/hris/payment.rb similarity index 86% rename from lib/finch-api/models/hris/payment.rb rename to lib/finch_api/models/hris/payment.rb index c79bc869..126ab9d7 100644 --- a/lib/finch-api/models/hris/payment.rb +++ b/lib/finch_api/models/hris/payment.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class Payment < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Payments#list + class Payment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # The unique id for the payment. # @@ -43,7 +44,7 @@ class Payment < FinchAPI::BaseModel # Array of every individual on this payment. # # @return [Array, nil] - optional :individual_ids, FinchAPI::ArrayOf[String], nil?: true + optional :individual_ids, FinchAPI::Internal::Type::ArrayOf[String], nil?: true # @!attribute net_pay # @@ -60,14 +61,14 @@ class Payment < FinchAPI::BaseModel # # @return [Array, nil] optional :pay_frequencies, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::Payment::PayFrequency] }, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::Payment::PayFrequency] }, nil?: true # @!attribute pay_group_ids # Array of the Finch id (uuidv4) of every pay group associated with this payment. # # @return [Array, nil] - optional :pay_group_ids, FinchAPI::ArrayOf[String], nil?: true + optional :pay_group_ids, FinchAPI::Internal::Type::ArrayOf[String], nil?: true # @!attribute pay_period # The pay period object. @@ -107,10 +108,10 @@ class Payment < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ANNUALLY = :annually SEMI_ANNUALLY = :semi_annually @@ -129,7 +130,8 @@ module PayFrequency # def self.values; end end - class PayPeriod < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::Payment#pay_period + class PayPeriod < FinchAPI::Internal::Type::BaseModel # @!attribute end_date # # @return [String, nil] @@ -148,7 +150,7 @@ class PayPeriod < FinchAPI::BaseModel # # # def initialize(end_date: nil, start_date: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/payment_list_params.rb b/lib/finch_api/models/hris/payment_list_params.rb similarity index 71% rename from lib/finch-api/models/hris/payment_list_params.rb rename to lib/finch_api/models/hris/payment_list_params.rb index 8e5bce25..b7a1cb90 100644 --- a/lib/finch-api/models/hris/payment_list_params.rb +++ b/lib/finch_api/models/hris/payment_list_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module HRIS - class PaymentListParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Payments#list + class PaymentListParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute end_date # The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` @@ -29,7 +30,7 @@ class PaymentListParams < FinchAPI::BaseModel # # # def initialize(end_date:, start_date:, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/support_per_benefit_type.rb b/lib/finch_api/models/hris/support_per_benefit_type.rb similarity index 87% rename from lib/finch-api/models/hris/support_per_benefit_type.rb rename to lib/finch_api/models/hris/support_per_benefit_type.rb index e02307eb..8a1df902 100644 --- a/lib/finch-api/models/hris/support_per_benefit_type.rb +++ b/lib/finch_api/models/hris/support_per_benefit_type.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class SupportPerBenefitType < FinchAPI::BaseModel + class SupportPerBenefitType < FinchAPI::Internal::Type::BaseModel # @!attribute [r] company_benefits # # @return [FinchAPI::Models::OperationSupportMatrix, nil] @@ -28,7 +28,7 @@ class SupportPerBenefitType < FinchAPI::BaseModel # # # def initialize(company_benefits: nil, individual_benefits: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/supported_benefit.rb b/lib/finch_api/models/hris/supported_benefit.rb similarity index 79% rename from lib/finch-api/models/hris/supported_benefit.rb rename to lib/finch_api/models/hris/supported_benefit.rb index d8dfe58a..503a162b 100644 --- a/lib/finch-api/models/hris/supported_benefit.rb +++ b/lib/finch_api/models/hris/supported_benefit.rb @@ -3,19 +3,20 @@ module FinchAPI module Models module HRIS - class SupportedBenefit < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits#list_supported_benefits + class SupportedBenefit < FinchAPI::Internal::Type::BaseModel # @!attribute annual_maximum # Whether the provider supports an annual maximum for this benefit. # # @return [Boolean, nil] - optional :annual_maximum, FinchAPI::BooleanModel, nil?: true + optional :annual_maximum, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute catch_up # Whether the provider supports catch up for this benefit. This field will only be # true for retirement benefits. # # @return [Boolean, nil] - optional :catch_up, FinchAPI::BooleanModel, nil?: true + optional :catch_up, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute company_contribution # Supported contribution types. An empty array indicates contributions are not @@ -23,7 +24,7 @@ class SupportedBenefit < FinchAPI::BaseModel # # @return [Array, nil] optional :company_contribution, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution, nil?: true] }, nil?: true # @!attribute description @@ -37,7 +38,7 @@ class SupportedBenefit < FinchAPI::BaseModel # # @return [Array, nil] optional :employee_deduction, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true] }, nil?: true # @!attribute [r] frequencies @@ -45,7 +46,7 @@ class SupportedBenefit < FinchAPI::BaseModel # # @return [Array, nil] optional :frequencies, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true] } + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true] } # @!parse # # @return [Array] @@ -57,7 +58,7 @@ class SupportedBenefit < FinchAPI::BaseModel # # @return [Array, nil] optional :hsa_contribution_limit, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true] }, nil?: true # @!attribute type @@ -90,10 +91,10 @@ class SupportedBenefit < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module CompanyContribution - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent @@ -106,7 +107,7 @@ module CompanyContribution end module EmployeeDeduction - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED = :fixed PERCENT = :percent @@ -119,7 +120,7 @@ module EmployeeDeduction end module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL = :individual FAMILY = :family diff --git a/lib/finch-api/models/hris/update_company_benefit_response.rb b/lib/finch_api/models/hris/update_company_benefit_response.rb similarity index 57% rename from lib/finch-api/models/hris/update_company_benefit_response.rb rename to lib/finch_api/models/hris/update_company_benefit_response.rb index 76d54f79..75ee8a27 100644 --- a/lib/finch-api/models/hris/update_company_benefit_response.rb +++ b/lib/finch_api/models/hris/update_company_benefit_response.rb @@ -3,8 +3,10 @@ module FinchAPI module Models module HRIS - class UpdateCompanyBenefitResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::HRIS::Benefits#update + class UpdateCompanyBenefitResponse < FinchAPI::Internal::Type::BaseModel # @!attribute benefit_id + # The id of the benefit. # # @return [String] required :benefit_id, String @@ -14,7 +16,7 @@ class UpdateCompanyBenefitResponse < FinchAPI::BaseModel # # # def initialize(benefit_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/hris/w42005.rb b/lib/finch_api/models/hris/w42005.rb similarity index 87% rename from lib/finch-api/models/hris/w42005.rb rename to lib/finch_api/models/hris/w42005.rb index 8f0ac8b1..578294e3 100644 --- a/lib/finch-api/models/hris/w42005.rb +++ b/lib/finch_api/models/hris/w42005.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class W42005 < FinchAPI::BaseModel + class W42005 < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # Detailed information specific to the 2005 W4 form. # @@ -40,9 +40,10 @@ class W42005 < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, year: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::W42005#data + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute additional_withholding # Additional withholding amount (in cents). # @@ -101,11 +102,13 @@ class Data < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # Indicates exemption status from federal tax withholding. + # + # @see FinchAPI::Models::HRIS::W42005::Data#exemption module Exemption - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EXEMPT = :exempt NON_EXEMPT = :non_exempt @@ -118,8 +121,10 @@ module Exemption end # The individual's filing status for tax purposes. + # + # @see FinchAPI::Models::HRIS::W42005::Data#filing_status module FilingStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum MARRIED = :married MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = :married_but_withhold_at_higher_single_rate @@ -134,8 +139,10 @@ module FilingStatus end # Specifies the form type, indicating that this document is a 2005 W4 form. + # + # @see FinchAPI::Models::HRIS::W42005#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2005 = :w4_2005 diff --git a/lib/finch-api/models/hris/w42020.rb b/lib/finch_api/models/hris/w42020.rb similarity index 90% rename from lib/finch-api/models/hris/w42020.rb rename to lib/finch_api/models/hris/w42020.rb index 41751295..e49ee0ef 100644 --- a/lib/finch-api/models/hris/w42020.rb +++ b/lib/finch_api/models/hris/w42020.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class W42020 < FinchAPI::BaseModel + class W42020 < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # Detailed information specific to the 2020 W4 form. # @@ -40,9 +40,10 @@ class W42020 < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, year: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + # @see FinchAPI::Models::HRIS::W42020#data + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute amount_for_other_dependents # Amount claimed for dependents other than qualifying children under 17 (in # cents). @@ -122,11 +123,13 @@ class Data < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The individual's filing status for tax purposes. + # + # @see FinchAPI::Models::HRIS::W42020::Data#filing_status module FilingStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum HEAD_OF_HOUSEHOLD = :head_of_household MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE = @@ -142,8 +145,10 @@ module FilingStatus end # Specifies the form type, indicating that this document is a 2020 W4 form. + # + # @see FinchAPI::Models::HRIS::W42020#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2020 = :w4_2020 diff --git a/lib/finch-api/models/income.rb b/lib/finch_api/models/income.rb similarity index 89% rename from lib/finch-api/models/income.rb rename to lib/finch_api/models/income.rb index 647fc525..48b724de 100644 --- a/lib/finch-api/models/income.rb +++ b/lib/finch_api/models/income.rb @@ -2,7 +2,7 @@ module FinchAPI module Models - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The income amount in cents. # @@ -40,12 +40,14 @@ class Income < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, effective_date: nil, unit: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, # `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + # + # @see FinchAPI::Models::Income#unit module Unit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum YEARLY = :yearly QUARTERLY = :quarterly diff --git a/lib/finch-api/models/individual_event.rb b/lib/finch_api/models/individual_event.rb similarity index 86% rename from lib/finch-api/models/individual_event.rb rename to lib/finch_api/models/individual_event.rb index b164e814..e0519eb8 100644 --- a/lib/finch-api/models/individual_event.rb +++ b/lib/finch_api/models/individual_event.rb @@ -27,9 +27,9 @@ class IndividualEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individual_id # The ID of the individual related to the event. # @@ -45,11 +45,11 @@ class Data < FinchAPI::BaseModel # # # def initialize(individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL_CREATED = :"individual.created" INDIVIDUAL_UPDATED = :"individual.updated" diff --git a/lib/finch-api/models/introspection.rb b/lib/finch_api/models/introspection.rb similarity index 86% rename from lib/finch-api/models/introspection.rb rename to lib/finch_api/models/introspection.rb index 053ec767..88b5c051 100644 --- a/lib/finch-api/models/introspection.rb +++ b/lib/finch_api/models/introspection.rb @@ -2,7 +2,8 @@ module FinchAPI module Models - class Introspection < FinchAPI::BaseModel + # @see FinchAPI::Resources::Account#introspect + class Introspection < FinchAPI::Internal::Type::BaseModel # @!attribute account_id # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection # instead of this account ID. @@ -14,7 +15,7 @@ class Introspection < FinchAPI::BaseModel # # @return [Array] required :authentication_methods, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Introspection::AuthenticationMethod] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Introspection::AuthenticationMethod] } # @!attribute client_id # The client ID of the application associated with the `access_token`. @@ -82,7 +83,7 @@ class Introspection < FinchAPI::BaseModel # automated) # # @return [Boolean] - required :manual, FinchAPI::BooleanModel + required :manual, FinchAPI::Internal::Type::BooleanModel # @!attribute payroll_provider_id # [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll @@ -95,7 +96,7 @@ class Introspection < FinchAPI::BaseModel # An array of the authorized products associated with the `access_token`. # # @return [Array] - required :products, FinchAPI::ArrayOf[String] + required :products, FinchAPI::Internal::Type::ArrayOf[String] # @!attribute provider_id # The ID of the provider associated with the `access_token`. @@ -149,9 +150,9 @@ class Introspection < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel # @!attribute [r] connection_status # # @return [FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, nil] @@ -166,7 +167,7 @@ class AuthenticationMethod < FinchAPI::BaseModel # An array of the authorized products associated with the `access_token`. # # @return [Array, nil] - optional :products, FinchAPI::ArrayOf[String] + optional :products, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -189,9 +190,10 @@ class AuthenticationMethod < FinchAPI::BaseModel # # # def initialize(connection_status: nil, products: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class ConnectionStatus < FinchAPI::BaseModel + # @see FinchAPI::Models::Introspection::AuthenticationMethod#connection_status + class ConnectionStatus < FinchAPI::Internal::Type::BaseModel # @!attribute [r] message # # @return [String, nil] @@ -216,12 +218,14 @@ class ConnectionStatus < FinchAPI::BaseModel # # # def initialize(message: nil, status: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end # The type of authentication method. + # + # @see FinchAPI::Models::Introspection::AuthenticationMethod#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED = :assisted CREDENTIAL = :credential @@ -238,8 +242,10 @@ module Type end # The type of application associated with a token. + # + # @see FinchAPI::Models::Introspection#client_type module ClientType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PRODUCTION = :production DEVELOPMENT = :development @@ -252,7 +258,8 @@ module ClientType # def self.values; end end - class ConnectionStatus < FinchAPI::BaseModel + # @see FinchAPI::Models::Introspection#connection_status + class ConnectionStatus < FinchAPI::Internal::Type::BaseModel # @!attribute [r] last_successful_sync # The datetime when the connection was last successfully synced. # @@ -288,15 +295,17 @@ class ConnectionStatus < FinchAPI::BaseModel # # # def initialize(last_successful_sync: nil, message: nil, status: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end # The type of the connection associated with the token. # # - `provider` - connection to an external provider # - `finch` - finch-generated data. + # + # @see FinchAPI::Models::Introspection#connection_type module ConnectionType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PROVIDER = :provider FINCH = :finch diff --git a/lib/finch-api/models/job_completion_event.rb b/lib/finch_api/models/job_completion_event.rb similarity index 89% rename from lib/finch-api/models/job_completion_event.rb rename to lib/finch_api/models/job_completion_event.rb index 56ded516..c6bddc73 100644 --- a/lib/finch-api/models/job_completion_event.rb +++ b/lib/finch_api/models/job_completion_event.rb @@ -27,9 +27,9 @@ class JobCompletionEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute job_id # The id of the job which has completed. # @@ -48,11 +48,11 @@ class Data < FinchAPI::BaseModel # # # def initialize(job_id:, job_url:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum JOB_BENEFIT_CREATE_COMPLETED = :"job.benefit_create.completed" JOB_BENEFIT_ENROLL_COMPLETED = :"job.benefit_enroll.completed" diff --git a/lib/finch-api/models/jobs/automated_async_job.rb b/lib/finch_api/models/jobs/automated_async_job.rb similarity index 86% rename from lib/finch-api/models/jobs/automated_async_job.rb rename to lib/finch_api/models/jobs/automated_async_job.rb index 3392d908..b5d04f9f 100644 --- a/lib/finch-api/models/jobs/automated_async_job.rb +++ b/lib/finch_api/models/jobs/automated_async_job.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Jobs - class AutomatedAsyncJob < FinchAPI::BaseModel + # @see FinchAPI::Resources::Jobs::Automated#retrieve + class AutomatedAsyncJob < FinchAPI::Internal::Type::BaseModel # @!attribute completed_at # The datetime the job completed. # @@ -74,9 +75,10 @@ class AutomatedAsyncJob < FinchAPI::BaseModel # # # def initialize(completed_at:, created_at:, job_id:, job_url:, params:, scheduled_at:, started_at:, status:, type:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Params < FinchAPI::BaseModel + # @see FinchAPI::Models::Jobs::AutomatedAsyncJob#params + class Params < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individual_id # The ID of the individual that the job was completed for. # @@ -94,11 +96,12 @@ class Params < FinchAPI::BaseModel # # # def initialize(individual_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end + # @see FinchAPI::Models::Jobs::AutomatedAsyncJob#status module Status - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PENDING = :pending IN_PROGRESS = :in_progress @@ -115,8 +118,10 @@ module Status end # The type of automated job + # + # @see FinchAPI::Models::Jobs::AutomatedAsyncJob#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DATA_SYNC_ALL = :data_sync_all W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync diff --git a/lib/finch-api/models/jobs/automated_create_params.rb b/lib/finch_api/models/jobs/automated_create_params.rb similarity index 74% rename from lib/finch-api/models/jobs/automated_create_params.rb rename to lib/finch_api/models/jobs/automated_create_params.rb index e928f0f2..ef11fac9 100644 --- a/lib/finch-api/models/jobs/automated_create_params.rb +++ b/lib/finch_api/models/jobs/automated_create_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Jobs - class AutomatedCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Jobs::Automated#create + class AutomatedCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute type # The type of job to start. @@ -26,11 +27,11 @@ class AutomatedCreateParams < FinchAPI::BaseModel # # # def initialize(type:, params:, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of job to start. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync @@ -41,7 +42,7 @@ module Type # def self.values; end end - class Params < FinchAPI::BaseModel + class Params < FinchAPI::Internal::Type::BaseModel # @!attribute individual_id # The unique ID of the individual for W-4 data sync. # @@ -53,7 +54,7 @@ class Params < FinchAPI::BaseModel # # # def initialize(individual_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/jobs/automated_create_response.rb b/lib/finch_api/models/jobs/automated_create_response.rb similarity index 84% rename from lib/finch-api/models/jobs/automated_create_response.rb rename to lib/finch_api/models/jobs/automated_create_response.rb index 508b7f55..a3a2ef75 100644 --- a/lib/finch-api/models/jobs/automated_create_response.rb +++ b/lib/finch_api/models/jobs/automated_create_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Jobs - class AutomatedCreateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Jobs::Automated#create + class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute allowed_refreshes # The number of allowed refreshes per hour (per hour, fixed window) # @@ -36,7 +37,7 @@ class AutomatedCreateResponse < FinchAPI::BaseModel # # # def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/jobs/automated_list_params.rb b/lib/finch_api/models/jobs/automated_list_params.rb similarity index 72% rename from lib/finch-api/models/jobs/automated_list_params.rb rename to lib/finch_api/models/jobs/automated_list_params.rb index 84e6123e..b4335ddc 100644 --- a/lib/finch-api/models/jobs/automated_list_params.rb +++ b/lib/finch_api/models/jobs/automated_list_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Jobs - class AutomatedListParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Jobs::Automated#list + class AutomatedListParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] limit # Number of items to return @@ -35,7 +36,7 @@ class AutomatedListParams < FinchAPI::BaseModel # # # def initialize(limit: nil, offset: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/jobs/automated_list_response.rb b/lib/finch_api/models/jobs/automated_list_response.rb similarity index 77% rename from lib/finch-api/models/jobs/automated_list_response.rb rename to lib/finch_api/models/jobs/automated_list_response.rb index bdbd0998..29b249f2 100644 --- a/lib/finch-api/models/jobs/automated_list_response.rb +++ b/lib/finch_api/models/jobs/automated_list_response.rb @@ -3,11 +3,12 @@ module FinchAPI module Models module Jobs - class AutomatedListResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Jobs::Automated#list + class AutomatedListResponse < FinchAPI::Internal::Type::BaseModel # @!attribute data # # @return [Array] - required :data, -> { FinchAPI::ArrayOf[FinchAPI::Models::Jobs::AutomatedAsyncJob] } + required :data, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Jobs::AutomatedAsyncJob] } # @!attribute meta # @@ -20,9 +21,10 @@ class AutomatedListResponse < FinchAPI::BaseModel # # # def initialize(data:, meta:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Meta < FinchAPI::BaseModel + # @see FinchAPI::Models::Jobs::AutomatedListResponse#meta + class Meta < FinchAPI::Internal::Type::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 @@ -41,9 +43,10 @@ class Meta < FinchAPI::BaseModel # # # def initialize(quotas: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Quotas < FinchAPI::BaseModel + # @see FinchAPI::Models::Jobs::AutomatedListResponse::Meta#quotas + class Quotas < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data_sync_all # # @return [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, nil] @@ -63,9 +66,10 @@ class Quotas < FinchAPI::BaseModel # # # def initialize(data_sync_all: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class DataSyncAll < FinchAPI::BaseModel + # @see FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas#data_sync_all + class DataSyncAll < FinchAPI::Internal::Type::BaseModel # @!attribute [r] allowed_refreshes # # @return [Integer, nil] @@ -90,7 +94,7 @@ class DataSyncAll < FinchAPI::BaseModel # # # def initialize(allowed_refreshes: nil, remaining_refreshes: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch_api/models/jobs/automated_retrieve_params.rb b/lib/finch_api/models/jobs/automated_retrieve_params.rb new file mode 100644 index 00000000..d6b1cfdb --- /dev/null +++ b/lib/finch_api/models/jobs/automated_retrieve_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + # @see FinchAPI::Resources::Jobs::Automated#retrieve + class AutomatedRetrieveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/jobs/manual_async_job.rb b/lib/finch_api/models/jobs/manual_async_job.rb similarity index 73% rename from lib/finch-api/models/jobs/manual_async_job.rb rename to lib/finch_api/models/jobs/manual_async_job.rb index 68508894..4d0c0109 100644 --- a/lib/finch-api/models/jobs/manual_async_job.rb +++ b/lib/finch_api/models/jobs/manual_async_job.rb @@ -3,12 +3,13 @@ module FinchAPI module Models module Jobs - class ManualAsyncJob < FinchAPI::BaseModel + # @see FinchAPI::Resources::Jobs::Manual#retrieve + class ManualAsyncJob < FinchAPI::Internal::Type::BaseModel # @!attribute body # Specific information about the job, such as individual statuses for batch jobs. # # @return [Array, nil] - required :body, FinchAPI::ArrayOf[FinchAPI::Unknown], nil?: true + required :body, FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown], nil?: true # @!attribute job_id # @@ -27,10 +28,11 @@ class ManualAsyncJob < FinchAPI::BaseModel # # # def initialize(body:, job_id:, status:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Jobs::ManualAsyncJob#status module Status - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PENDING = :pending IN_PROGRESS = :in_progress diff --git a/lib/finch_api/models/jobs/manual_retrieve_params.rb b/lib/finch_api/models/jobs/manual_retrieve_params.rb new file mode 100644 index 00000000..07b0e2e2 --- /dev/null +++ b/lib/finch_api/models/jobs/manual_retrieve_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + # @see FinchAPI::Resources::Jobs::Manual#retrieve + class ManualRetrieveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/location.rb b/lib/finch_api/models/location.rb similarity index 93% rename from lib/finch-api/models/location.rb rename to lib/finch_api/models/location.rb index 5fe8f107..ad306bda 100644 --- a/lib/finch-api/models/location.rb +++ b/lib/finch_api/models/location.rb @@ -2,7 +2,7 @@ module FinchAPI module Models - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel # @!attribute city # City, district, suburb, town, or village. # @@ -73,7 +73,7 @@ class Location < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/money.rb b/lib/finch_api/models/money.rb similarity index 81% rename from lib/finch-api/models/money.rb rename to lib/finch_api/models/money.rb index bd1f254e..10ca8165 100644 --- a/lib/finch-api/models/money.rb +++ b/lib/finch_api/models/money.rb @@ -2,7 +2,7 @@ module FinchAPI module Models - class Money < FinchAPI::BaseModel + class Money < FinchAPI::Internal::Type::BaseModel # @!attribute amount # Amount for money object (in cents) # @@ -24,7 +24,7 @@ class Money < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/operation_support.rb b/lib/finch_api/models/operation_support.rb similarity index 95% rename from lib/finch-api/models/operation_support.rb rename to lib/finch_api/models/operation_support.rb index 68cd639d..0e3e6740 100644 --- a/lib/finch-api/models/operation_support.rb +++ b/lib/finch_api/models/operation_support.rb @@ -10,7 +10,7 @@ module Models # - `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 + extend FinchAPI::Internal::Type::Enum SUPPORTED = :supported NOT_SUPPORTED_BY_FINCH = :not_supported_by_finch diff --git a/lib/finch-api/models/operation_support_matrix.rb b/lib/finch_api/models/operation_support_matrix.rb similarity index 96% rename from lib/finch-api/models/operation_support_matrix.rb rename to lib/finch_api/models/operation_support_matrix.rb index 3a41278d..6fc1233e 100644 --- a/lib/finch-api/models/operation_support_matrix.rb +++ b/lib/finch_api/models/operation_support_matrix.rb @@ -2,7 +2,7 @@ module FinchAPI module Models - class OperationSupportMatrix < FinchAPI::BaseModel + class OperationSupportMatrix < FinchAPI::Internal::Type::BaseModel # @!attribute [r] create # - `supported`: This operation is supported by both the provider and Finch # - `not_supported_by_finch`: This operation is not supported by Finch but @@ -75,7 +75,7 @@ class OperationSupportMatrix < FinchAPI::BaseModel # # # def initialize(create: nil, delete: nil, read: nil, update: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/paging.rb b/lib/finch_api/models/paging.rb similarity index 85% rename from lib/finch-api/models/paging.rb rename to lib/finch_api/models/paging.rb index c540e2c9..527bdf67 100644 --- a/lib/finch-api/models/paging.rb +++ b/lib/finch_api/models/paging.rb @@ -2,7 +2,7 @@ module FinchAPI module Models - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel # @!attribute [r] count # The total number of elements for the entire query (not just the given page) # @@ -29,7 +29,7 @@ class Paging < FinchAPI::BaseModel # # # def initialize(count: nil, offset: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/pay_statement_event.rb b/lib/finch_api/models/pay_statement_event.rb similarity index 89% rename from lib/finch-api/models/pay_statement_event.rb rename to lib/finch_api/models/pay_statement_event.rb index 5bb1870d..6f36fd6a 100644 --- a/lib/finch-api/models/pay_statement_event.rb +++ b/lib/finch_api/models/pay_statement_event.rb @@ -27,9 +27,9 @@ class PayStatementEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individual_id # The ID of the individual associated with the pay statement. # @@ -56,11 +56,11 @@ class Data < FinchAPI::BaseModel # # # def initialize(individual_id: nil, payment_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PAY_STATEMENT_CREATED = :"pay_statement.created" PAY_STATEMENT_UPDATED = :"pay_statement.updated" diff --git a/lib/finch-api/models/payment_event.rb b/lib/finch_api/models/payment_event.rb similarity index 87% rename from lib/finch-api/models/payment_event.rb rename to lib/finch_api/models/payment_event.rb index 77738eec..6b0b35f9 100644 --- a/lib/finch-api/models/payment_event.rb +++ b/lib/finch_api/models/payment_event.rb @@ -27,9 +27,9 @@ class PaymentEvent < FinchAPI::Models::BaseWebhookEvent # # # def initialize(data: nil, event_type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # @!attribute pay_date # The date of the payment. # @@ -48,11 +48,11 @@ class Data < FinchAPI::BaseModel # # # def initialize(pay_date:, payment_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PAYMENT_CREATED = :"payment.created" PAYMENT_UPDATED = :"payment.updated" diff --git a/lib/finch-api/models/payroll/pay_group_list_params.rb b/lib/finch_api/models/payroll/pay_group_list_params.rb similarity index 67% rename from lib/finch-api/models/payroll/pay_group_list_params.rb rename to lib/finch_api/models/payroll/pay_group_list_params.rb index b369ebd9..cb24de50 100644 --- a/lib/finch-api/models/payroll/pay_group_list_params.rb +++ b/lib/finch_api/models/payroll/pay_group_list_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Payroll - class PayGroupListParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Payroll::PayGroups#list + class PayGroupListParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] individual_id # @@ -20,7 +21,7 @@ class PayGroupListParams < FinchAPI::BaseModel # @!attribute [r] pay_frequencies # # @return [Array, nil] - optional :pay_frequencies, FinchAPI::ArrayOf[String] + optional :pay_frequencies, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -33,7 +34,7 @@ class PayGroupListParams < FinchAPI::BaseModel # # # def initialize(individual_id: nil, pay_frequencies: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 81% rename from lib/finch-api/models/payroll/pay_group_list_response.rb rename to lib/finch_api/models/payroll/pay_group_list_response.rb index 7ae9e6f4..d679a575 100644 --- a/lib/finch-api/models/payroll/pay_group_list_response.rb +++ b/lib/finch_api/models/payroll/pay_group_list_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Payroll - class PayGroupListResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Payroll::PayGroups#list + class PayGroupListResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # Finch id (uuidv4) for the pay group # @@ -29,7 +30,7 @@ class PayGroupListResponse < FinchAPI::BaseModel # # @return [Array, nil] optional :pay_frequencies, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency] } + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency] } # @!parse # # @return [Array] @@ -42,10 +43,10 @@ class PayGroupListResponse < FinchAPI::BaseModel # # # def initialize(id: nil, name: nil, pay_frequencies: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ANNUALLY = :annually SEMI_ANNUALLY = :semi_annually diff --git a/lib/finch_api/models/payroll/pay_group_retrieve_params.rb b/lib/finch_api/models/payroll/pay_group_retrieve_params.rb new file mode 100644 index 00000000..692f7a43 --- /dev/null +++ b/lib/finch_api/models/payroll/pay_group_retrieve_params.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Payroll + # @see FinchAPI::Resources::Payroll::PayGroups#retrieve + class PayGroupRetrieveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/payroll/pay_group_retrieve_response.rb b/lib/finch_api/models/payroll/pay_group_retrieve_response.rb similarity index 76% rename from lib/finch-api/models/payroll/pay_group_retrieve_response.rb rename to lib/finch_api/models/payroll/pay_group_retrieve_response.rb index f621e67c..9362bb71 100644 --- a/lib/finch-api/models/payroll/pay_group_retrieve_response.rb +++ b/lib/finch_api/models/payroll/pay_group_retrieve_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Payroll - class PayGroupRetrieveResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Payroll::PayGroups#retrieve + class PayGroupRetrieveResponse < FinchAPI::Internal::Type::BaseModel # @!attribute id # Finch id (uuidv4) for the pay group # @@ -13,7 +14,7 @@ class PayGroupRetrieveResponse < FinchAPI::BaseModel # @!attribute individual_ids # # @return [Array] - required :individual_ids, FinchAPI::ArrayOf[String] + required :individual_ids, FinchAPI::Internal::Type::ArrayOf[String] # @!attribute name # Name of the pay group @@ -26,7 +27,7 @@ class PayGroupRetrieveResponse < FinchAPI::BaseModel # # @return [Array] required :pay_frequencies, - -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency] } + -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency] } # @!parse # # @param id [String] @@ -36,10 +37,10 @@ class PayGroupRetrieveResponse < FinchAPI::BaseModel # # # def initialize(id:, individual_ids:, name:, pay_frequencies:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ANNUALLY = :annually SEMI_ANNUALLY = :semi_annually diff --git a/lib/finch-api/models/provider.rb b/lib/finch_api/models/provider.rb similarity index 77% rename from lib/finch-api/models/provider.rb rename to lib/finch_api/models/provider.rb index 19c63704..f5804ccb 100644 --- a/lib/finch-api/models/provider.rb +++ b/lib/finch_api/models/provider.rb @@ -2,7 +2,8 @@ module FinchAPI module Models - class Provider < FinchAPI::BaseModel + # @see FinchAPI::Resources::Providers#list + class Provider < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # The id of the payroll provider used in Connect. # @@ -18,7 +19,7 @@ class Provider < FinchAPI::BaseModel # # @return [Array, nil] optional :authentication_methods, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Provider::AuthenticationMethod] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Provider::AuthenticationMethod] } # @!parse # # @return [Array] @@ -28,7 +29,7 @@ class Provider < FinchAPI::BaseModel # `true` if the integration is in a beta state, `false` otherwise # # @return [Boolean, nil] - optional :beta, FinchAPI::BooleanModel + optional :beta, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -70,7 +71,7 @@ class Provider < FinchAPI::BaseModel # of `assisted` in the `authentication_methods` field instead. # # @return [Boolean, nil] - optional :manual, FinchAPI::BooleanModel + optional :manual, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -80,7 +81,7 @@ class Provider < FinchAPI::BaseModel # whether MFA is required for the provider. # # @return [Boolean, nil] - optional :mfa_required, FinchAPI::BooleanModel + optional :mfa_required, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -100,7 +101,7 @@ class Provider < FinchAPI::BaseModel # The list of Finch products supported on this payroll provider. # # @return [Array, nil] - optional :products, FinchAPI::ArrayOf[String] + optional :products, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -134,9 +135,9 @@ class Provider < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel # @!attribute benefits_support # Each benefit type and their supported features. If the benefit type is not # supported, the property will be null @@ -169,9 +170,10 @@ class AuthenticationMethod < FinchAPI::BaseModel # # # def initialize(benefits_support: nil, supported_fields: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class SupportedFields < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod#supported_fields + class SupportedFields < FinchAPI::Internal::Type::BaseModel # @!attribute [r] company # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, nil] @@ -260,13 +262,14 @@ class SupportedFields < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Company < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#company + class Company < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -295,7 +298,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] ein # # @return [Boolean, nil] - optional :ein, FinchAPI::BooleanModel + optional :ein, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -314,7 +317,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] legal_name # # @return [Boolean, nil] - optional :legal_name, FinchAPI::BooleanModel + optional :legal_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -333,7 +336,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] primary_email # # @return [Boolean, nil] - optional :primary_email, FinchAPI::BooleanModel + optional :primary_email, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -342,7 +345,7 @@ class Company < FinchAPI::BaseModel # @!attribute [r] primary_phone_number # # @return [Boolean, nil] - optional :primary_phone_number, FinchAPI::BooleanModel + optional :primary_phone_number, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -374,13 +377,14 @@ class Company < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Accounts < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company#accounts + class Accounts < FinchAPI::Internal::Type::BaseModel # @!attribute [r] account_name # # @return [Boolean, nil] - optional :account_name, FinchAPI::BooleanModel + optional :account_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -389,7 +393,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] account_number # # @return [Boolean, nil] - optional :account_number, FinchAPI::BooleanModel + optional :account_number, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -398,7 +402,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] account_type # # @return [Boolean, nil] - optional :account_type, FinchAPI::BooleanModel + optional :account_type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -407,7 +411,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] institution_name # # @return [Boolean, nil] - optional :institution_name, FinchAPI::BooleanModel + optional :institution_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -416,7 +420,7 @@ class Accounts < FinchAPI::BaseModel # @!attribute [r] routing_number # # @return [Boolean, nil] - optional :routing_number, FinchAPI::BooleanModel + optional :routing_number, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -431,14 +435,15 @@ class Accounts < FinchAPI::BaseModel # # # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Departments < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company#departments + class Departments < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -460,13 +465,14 @@ class Departments < FinchAPI::BaseModel # # # def initialize(name: nil, parent: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Parent < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments#parent + class Parent < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -477,15 +483,16 @@ class Parent < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Entity < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company#entity + class Entity < FinchAPI::Internal::Type::BaseModel # @!attribute [r] subtype # # @return [Boolean, nil] - optional :subtype, FinchAPI::BooleanModel + optional :subtype, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -494,7 +501,7 @@ class Entity < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -506,14 +513,15 @@ class Entity < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Locations < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company#locations + class Locations < FinchAPI::Internal::Type::BaseModel # @!attribute [r] city # # @return [Boolean, nil] - optional :city, FinchAPI::BooleanModel + optional :city, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -522,7 +530,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] country # # @return [Boolean, nil] - optional :country, FinchAPI::BooleanModel + optional :country, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -531,7 +539,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] line1 # # @return [Boolean, nil] - optional :line1, FinchAPI::BooleanModel + optional :line1, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -540,7 +548,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] line2 # # @return [Boolean, nil] - optional :line2, FinchAPI::BooleanModel + optional :line2, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -549,7 +557,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] postal_code # # @return [Boolean, nil] - optional :postal_code, FinchAPI::BooleanModel + optional :postal_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -558,7 +566,7 @@ class Locations < FinchAPI::BaseModel # @!attribute [r] state # # @return [Boolean, nil] - optional :state, FinchAPI::BooleanModel + optional :state, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -574,11 +582,12 @@ class Locations < FinchAPI::BaseModel # # # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Directory < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#directory + class Directory < FinchAPI::Internal::Type::BaseModel # @!attribute [r] individuals # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, nil] @@ -605,13 +614,14 @@ class Directory < FinchAPI::BaseModel # # # def initialize(individuals: nil, paging: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Individuals < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory#individuals + class Individuals < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -620,7 +630,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] department # # @return [Boolean, nil] - optional :department, FinchAPI::BooleanModel + optional :department, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -629,7 +639,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] first_name # # @return [Boolean, nil] - optional :first_name, FinchAPI::BooleanModel + optional :first_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -638,7 +648,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] is_active # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel + optional :is_active, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -647,7 +657,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] last_name # # @return [Boolean, nil] - optional :last_name, FinchAPI::BooleanModel + optional :last_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -666,7 +676,7 @@ class Individuals < FinchAPI::BaseModel # @!attribute [r] middle_name # # @return [Boolean, nil] - optional :middle_name, FinchAPI::BooleanModel + optional :middle_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -694,13 +704,14 @@ class Individuals < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -711,15 +722,16 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Paging < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory#paging + class Paging < FinchAPI::Internal::Type::BaseModel # @!attribute [r] count # # @return [Boolean, nil] - optional :count, FinchAPI::BooleanModel + optional :count, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -728,7 +740,7 @@ class Paging < FinchAPI::BaseModel # @!attribute [r] offset # # @return [Boolean, nil] - optional :offset, FinchAPI::BooleanModel + optional :offset, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -740,15 +752,16 @@ class Paging < FinchAPI::BaseModel # # # def initialize(count: nil, offset: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -757,7 +770,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] class_code # # @return [Boolean, nil] - optional :class_code, FinchAPI::BooleanModel + optional :class_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -766,7 +779,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] custom_fields # # @return [Boolean, nil] - optional :custom_fields, FinchAPI::BooleanModel + optional :custom_fields, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -795,7 +808,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] employment_status # # @return [Boolean, nil] - optional :employment_status, FinchAPI::BooleanModel + optional :employment_status, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -804,7 +817,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] end_date # # @return [Boolean, nil] - optional :end_date, FinchAPI::BooleanModel + optional :end_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -813,7 +826,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] first_name # # @return [Boolean, nil] - optional :first_name, FinchAPI::BooleanModel + optional :first_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -832,7 +845,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] income_history # # @return [Boolean, nil] - optional :income_history, FinchAPI::BooleanModel + optional :income_history, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -841,7 +854,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] is_active # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel + optional :is_active, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -850,7 +863,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] last_name # # @return [Boolean, nil] - optional :last_name, FinchAPI::BooleanModel + optional :last_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -879,7 +892,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] middle_name # # @return [Boolean, nil] - optional :middle_name, FinchAPI::BooleanModel + optional :middle_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -888,7 +901,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] start_date # # @return [Boolean, nil] - optional :start_date, FinchAPI::BooleanModel + optional :start_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -897,7 +910,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] title # # @return [Boolean, nil] - optional :title, FinchAPI::BooleanModel + optional :title, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -945,13 +958,14 @@ class Employment < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Department < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment#department + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -962,14 +976,15 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] subtype # # @return [Boolean, nil] - optional :subtype, FinchAPI::BooleanModel + optional :subtype, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -978,7 +993,7 @@ class Employment < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -990,14 +1005,15 @@ class Employment < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Income < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment#income + class Income < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1006,7 +1022,7 @@ class Income < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1015,7 +1031,7 @@ class Income < FinchAPI::BaseModel # @!attribute [r] unit # # @return [Boolean, nil] - optional :unit, FinchAPI::BooleanModel + optional :unit, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1028,14 +1044,15 @@ class Income < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, unit: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Location < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment#location + class Location < FinchAPI::Internal::Type::BaseModel # @!attribute [r] city # # @return [Boolean, nil] - optional :city, FinchAPI::BooleanModel + optional :city, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1044,7 +1061,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] country # # @return [Boolean, nil] - optional :country, FinchAPI::BooleanModel + optional :country, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1053,7 +1070,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] line1 # # @return [Boolean, nil] - optional :line1, FinchAPI::BooleanModel + optional :line1, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1062,7 +1079,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] line2 # # @return [Boolean, nil] - optional :line2, FinchAPI::BooleanModel + optional :line2, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1071,7 +1088,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] postal_code # # @return [Boolean, nil] - optional :postal_code, FinchAPI::BooleanModel + optional :postal_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1080,7 +1097,7 @@ class Location < FinchAPI::BaseModel # @!attribute [r] state # # @return [Boolean, nil] - optional :state, FinchAPI::BooleanModel + optional :state, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1096,14 +1113,15 @@ class Location < FinchAPI::BaseModel # # # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1114,15 +1132,16 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Individual < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#individual + class Individual < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1131,7 +1150,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] dob # # @return [Boolean, nil] - optional :dob, FinchAPI::BooleanModel + optional :dob, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1150,7 +1169,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] encrypted_ssn # # @return [Boolean, nil] - optional :encrypted_ssn, FinchAPI::BooleanModel + optional :encrypted_ssn, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1159,7 +1178,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] ethnicity # # @return [Boolean, nil] - optional :ethnicity, FinchAPI::BooleanModel + optional :ethnicity, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1168,7 +1187,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] first_name # # @return [Boolean, nil] - optional :first_name, FinchAPI::BooleanModel + optional :first_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1177,7 +1196,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] gender # # @return [Boolean, nil] - optional :gender, FinchAPI::BooleanModel + optional :gender, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1186,7 +1205,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] last_name # # @return [Boolean, nil] - optional :last_name, FinchAPI::BooleanModel + optional :last_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1195,7 +1214,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] middle_name # # @return [Boolean, nil] - optional :middle_name, FinchAPI::BooleanModel + optional :middle_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1214,7 +1233,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] preferred_name # # @return [Boolean, nil] - optional :preferred_name, FinchAPI::BooleanModel + optional :preferred_name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1233,7 +1252,7 @@ class Individual < FinchAPI::BaseModel # @!attribute [r] ssn # # @return [Boolean, nil] - optional :ssn, FinchAPI::BooleanModel + optional :ssn, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1273,13 +1292,14 @@ class Individual < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Emails < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual#emails + class Emails < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [Boolean, nil] - optional :data, FinchAPI::BooleanModel + optional :data, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1288,7 +1308,7 @@ class Emails < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1300,14 +1320,15 @@ class Emails < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PhoneNumbers < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual#phone_numbers + class PhoneNumbers < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [Boolean, nil] - optional :data, FinchAPI::BooleanModel + optional :data, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1316,7 +1337,7 @@ class PhoneNumbers < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1328,14 +1349,15 @@ class PhoneNumbers < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Residence < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual#residence + class Residence < FinchAPI::Internal::Type::BaseModel # @!attribute [r] city # # @return [Boolean, nil] - optional :city, FinchAPI::BooleanModel + optional :city, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1344,7 +1366,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] country # # @return [Boolean, nil] - optional :country, FinchAPI::BooleanModel + optional :country, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1353,7 +1375,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] line1 # # @return [Boolean, nil] - optional :line1, FinchAPI::BooleanModel + optional :line1, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1362,7 +1384,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] line2 # # @return [Boolean, nil] - optional :line2, FinchAPI::BooleanModel + optional :line2, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1371,7 +1393,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] postal_code # # @return [Boolean, nil] - optional :postal_code, FinchAPI::BooleanModel + optional :postal_code, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1380,7 +1402,7 @@ class Residence < FinchAPI::BaseModel # @!attribute [r] state # # @return [Boolean, nil] - optional :state, FinchAPI::BooleanModel + optional :state, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1396,15 +1418,16 @@ class Residence < FinchAPI::BaseModel # # # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class PayGroup < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#pay_group + class PayGroup < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1413,7 +1436,7 @@ class PayGroup < FinchAPI::BaseModel # @!attribute [r] individual_ids # # @return [Boolean, nil] - optional :individual_ids, FinchAPI::BooleanModel + optional :individual_ids, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1422,7 +1445,7 @@ class PayGroup < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1431,7 +1454,7 @@ class PayGroup < FinchAPI::BaseModel # @!attribute [r] pay_frequencies # # @return [Boolean, nil] - optional :pay_frequencies, FinchAPI::BooleanModel + optional :pay_frequencies, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1445,10 +1468,11 @@ class PayGroup < FinchAPI::BaseModel # # # def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PayStatement < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#pay_statement + class PayStatement < FinchAPI::Internal::Type::BaseModel # @!attribute [r] paging # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, nil] @@ -1475,18 +1499,19 @@ class PayStatement < FinchAPI::BaseModel # # # def initialize(paging: nil, pay_statements: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Paging < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement#paging + class Paging < FinchAPI::Internal::Type::BaseModel # @!attribute count # # @return [Boolean] - required :count, FinchAPI::BooleanModel + required :count, FinchAPI::Internal::Type::BooleanModel # @!attribute offset # # @return [Boolean] - required :offset, FinchAPI::BooleanModel + required :offset, FinchAPI::Internal::Type::BooleanModel # @!parse # # @param count [Boolean] @@ -1494,10 +1519,11 @@ class Paging < FinchAPI::BaseModel # # # def initialize(count:, offset:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PayStatements < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement#pay_statements + class PayStatements < FinchAPI::Internal::Type::BaseModel # @!attribute [r] earnings # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, nil] @@ -1531,7 +1557,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] gross_pay # # @return [Boolean, nil] - optional :gross_pay, FinchAPI::BooleanModel + optional :gross_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1540,7 +1566,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] individual_id # # @return [Boolean, nil] - optional :individual_id, FinchAPI::BooleanModel + optional :individual_id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1549,7 +1575,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] net_pay # # @return [Boolean, nil] - optional :net_pay, FinchAPI::BooleanModel + optional :net_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1558,7 +1584,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] payment_method # # @return [Boolean, nil] - optional :payment_method, FinchAPI::BooleanModel + optional :payment_method, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1577,7 +1603,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] total_hours # # @return [Boolean, nil] - optional :total_hours, FinchAPI::BooleanModel + optional :total_hours, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1586,7 +1612,7 @@ class PayStatements < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1620,13 +1646,14 @@ class PayStatements < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Earnings < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#earnings + class Earnings < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1635,7 +1662,7 @@ class Earnings < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1644,7 +1671,7 @@ class Earnings < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1653,7 +1680,7 @@ class Earnings < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1667,14 +1694,15 @@ class Earnings < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class EmployeeDeductions < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#employee_deductions + class EmployeeDeductions < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1683,7 +1711,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1692,7 +1720,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1701,7 +1729,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] pre_tax # # @return [Boolean, nil] - optional :pre_tax, FinchAPI::BooleanModel + optional :pre_tax, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1710,7 +1738,7 @@ class EmployeeDeductions < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1725,14 +1753,15 @@ class EmployeeDeductions < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class EmployerContributions < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#employer_contributions + class EmployerContributions < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1741,7 +1770,7 @@ class EmployerContributions < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1750,7 +1779,7 @@ class EmployerContributions < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1763,14 +1792,15 @@ class EmployerContributions < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Taxes < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements#taxes + class Taxes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] amount # # @return [Boolean, nil] - optional :amount, FinchAPI::BooleanModel + optional :amount, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1779,7 +1809,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] currency # # @return [Boolean, nil] - optional :currency, FinchAPI::BooleanModel + optional :currency, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1788,7 +1818,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] employer # # @return [Boolean, nil] - optional :employer, FinchAPI::BooleanModel + optional :employer, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1797,7 +1827,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] name # # @return [Boolean, nil] - optional :name, FinchAPI::BooleanModel + optional :name, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1806,7 +1836,7 @@ class Taxes < FinchAPI::BaseModel # @!attribute [r] type # # @return [Boolean, nil] - optional :type, FinchAPI::BooleanModel + optional :type, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1821,16 +1851,17 @@ class Taxes < FinchAPI::BaseModel # # # def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end - class Payment < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields#payment + class Payment < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # # @return [Boolean, nil] - optional :id, FinchAPI::BooleanModel + optional :id, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1839,7 +1870,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] company_debit # # @return [Boolean, nil] - optional :company_debit, FinchAPI::BooleanModel + optional :company_debit, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1848,7 +1879,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] debit_date # # @return [Boolean, nil] - optional :debit_date, FinchAPI::BooleanModel + optional :debit_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1857,7 +1888,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] employee_taxes # # @return [Boolean, nil] - optional :employee_taxes, FinchAPI::BooleanModel + optional :employee_taxes, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1866,7 +1897,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] employer_taxes # # @return [Boolean, nil] - optional :employer_taxes, FinchAPI::BooleanModel + optional :employer_taxes, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1875,7 +1906,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] gross_pay # # @return [Boolean, nil] - optional :gross_pay, FinchAPI::BooleanModel + optional :gross_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1884,7 +1915,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] individual_ids # # @return [Boolean, nil] - optional :individual_ids, FinchAPI::BooleanModel + optional :individual_ids, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1893,7 +1924,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] net_pay # # @return [Boolean, nil] - optional :net_pay, FinchAPI::BooleanModel + optional :net_pay, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1902,7 +1933,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] pay_date # # @return [Boolean, nil] - optional :pay_date, FinchAPI::BooleanModel + optional :pay_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1911,7 +1942,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] pay_frequencies # # @return [Boolean, nil] - optional :pay_frequencies, FinchAPI::BooleanModel + optional :pay_frequencies, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1920,7 +1951,7 @@ class Payment < FinchAPI::BaseModel # @!attribute [r] pay_group_ids # # @return [Boolean, nil] - optional :pay_group_ids, FinchAPI::BooleanModel + optional :pay_group_ids, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1968,13 +1999,14 @@ class Payment < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class PayPeriod < FinchAPI::BaseModel + # @see FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment#pay_period + class PayPeriod < FinchAPI::Internal::Type::BaseModel # @!attribute [r] end_date # # @return [Boolean, nil] - optional :end_date, FinchAPI::BooleanModel + optional :end_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1983,7 +2015,7 @@ class PayPeriod < FinchAPI::BaseModel # @!attribute [r] start_date # # @return [Boolean, nil] - optional :start_date, FinchAPI::BooleanModel + optional :start_date, FinchAPI::Internal::Type::BooleanModel # @!parse # # @return [Boolean] @@ -1995,14 +2027,16 @@ class PayPeriod < FinchAPI::BaseModel # # # def initialize(end_date: nil, start_date: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end # The type of authentication method. + # + # @see FinchAPI::Models::Provider::AuthenticationMethod#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED = :assisted CREDENTIAL = :credential diff --git a/lib/finch_api/models/provider_list_params.rb b/lib/finch_api/models/provider_list_params.rb new file mode 100644 index 00000000..24968b19 --- /dev/null +++ b/lib/finch_api/models/provider_list_params.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + # @see FinchAPI::Resources::Providers#list + class ProviderListParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/request_forwarding_forward_params.rb b/lib/finch_api/models/request_forwarding_forward_params.rb similarity index 78% rename from lib/finch-api/models/request_forwarding_forward_params.rb rename to lib/finch_api/models/request_forwarding_forward_params.rb index 55f13b68..9329ddcb 100644 --- a/lib/finch-api/models/request_forwarding_forward_params.rb +++ b/lib/finch_api/models/request_forwarding_forward_params.rb @@ -2,10 +2,11 @@ module FinchAPI module Models - class RequestForwardingForwardParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::RequestForwarding#forward + class RequestForwardingForwardParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute method_ # The HTTP method for the forwarded request. Valid values include: `GET` , `POST` @@ -35,14 +36,14 @@ class RequestForwardingForwardParams < FinchAPI::BaseModel # `{"Content-Type": "application/xml", "X-API-Version": "v1" }` # # @return [Object, nil] - optional :headers, FinchAPI::Unknown, nil?: true + optional :headers, FinchAPI::Internal::Type::Unknown, nil?: true # @!attribute params # The query parameters for the forwarded request. This value must be specified as # a valid JSON object rather than a query string. # # @return [Object, nil] - optional :params, FinchAPI::Unknown, nil?: true + optional :params, FinchAPI::Internal::Type::Unknown, nil?: true # @!parse # # @param method_ [String] @@ -54,7 +55,7 @@ class RequestForwardingForwardParams < FinchAPI::BaseModel # # # def initialize(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/request_forwarding_forward_response.rb b/lib/finch_api/models/request_forwarding_forward_response.rb similarity index 83% rename from lib/finch-api/models/request_forwarding_forward_response.rb rename to lib/finch_api/models/request_forwarding_forward_response.rb index 9cac3161..517cda67 100644 --- a/lib/finch-api/models/request_forwarding_forward_response.rb +++ b/lib/finch_api/models/request_forwarding_forward_response.rb @@ -2,7 +2,8 @@ module FinchAPI module Models - class RequestForwardingForwardResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::RequestForwarding#forward + class RequestForwardingForwardResponse < FinchAPI::Internal::Type::BaseModel # @!attribute data # A string representation of the HTTP response body of the forwarded request’s # response received from the underlying integration’s API. This field may be null @@ -16,7 +17,7 @@ class RequestForwardingForwardResponse < FinchAPI::BaseModel # the underlying integration’s API. # # @return [Object, nil] - required :headers, FinchAPI::Unknown, nil?: true + required :headers, FinchAPI::Internal::Type::Unknown, nil?: true # @!attribute request # An object containing details of your original forwarded request, for your ease @@ -40,9 +41,10 @@ class RequestForwardingForwardResponse < FinchAPI::BaseModel # # # def initialize(data:, headers:, request:, status_code:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Request < FinchAPI::BaseModel + # @see FinchAPI::Models::RequestForwardingForwardResponse#request + class Request < FinchAPI::Internal::Type::BaseModel # @!attribute data # The body that was specified for the forwarded request. If a value was not # specified in the original request, this value will be returned as null ; @@ -56,7 +58,7 @@ class Request < FinchAPI::BaseModel # headers were specified, this will be returned as `null`. # # @return [Object, nil] - required :headers, FinchAPI::Unknown, nil?: true + required :headers, FinchAPI::Internal::Type::Unknown, nil?: true # @!attribute method_ # The HTTP method that was specified for the forwarded request. Valid values @@ -70,7 +72,7 @@ class Request < FinchAPI::BaseModel # parameters were specified, this will be returned as `null`. # # @return [Object, nil] - required :params, FinchAPI::Unknown, nil?: true + required :params, FinchAPI::Internal::Type::Unknown, nil?: true # @!attribute route # The URL route path that was specified for the forwarded request. @@ -90,7 +92,7 @@ class Request < FinchAPI::BaseModel # # # def initialize(data:, headers:, method_:, params:, route:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 81% rename from lib/finch-api/models/sandbox/company_update_params.rb rename to lib/finch_api/models/sandbox/company_update_params.rb index 7d01c210..8cae2f0d 100644 --- a/lib/finch-api/models/sandbox/company_update_params.rb +++ b/lib/finch_api/models/sandbox/company_update_params.rb @@ -3,17 +3,18 @@ module FinchAPI module Models module Sandbox - class CompanyUpdateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Company#update + class CompanyUpdateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute accounts # An array of bank account objects associated with the payroll/HRIS system. # # @return [Array, nil] required :accounts, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account] }, nil?: true # @!attribute departments @@ -21,7 +22,7 @@ class CompanyUpdateParams < FinchAPI::BaseModel # # @return [Array, nil] required :departments, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, nil?: true] }, nil?: true # @!attribute ein @@ -45,7 +46,9 @@ class CompanyUpdateParams < FinchAPI::BaseModel # @!attribute locations # # @return [Array, nil] - required :locations, -> { FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true] }, nil?: true + required :locations, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Location, nil?: true] }, + nil?: true # @!attribute primary_email # The email of the main administrator on the account. @@ -85,9 +88,9 @@ class CompanyUpdateParams < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel # @!attribute account_name # The name of the bank associated in the payroll/HRIS system. # @@ -130,11 +133,13 @@ class Account < FinchAPI::BaseModel # # # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of bank account. + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateParams::Account#account_type module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECKING = :checking SAVINGS = :savings @@ -147,7 +152,7 @@ module AccountType end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The department name. # @@ -166,9 +171,10 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, parent: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Parent < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::CompanyUpdateParams::Department#parent + class Parent < FinchAPI::Internal::Type::BaseModel # @!attribute name # The parent department's name. # @@ -182,11 +188,11 @@ class Parent < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The tax payer subtype of the company. # @@ -209,11 +215,13 @@ class Entity < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The tax payer subtype of the company. + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum S_CORPORATION = :s_corporation C_CORPORATION = :c_corporation @@ -227,8 +235,10 @@ module Subtype end # The tax payer type of the company. + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum LLC = :llc LP = :lp diff --git a/lib/finch-api/models/sandbox/company_update_response.rb b/lib/finch_api/models/sandbox/company_update_response.rb similarity index 80% rename from lib/finch-api/models/sandbox/company_update_response.rb rename to lib/finch_api/models/sandbox/company_update_response.rb index 0766ddd7..f010028d 100644 --- a/lib/finch-api/models/sandbox/company_update_response.rb +++ b/lib/finch_api/models/sandbox/company_update_response.rb @@ -3,13 +3,14 @@ module FinchAPI module Models module Sandbox - class CompanyUpdateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Company#update + class CompanyUpdateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute accounts # An array of bank account objects associated with the payroll/HRIS system. # # @return [Array, nil] required :accounts, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account] }, nil?: true # @!attribute departments @@ -17,7 +18,7 @@ class CompanyUpdateResponse < FinchAPI::BaseModel # # @return [Array, nil] required :departments, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, nil?: true] }, nil?: true # @!attribute ein @@ -41,7 +42,9 @@ class CompanyUpdateResponse < FinchAPI::BaseModel # @!attribute locations # # @return [Array, nil] - required :locations, -> { FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true] }, nil?: true + required :locations, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Location, nil?: true] }, + nil?: true # @!attribute primary_email # The email of the main administrator on the account. @@ -67,9 +70,9 @@ class CompanyUpdateResponse < FinchAPI::BaseModel # # # def initialize(accounts:, departments:, ein:, entity:, legal_name:, locations:, primary_email:, primary_phone_number:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel # @!attribute account_name # The name of the bank associated in the payroll/HRIS system. # @@ -112,11 +115,13 @@ class Account < FinchAPI::BaseModel # # # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of bank account. + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account#account_type module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECKING = :checking SAVINGS = :savings @@ -129,7 +134,7 @@ module AccountType end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The department name. # @@ -148,9 +153,10 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, parent: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Parent < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department#parent + class Parent < FinchAPI::Internal::Type::BaseModel # @!attribute name # The parent department's name. # @@ -164,11 +170,12 @@ class Parent < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end - class Entity < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::CompanyUpdateResponse#entity + class Entity < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The tax payer subtype of the company. # @@ -191,11 +198,13 @@ class Entity < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The tax payer subtype of the company. + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum S_CORPORATION = :s_corporation C_CORPORATION = :c_corporation @@ -209,8 +218,10 @@ module Subtype end # The tax payer type of the company. + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum LLC = :llc LP = :lp diff --git a/lib/finch-api/models/sandbox/connection_create_params.rb b/lib/finch_api/models/sandbox/connection_create_params.rb similarity index 82% rename from lib/finch-api/models/sandbox/connection_create_params.rb rename to lib/finch_api/models/sandbox/connection_create_params.rb index 81e8b7f6..989085a8 100644 --- a/lib/finch-api/models/sandbox/connection_create_params.rb +++ b/lib/finch_api/models/sandbox/connection_create_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Sandbox - class ConnectionCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Connections#create + class ConnectionCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute provider_id # The provider associated with the connection @@ -39,7 +40,7 @@ class ConnectionCreateParams < FinchAPI::BaseModel # @!attribute [r] products # # @return [Array, nil] - optional :products, FinchAPI::ArrayOf[String] + optional :products, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -54,10 +55,10 @@ class ConnectionCreateParams < FinchAPI::BaseModel # # # def initialize(provider_id:, authentication_type: nil, employee_size: nil, products: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL = :credential API_TOKEN = :api_token diff --git a/lib/finch-api/models/sandbox/connection_create_response.rb b/lib/finch_api/models/sandbox/connection_create_response.rb similarity index 86% rename from lib/finch-api/models/sandbox/connection_create_response.rb rename to lib/finch_api/models/sandbox/connection_create_response.rb index 149370cb..b14d0819 100644 --- a/lib/finch-api/models/sandbox/connection_create_response.rb +++ b/lib/finch_api/models/sandbox/connection_create_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Sandbox - class ConnectionCreateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Connections#create + class ConnectionCreateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute access_token # # @return [String] @@ -36,7 +37,7 @@ class ConnectionCreateResponse < FinchAPI::BaseModel # @!attribute products # # @return [Array] - required :products, FinchAPI::ArrayOf[String] + required :products, FinchAPI::Internal::Type::ArrayOf[String] # @!attribute provider_id # The ID of the provider associated with the `access_token`. @@ -77,10 +78,11 @@ class ConnectionCreateResponse < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::ConnectionCreateResponse#authentication_type module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL = :credential API_TOKEN = :api_token diff --git a/lib/finch-api/models/sandbox/connections/account_create_params.rb b/lib/finch_api/models/sandbox/connections/account_create_params.rb similarity index 81% rename from lib/finch-api/models/sandbox/connections/account_create_params.rb rename to lib/finch_api/models/sandbox/connections/account_create_params.rb index 0a1383c2..13553593 100644 --- a/lib/finch-api/models/sandbox/connections/account_create_params.rb +++ b/lib/finch_api/models/sandbox/connections/account_create_params.rb @@ -4,10 +4,11 @@ module FinchAPI module Models module Sandbox module Connections - class AccountCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Connections::Accounts#create + class AccountCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute company_id # @@ -35,7 +36,7 @@ class AccountCreateParams < FinchAPI::BaseModel # `employment`, `individual`) # # @return [Array, nil] - optional :products, FinchAPI::ArrayOf[String] + optional :products, FinchAPI::Internal::Type::ArrayOf[String] # @!parse # # @return [Array] @@ -50,10 +51,10 @@ class AccountCreateParams < FinchAPI::BaseModel # # # def initialize(company_id:, provider_id:, authentication_type: nil, products: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL = :credential API_TOKEN = :api_token diff --git a/lib/finch-api/models/sandbox/connections/account_create_response.rb b/lib/finch_api/models/sandbox/connections/account_create_response.rb similarity index 83% rename from lib/finch-api/models/sandbox/connections/account_create_response.rb rename to lib/finch_api/models/sandbox/connections/account_create_response.rb index 5b4c6c23..c2ef25fd 100644 --- a/lib/finch-api/models/sandbox/connections/account_create_response.rb +++ b/lib/finch_api/models/sandbox/connections/account_create_response.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module Sandbox module Connections - class AccountCreateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Connections::Accounts#create + class AccountCreateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute access_token # # @return [String] @@ -37,7 +38,7 @@ class AccountCreateResponse < FinchAPI::BaseModel # @!attribute products # # @return [Array] - required :products, FinchAPI::ArrayOf[String] + required :products, FinchAPI::Internal::Type::ArrayOf[String] # @!attribute provider_id # The ID of the provider associated with the `access_token` @@ -56,10 +57,11 @@ class AccountCreateResponse < FinchAPI::BaseModel # # # def initialize(access_token:, account_id:, authentication_type:, company_id:, connection_id:, products:, provider_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::Connections::AccountCreateResponse#authentication_type module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL = :credential API_TOKEN = :api_token diff --git a/lib/finch-api/models/sandbox/connections/account_update_params.rb b/lib/finch_api/models/sandbox/connections/account_update_params.rb similarity index 69% rename from lib/finch-api/models/sandbox/connections/account_update_params.rb rename to lib/finch_api/models/sandbox/connections/account_update_params.rb index 0a3f7e3d..5ace5408 100644 --- a/lib/finch-api/models/sandbox/connections/account_update_params.rb +++ b/lib/finch_api/models/sandbox/connections/account_update_params.rb @@ -4,10 +4,11 @@ module FinchAPI module Models module Sandbox module Connections - class AccountUpdateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Connections::Accounts#update + class AccountUpdateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] connection_status # @@ -24,7 +25,7 @@ class AccountUpdateParams < FinchAPI::BaseModel # # # def initialize(connection_status: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 83% rename from lib/finch-api/models/sandbox/connections/account_update_response.rb rename to lib/finch_api/models/sandbox/connections/account_update_response.rb index 204ee5fe..6b8b9285 100644 --- a/lib/finch-api/models/sandbox/connections/account_update_response.rb +++ b/lib/finch_api/models/sandbox/connections/account_update_response.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module Sandbox module Connections - class AccountUpdateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Connections::Accounts#update + class AccountUpdateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute account_id # [DEPRECATED] Use `connection_id` to associate a connection with an access token # @@ -26,7 +27,7 @@ class AccountUpdateResponse < FinchAPI::BaseModel # @!attribute products # # @return [Array] - required :products, FinchAPI::ArrayOf[String] + required :products, FinchAPI::Internal::Type::ArrayOf[String] # @!attribute provider_id # The ID of the provider associated with the `access_token` @@ -54,10 +55,11 @@ class AccountUpdateResponse < FinchAPI::BaseModel # # # def initialize(account_id:, authentication_type:, company_id:, products:, provider_id:, connection_id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse#authentication_type module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL = :credential API_TOKEN = :api_token diff --git a/lib/finch-api/models/sandbox/directory_create_params.rb b/lib/finch_api/models/sandbox/directory_create_params.rb similarity index 83% rename from lib/finch-api/models/sandbox/directory_create_params.rb rename to lib/finch_api/models/sandbox/directory_create_params.rb index 4a5f9e66..1c454cec 100644 --- a/lib/finch-api/models/sandbox/directory_create_params.rb +++ b/lib/finch_api/models/sandbox/directory_create_params.rb @@ -3,17 +3,19 @@ module FinchAPI module Models module Sandbox - class DirectoryCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Directory#create + class DirectoryCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] body # Array of individuals to create. Takes all combined fields from `/individual` and # `/employment` endpoints. All fields are optional. # # @return [Array, nil] - optional :body, -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] } + optional :body, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] } # @!parse # # @return [Array] @@ -25,9 +27,9 @@ class DirectoryCreateParams < FinchAPI::BaseModel # # # def initialize(body: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel # @!attribute class_code # Worker's compensation classification code for this employee # @@ -41,7 +43,7 @@ class Body < FinchAPI::BaseModel # # @return [Array, nil] optional :custom_fields, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField] } # @!parse # # @return [Array] @@ -64,7 +66,7 @@ class Body < FinchAPI::BaseModel # # @return [Array, nil] optional :emails, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email] }, nil?: true # @!attribute employment @@ -128,13 +130,15 @@ class Body < FinchAPI::BaseModel # The array of income history. # # @return [Array, nil] - optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + optional :income_history, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Income, nil?: true] }, + nil?: true # @!attribute is_active # `true` if the individual an an active employee or contractor at the company. # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel, nil?: true + optional :is_active, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute last_name # The legal last name of the individual. @@ -168,7 +172,7 @@ class Body < FinchAPI::BaseModel # # @return [Array, nil] optional :phone_numbers, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber, nil?: true] }, nil?: true # @!attribute preferred_name @@ -274,9 +278,9 @@ class Body < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel # @!attribute name # # @return [String, nil] @@ -285,7 +289,7 @@ class CustomField < FinchAPI::BaseModel # @!attribute [r] value # # @return [Object, nil] - optional :value, FinchAPI::Unknown + optional :value, FinchAPI::Internal::Type::Unknown # @!parse # # @return [Object] @@ -297,10 +301,11 @@ class CustomField < FinchAPI::BaseModel # # # def initialize(name: nil, value: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Department < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#department + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The name of the department associated with the individual. # @@ -314,10 +319,10 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [String, nil] @@ -340,10 +345,11 @@ class Email < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal @@ -356,7 +362,8 @@ module Type end end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -382,12 +389,14 @@ class Employment < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME = :full_time INTERN = :intern @@ -404,8 +413,10 @@ module Subtype end # The main employment type of the individual. + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE = :employee CONTRACTOR = :contractor @@ -419,8 +430,10 @@ module Type end # The detailed employment status of the individual. + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#employment_status module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE = :active DECEASED = :deceased @@ -438,8 +451,10 @@ module EmploymentStatus end # The EEOC-defined ethnicity of the individual. + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#ethnicity module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN = :asian WHITE = :white @@ -458,8 +473,10 @@ module Ethnicity end # The gender of the individual. + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#gender module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE = :female MALE = :male @@ -473,7 +490,8 @@ module Gender # def self.values; end end - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -491,10 +509,10 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel # @!attribute data # # @return [String, nil] @@ -513,10 +531,11 @@ class PhoneNumber < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal diff --git a/lib/finch_api/models/sandbox/directory_create_response.rb b/lib/finch_api/models/sandbox/directory_create_response.rb new file mode 100644 index 00000000..94ded54a --- /dev/null +++ b/lib/finch_api/models/sandbox/directory_create_response.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + DirectoryCreateResponse = FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown] + end + end +end diff --git a/lib/finch-api/models/sandbox/employment_update_params.rb b/lib/finch_api/models/sandbox/employment_update_params.rb similarity index 85% rename from lib/finch-api/models/sandbox/employment_update_params.rb rename to lib/finch_api/models/sandbox/employment_update_params.rb index efdb368b..126622d5 100644 --- a/lib/finch-api/models/sandbox/employment_update_params.rb +++ b/lib/finch_api/models/sandbox/employment_update_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Sandbox - class EmploymentUpdateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Employment#update + class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute class_code # Worker's compensation classification code for this employee @@ -21,7 +22,7 @@ class EmploymentUpdateParams < FinchAPI::BaseModel # # @return [Array, nil] optional :custom_fields, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField] } # @!parse # # @return [Array] @@ -70,13 +71,15 @@ class EmploymentUpdateParams < FinchAPI::BaseModel # The array of income history. # # @return [Array, nil] - optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + optional :income_history, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Income, nil?: true] }, + nil?: true # @!attribute is_active # `true` if the individual an an active employee or contractor at the company. # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel, nil?: true + optional :is_active, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute last_name # The legal last name of the individual. @@ -173,9 +176,9 @@ class EmploymentUpdateParams < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel # @!attribute name # # @return [String, nil] @@ -184,7 +187,7 @@ class CustomField < FinchAPI::BaseModel # @!attribute [r] value # # @return [Object, nil] - optional :value, FinchAPI::Unknown + optional :value, FinchAPI::Internal::Type::Unknown # @!parse # # @return [Object] @@ -196,10 +199,10 @@ class CustomField < FinchAPI::BaseModel # # # def initialize(name: nil, value: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The name of the department associated with the individual. # @@ -213,10 +216,10 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -242,12 +245,14 @@ class Employment < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME = :full_time INTERN = :intern @@ -264,8 +269,10 @@ module Subtype end # The main employment type of the individual. + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE = :employee CONTRACTOR = :contractor @@ -280,7 +287,7 @@ module Type # The detailed employment status of the individual. module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE = :active DECEASED = :deceased @@ -297,7 +304,7 @@ module EmploymentStatus # def self.values; end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -315,7 +322,7 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/sandbox/employment_update_response.rb b/lib/finch_api/models/sandbox/employment_update_response.rb similarity index 84% rename from lib/finch-api/models/sandbox/employment_update_response.rb rename to lib/finch_api/models/sandbox/employment_update_response.rb index 03ec24b6..385e2aab 100644 --- a/lib/finch-api/models/sandbox/employment_update_response.rb +++ b/lib/finch_api/models/sandbox/employment_update_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Sandbox - class EmploymentUpdateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Employment#update + class EmploymentUpdateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -27,7 +28,7 @@ class EmploymentUpdateResponse < FinchAPI::BaseModel # # @return [Array, nil] optional :custom_fields, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField] } # @!parse # # @return [Array] @@ -76,13 +77,15 @@ class EmploymentUpdateResponse < FinchAPI::BaseModel # The array of income history. # # @return [Array, nil] - optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + optional :income_history, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Income, nil?: true] }, + nil?: true # @!attribute is_active # `true` if the individual an an active employee or contractor at the company. # # @return [Boolean, nil] - optional :is_active, FinchAPI::BooleanModel, nil?: true + optional :is_active, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute last_name # The legal last name of the individual. @@ -179,9 +182,9 @@ class EmploymentUpdateResponse < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel # @!attribute name # # @return [String, nil] @@ -190,7 +193,7 @@ class CustomField < FinchAPI::BaseModel # @!attribute [r] value # # @return [Object, nil] - optional :value, FinchAPI::Unknown + optional :value, FinchAPI::Internal::Type::Unknown # @!parse # # @return [Object] @@ -202,10 +205,11 @@ class CustomField < FinchAPI::BaseModel # # # def initialize(name: nil, value: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Department < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse#department + class Department < FinchAPI::Internal::Type::BaseModel # @!attribute name # The name of the department associated with the individual. # @@ -219,10 +223,11 @@ class Department < FinchAPI::BaseModel # # # def initialize(name: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end - class Employment < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse#employment + class Employment < FinchAPI::Internal::Type::BaseModel # @!attribute subtype # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -248,12 +253,14 @@ class Employment < FinchAPI::BaseModel # # # def initialize(subtype: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment#subtype module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME = :full_time INTERN = :intern @@ -270,8 +277,10 @@ module Subtype end # The main employment type of the individual. + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE = :employee CONTRACTOR = :contractor @@ -285,8 +294,10 @@ module Type end # The detailed employment status of the individual. + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse#employment_status module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE = :active DECEASED = :deceased @@ -303,7 +314,8 @@ module EmploymentStatus # def self.values; end end - class Manager < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse#manager + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -321,7 +333,7 @@ class Manager < FinchAPI::BaseModel # # # def initialize(id: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/sandbox/individual_update_params.rb b/lib/finch_api/models/sandbox/individual_update_params.rb similarity index 85% rename from lib/finch-api/models/sandbox/individual_update_params.rb rename to lib/finch_api/models/sandbox/individual_update_params.rb index e51fb6d2..b4d8a2ed 100644 --- a/lib/finch-api/models/sandbox/individual_update_params.rb +++ b/lib/finch_api/models/sandbox/individual_update_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Sandbox - class IndividualUpdateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Individual#update + class IndividualUpdateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute dob # @@ -17,7 +18,7 @@ class IndividualUpdateParams < FinchAPI::BaseModel # # @return [Array, nil] optional :emails, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email] }, nil?: true # @!attribute encrypted_ssn @@ -62,7 +63,7 @@ class IndividualUpdateParams < FinchAPI::BaseModel # # @return [Array, nil] optional :phone_numbers, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, nil?: true] }, nil?: true # @!attribute preferred_name @@ -119,9 +120,9 @@ class IndividualUpdateParams < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [String, nil] @@ -142,10 +143,11 @@ class Email < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::IndividualUpdateParams::Email#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal @@ -160,7 +162,7 @@ module Type # The EEOC-defined ethnicity of the individual. module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN = :asian WHITE = :white @@ -180,7 +182,7 @@ module Ethnicity # The gender of the individual. module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE = :female MALE = :male @@ -194,7 +196,7 @@ module Gender # def self.values; end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel # @!attribute data # # @return [String, nil] @@ -213,10 +215,11 @@ class PhoneNumber < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal diff --git a/lib/finch-api/models/sandbox/individual_update_response.rb b/lib/finch_api/models/sandbox/individual_update_response.rb similarity index 85% rename from lib/finch-api/models/sandbox/individual_update_response.rb rename to lib/finch_api/models/sandbox/individual_update_response.rb index 2beef4db..42212f3d 100644 --- a/lib/finch-api/models/sandbox/individual_update_response.rb +++ b/lib/finch_api/models/sandbox/individual_update_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Sandbox - class IndividualUpdateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Individual#update + class IndividualUpdateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute [r] id # A stable Finch `id` (UUID v4) for an individual in the company. # @@ -23,7 +24,7 @@ class IndividualUpdateResponse < FinchAPI::BaseModel # # @return [Array, nil] optional :emails, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email] }, nil?: true # @!attribute encrypted_ssn @@ -70,7 +71,7 @@ class IndividualUpdateResponse < FinchAPI::BaseModel # # @return [Array, nil] optional :phone_numbers, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, nil?: true] }, nil?: true # @!attribute preferred_name @@ -127,9 +128,9 @@ class IndividualUpdateResponse < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel # @!attribute [r] data # # @return [String, nil] @@ -150,10 +151,11 @@ class Email < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal @@ -167,8 +169,10 @@ module Type end # The EEOC-defined ethnicity of the individual. + # + # @see FinchAPI::Models::Sandbox::IndividualUpdateResponse#ethnicity module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN = :asian WHITE = :white @@ -187,8 +191,10 @@ module Ethnicity end # The gender of the individual. + # + # @see FinchAPI::Models::Sandbox::IndividualUpdateResponse#gender module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE = :female MALE = :male @@ -202,7 +208,7 @@ module Gender # def self.values; end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel # @!attribute data # # @return [String, nil] @@ -221,10 +227,11 @@ class PhoneNumber < FinchAPI::BaseModel # # # def initialize(data: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK = :work PERSONAL = :personal diff --git a/lib/finch-api/models/sandbox/job_create_params.rb b/lib/finch_api/models/sandbox/job_create_params.rb similarity index 71% rename from lib/finch-api/models/sandbox/job_create_params.rb rename to lib/finch_api/models/sandbox/job_create_params.rb index ad9d1646..279c51fb 100644 --- a/lib/finch-api/models/sandbox/job_create_params.rb +++ b/lib/finch_api/models/sandbox/job_create_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Sandbox - class JobCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Jobs#create + class JobCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute type # The type of job to start. Currently the only supported type is `data_sync_all` @@ -20,11 +21,11 @@ class JobCreateParams < FinchAPI::BaseModel # # # def initialize(type:, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void # The type of job to start. Currently the only supported type is `data_sync_all` module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DATA_SYNC_ALL = :data_sync_all diff --git a/lib/finch-api/models/sandbox/job_create_response.rb b/lib/finch_api/models/sandbox/job_create_response.rb similarity index 85% rename from lib/finch-api/models/sandbox/job_create_response.rb rename to lib/finch_api/models/sandbox/job_create_response.rb index 111f3a40..15c1f2bf 100644 --- a/lib/finch-api/models/sandbox/job_create_response.rb +++ b/lib/finch_api/models/sandbox/job_create_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Sandbox - class JobCreateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Jobs#create + class JobCreateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute allowed_refreshes # The number of allowed refreshes per hour (per hour, fixed window) # @@ -36,7 +37,7 @@ class JobCreateResponse < FinchAPI::BaseModel # # # def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch_api/models/sandbox/jobs/configuration_retrieve_params.rb b/lib/finch_api/models/sandbox/jobs/configuration_retrieve_params.rb new file mode 100644 index 00000000..217d2114 --- /dev/null +++ b/lib/finch_api/models/sandbox/jobs/configuration_retrieve_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Jobs + # @see FinchAPI::Resources::Sandbox::Jobs::Configuration#retrieve + class ConfigurationRetrieveParams < FinchAPI::Internal::Type::BaseModel + # @!parse + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb b/lib/finch_api/models/sandbox/jobs/configuration_retrieve_response.rb similarity index 60% rename from lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb rename to lib/finch_api/models/sandbox/jobs/configuration_retrieve_response.rb index 185c59dd..874348c7 100644 --- a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb +++ b/lib/finch_api/models/sandbox/jobs/configuration_retrieve_response.rb @@ -5,7 +5,7 @@ module Models module Sandbox module Jobs ConfigurationRetrieveResponse = - FinchAPI::ArrayOf[-> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration }] + FinchAPI::Internal::Type::ArrayOf[-> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration }] end end end diff --git a/lib/finch-api/models/sandbox/jobs/configuration_update_params.rb b/lib/finch_api/models/sandbox/jobs/configuration_update_params.rb similarity index 60% rename from lib/finch-api/models/sandbox/jobs/configuration_update_params.rb rename to lib/finch_api/models/sandbox/jobs/configuration_update_params.rb index 540fbf19..06d8cbcc 100644 --- a/lib/finch-api/models/sandbox/jobs/configuration_update_params.rb +++ b/lib/finch_api/models/sandbox/jobs/configuration_update_params.rb @@ -4,17 +4,18 @@ module FinchAPI module Models module Sandbox module Jobs + # @see FinchAPI::Resources::Sandbox::Jobs::Configuration#update class ConfigurationUpdateParams < FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!parse # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] # # # def initialize(request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void 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 similarity index 75% rename from lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb rename to lib/finch_api/models/sandbox/jobs/sandbox_job_configuration.rb index 5e799f4f..33678927 100644 --- a/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb +++ b/lib/finch_api/models/sandbox/jobs/sandbox_job_configuration.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module Sandbox module Jobs - class SandboxJobConfiguration < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Jobs::Configuration#update + class SandboxJobConfiguration < FinchAPI::Internal::Type::BaseModel # @!attribute completion_status # # @return [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus] @@ -22,10 +23,11 @@ class SandboxJobConfiguration < FinchAPI::BaseModel # # # def initialize(completion_status:, type:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void + # @see FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration#completion_status module CompletionStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPLETE = :complete REAUTH_ERROR = :reauth_error @@ -39,8 +41,9 @@ module CompletionStatus # def self.values; end end + # @see FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DATA_SYNC_ALL = :data_sync_all diff --git a/lib/finch-api/models/sandbox/payment_create_params.rb b/lib/finch_api/models/sandbox/payment_create_params.rb similarity index 80% rename from lib/finch-api/models/sandbox/payment_create_params.rb rename to lib/finch_api/models/sandbox/payment_create_params.rb index 52c83a28..507aae3d 100644 --- a/lib/finch-api/models/sandbox/payment_create_params.rb +++ b/lib/finch_api/models/sandbox/payment_create_params.rb @@ -3,10 +3,11 @@ module FinchAPI module Models module Sandbox - class PaymentCreateParams < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Payment#create + class PaymentCreateParams < FinchAPI::Internal::Type::BaseModel # @!parse - # extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + # extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # @!attribute [r] end_date # @@ -21,7 +22,7 @@ class PaymentCreateParams < FinchAPI::BaseModel # # @return [Array, nil] optional :pay_statements, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement] } + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement] } # @!parse # # @return [Array] @@ -44,15 +45,15 @@ class PaymentCreateParams < FinchAPI::BaseModel # # # def initialize(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel # @!attribute earnings # The array of earnings objects associated with this pay statement # # @return [Array, nil] optional :earnings, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning, nil?: true] }, nil?: true # @!attribute employee_deductions @@ -60,14 +61,14 @@ class PayStatement < FinchAPI::BaseModel # # @return [Array, nil] optional :employee_deductions, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction, nil?: true] }, nil?: true # @!attribute employer_contributions # # @return [Array, nil] optional :employer_contributions, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution, nil?: true] }, nil?: true # @!attribute gross_pay @@ -103,7 +104,7 @@ class PayStatement < FinchAPI::BaseModel # # @return [Array, nil] optional :taxes, - -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax, nil?: true] }, + -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax, nil?: true] }, nil?: true # @!attribute total_hours @@ -148,9 +149,9 @@ class PayStatement < FinchAPI::BaseModel # super # end - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Earning < FinchAPI::BaseModel + class Earning < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The earnings amount in cents. # @@ -201,9 +202,10 @@ class Earning < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata, nil] @@ -219,16 +221,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -239,13 +242,15 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end # The type of earning. + # + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum SALARY = :salary WAGE = :wage @@ -258,7 +263,7 @@ module Type BONUS = :bonus COMMISSION = :commission TIPS = :tips - NUMBER_1099 = :"1099" + TYPE_1099 = :"1099" OTHER = :other finalize! @@ -269,7 +274,7 @@ module Type end end - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The deduction amount in cents. # @@ -299,7 +304,7 @@ class EmployeeDeduction < FinchAPI::BaseModel # Boolean indicating if the deduction is pre-tax. # # @return [Boolean, nil] - optional :pre_tax, FinchAPI::BooleanModel, nil?: true + optional :pre_tax, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute type # Type of benefit. @@ -317,9 +322,10 @@ class EmployeeDeduction < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata, nil] @@ -335,16 +341,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -355,12 +362,12 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end - class EmployerContribution < FinchAPI::BaseModel + class EmployerContribution < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The contribution amount in cents. # @@ -401,9 +408,10 @@ class EmployerContribution < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata, nil] @@ -419,16 +427,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -439,14 +448,16 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end # The payment method. + # + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement#payment_method module PaymentMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECK = :check DIRECT_DEPOSIT = :direct_deposit @@ -458,7 +469,7 @@ module PaymentMethod # def self.values; end end - class Tax < FinchAPI::BaseModel + class Tax < FinchAPI::Internal::Type::BaseModel # @!attribute amount # The tax amount in cents. # @@ -482,7 +493,7 @@ class Tax < FinchAPI::BaseModel # `true` if the amount is paid by the employers. # # @return [Boolean, nil] - optional :employer, FinchAPI::BooleanModel, nil?: true + optional :employer, FinchAPI::Internal::Type::BooleanModel, nil?: true # @!attribute name # The exact name of tax from the pay statement. @@ -508,9 +519,10 @@ class Tax < FinchAPI::BaseModel # # # def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Attributes < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax#attributes + class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata, nil] @@ -526,16 +538,17 @@ class Attributes < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void - class Metadata < FinchAPI::BaseModel + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes#metadata + class Metadata < FinchAPI::Internal::Type::BaseModel # @!attribute [r] metadata # The metadata to be attached to the entity by existing rules. It is a key-value # pairs where the values can be of any type (string, number, boolean, object, # array, etc.). # # @return [Hash{Symbol=>Object}, nil] - optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + optional :metadata, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!parse # # @return [Hash{Symbol=>Object}] @@ -546,13 +559,15 @@ class Metadata < FinchAPI::BaseModel # # # def initialize(metadata: nil, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end # The type of taxes. + # + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum STATE = :state FEDERAL = :federal @@ -568,8 +583,10 @@ module Type end # The type of the payment associated with the pay statement. + # + # @see FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement#type module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum REGULAR_PAYROLL = :regular_payroll OFF_CYCLE_PAYROLL = :off_cycle_payroll diff --git a/lib/finch-api/models/sandbox/payment_create_response.rb b/lib/finch_api/models/sandbox/payment_create_response.rb similarity index 73% rename from lib/finch-api/models/sandbox/payment_create_response.rb rename to lib/finch_api/models/sandbox/payment_create_response.rb index cffe6d95..e7359edf 100644 --- a/lib/finch-api/models/sandbox/payment_create_response.rb +++ b/lib/finch_api/models/sandbox/payment_create_response.rb @@ -3,7 +3,8 @@ module FinchAPI module Models module Sandbox - class PaymentCreateResponse < FinchAPI::BaseModel + # @see FinchAPI::Resources::Sandbox::Payment#create + class PaymentCreateResponse < FinchAPI::Internal::Type::BaseModel # @!attribute pay_date # The date of the payment. # @@ -22,7 +23,7 @@ class PaymentCreateResponse < FinchAPI::BaseModel # # # def initialize(pay_date:, payment_id:, **) = super - # def initialize: (Hash | FinchAPI::BaseModel) -> void + # def initialize: (Hash | FinchAPI::Internal::Type::BaseModel) -> void end end end diff --git a/lib/finch-api/models/webhook_event.rb b/lib/finch_api/models/webhook_event.rb similarity index 95% rename from lib/finch-api/models/webhook_event.rb rename to lib/finch_api/models/webhook_event.rb index 02b0b402..96650689 100644 --- a/lib/finch-api/models/webhook_event.rb +++ b/lib/finch_api/models/webhook_event.rb @@ -3,7 +3,7 @@ module FinchAPI module Models module WebhookEvent - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union discriminator :event_type diff --git a/lib/finch-api/request_options.rb b/lib/finch_api/request_options.rb similarity index 87% rename from lib/finch-api/request_options.rb rename to lib/finch_api/request_options.rb index 57bf68a8..a8cc7cc6 100644 --- a/lib/finch-api/request_options.rb +++ b/lib/finch_api/request_options.rb @@ -6,7 +6,7 @@ module FinchAPI # # 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 + class RequestOptions < FinchAPI::Internal::Type::BaseModel # @api private # # @param opts [FinchAPI::RequestOptions, Hash{Symbol=>Object}] @@ -37,21 +37,21 @@ def self.validate!(opts) # `query` given at the client level. # # @return [Hash{String=>Array, String, nil}, nil] - optional :extra_query, FinchAPI::HashOf[FinchAPI::ArrayOf[String]] + optional :extra_query, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::ArrayOf[String]] # @!attribute extra_headers # Extra headers to send with the request. These are `.merged`’d into any # `extra_headers` given at the client level. # # @return [Hash{String=>String, nil}, nil] - optional :extra_headers, FinchAPI::HashOf[String, nil?: true] + optional :extra_headers, FinchAPI::Internal::Type::HashOf[String, nil?: true] # @!attribute extra_body # Extra data to send with the request. These are deep merged into any data # generated as part of the normal request. # # @return [Object, nil] - optional :extra_body, FinchAPI::HashOf[FinchAPI::Unknown] + optional :extra_body, FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown] # @!attribute max_retries # Maximum number of retries to attempt after a failed initial request. diff --git a/lib/finch-api/resources/access_tokens.rb b/lib/finch_api/resources/access_tokens.rb similarity index 63% rename from lib/finch-api/resources/access_tokens.rb rename to lib/finch_api/resources/access_tokens.rb index 4a840cc6..43e77300 100644 --- a/lib/finch-api/resources/access_tokens.rb +++ b/lib/finch_api/resources/access_tokens.rb @@ -5,19 +5,17 @@ module Resources class AccessTokens # Exchange the authorization code for an access token # - # @param params [FinchAPI::Models::AccessTokenCreateParams, Hash{Symbol=>Object}] . + # @overload create(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) # - # @option params [String] :code - # - # @option params [String] :client_id - # - # @option params [String] :client_secret - # - # @option params [String] :redirect_uri - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param code [String] + # @param client_id [String] + # @param client_secret [String] + # @param redirect_uri [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::CreateAccessTokenResponse] + # + # @see FinchAPI::Models::AccessTokenCreateParams def create(params) parsed, options = FinchAPI::Models::AccessTokenCreateParams.dump_request(params) @client.request( @@ -29,6 +27,8 @@ def create(params) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/account.rb b/lib/finch_api/resources/account.rb similarity index 69% rename from lib/finch-api/resources/account.rb rename to lib/finch_api/resources/account.rb index 3d1fcd12..31ce59b5 100644 --- a/lib/finch-api/resources/account.rb +++ b/lib/finch_api/resources/account.rb @@ -5,11 +5,13 @@ module Resources class Account # Disconnect one or more `access_token`s from your application. # - # @param params [FinchAPI::Models::AccountDisconnectParams, Hash{Symbol=>Object}] . + # @overload disconnect(request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::DisconnectResponse] + # + # @see FinchAPI::Models::AccountDisconnectParams def disconnect(params = {}) @client.request( method: :post, @@ -21,11 +23,13 @@ def disconnect(params = {}) # Read account information associated with an `access_token` # - # @param params [FinchAPI::Models::AccountIntrospectParams, Hash{Symbol=>Object}] . + # @overload introspect(request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Introspection] + # + # @see FinchAPI::Models::AccountIntrospectParams def introspect(params = {}) @client.request( method: :get, @@ -35,6 +39,8 @@ def introspect(params = {}) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/connect.rb b/lib/finch_api/resources/connect.rb similarity index 92% rename from lib/finch-api/resources/connect.rb rename to lib/finch_api/resources/connect.rb index ba71f94c..98d0808a 100644 --- a/lib/finch-api/resources/connect.rb +++ b/lib/finch_api/resources/connect.rb @@ -6,6 +6,8 @@ class Connect # @return [FinchAPI::Resources::Connect::Sessions] attr_reader :sessions + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch_api/resources/connect/sessions.rb b/lib/finch_api/resources/connect/sessions.rb new file mode 100644 index 00000000..a02bc17b --- /dev/null +++ b/lib/finch_api/resources/connect/sessions.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Connect + class Sessions + # Create a new connect session for an employer + # + # @overload new(customer_id:, customer_name:, products:, customer_email: nil, integration: nil, manual: nil, minutes_to_expire: nil, redirect_uri: nil, sandbox: nil, request_options: {}) + # + # @param customer_id [String] + # @param customer_name [String] + # @param products [Array] + # @param customer_email [String, nil] + # @param integration [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] + # @param manual [Boolean, nil] + # @param minutes_to_expire [Float, nil] + # @param redirect_uri [String, nil] + # @param sandbox [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::Connect::SessionNewResponse] + # + # @see FinchAPI::Models::Connect::SessionNewParams + def new(params) + parsed, options = FinchAPI::Models::Connect::SessionNewParams.dump_request(params) + @client.request( + method: :post, + path: "connect/sessions", + body: parsed, + model: FinchAPI::Models::Connect::SessionNewResponse, + options: options + ) + end + + # Create a new Connect session for reauthenticating an existing connection + # + # @overload reauthenticate(connection_id:, minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}) + # + # @param connection_id [String] + # @param minutes_to_expire [Integer, nil] + # @param products [Array, nil] + # @param redirect_uri [String, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::Connect::SessionReauthenticateResponse] + # + # @see FinchAPI::Models::Connect::SessionReauthenticateParams + def reauthenticate(params) + parsed, options = FinchAPI::Models::Connect::SessionReauthenticateParams.dump_request(params) + @client.request( + method: :post, + path: "connect/sessions/reauthenticate", + body: parsed, + model: FinchAPI::Models::Connect::SessionReauthenticateResponse, + options: options + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris.rb b/lib/finch_api/resources/hris.rb similarity index 98% rename from lib/finch-api/resources/hris.rb rename to lib/finch_api/resources/hris.rb index 34b46404..fb144300 100644 --- a/lib/finch-api/resources/hris.rb +++ b/lib/finch_api/resources/hris.rb @@ -27,6 +27,8 @@ class HRIS # @return [FinchAPI::Resources::HRIS::Benefits] attr_reader :benefits + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/benefits.rb b/lib/finch_api/resources/hris/benefits.rb similarity index 60% rename from lib/finch-api/resources/hris/benefits.rb rename to lib/finch_api/resources/hris/benefits.rb index c7561451..42d97884 100644 --- a/lib/finch-api/resources/hris/benefits.rb +++ b/lib/finch_api/resources/hris/benefits.rb @@ -10,19 +10,16 @@ class Benefits # Creates a new company-wide deduction or contribution. Please use the # `/providers` endpoint to view available types for each provider. # - # @param params [FinchAPI::Models::HRIS::BenefitCreateParams, Hash{Symbol=>Object}] . + # @overload create(description: nil, frequency: nil, type: nil, request_options: {}) # - # @option params [String] :description Name of the benefit as it appears in the provider and pay statements. Recommend - # limiting this to <30 characters due to limitations in specific providers (e.g. - # Justworks). - # - # @option params [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] :frequency - # - # @option params [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] :type Type of benefit. - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param description [String] + # @param frequency [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] + # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse] + # + # @see FinchAPI::Models::HRIS::BenefitCreateParams def create(params = {}) parsed, options = FinchAPI::Models::HRIS::BenefitCreateParams.dump_request(params) @client.request( @@ -36,17 +33,18 @@ def create(params = {}) # Lists deductions and contributions information for a given item # - # @param benefit_id [String] - # - # @param params [FinchAPI::Models::HRIS::BenefitRetrieveParams, Hash{Symbol=>Object}] . + # @overload retrieve(benefit_id, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param benefit_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::CompanyBenefit] + # + # @see FinchAPI::Models::HRIS::BenefitRetrieveParams def retrieve(benefit_id, params = {}) @client.request( method: :get, - path: ["employer/benefits/%0s", benefit_id], + path: ["employer/benefits/%1$s", benefit_id], model: FinchAPI::Models::HRIS::CompanyBenefit, options: params[:request_options] ) @@ -54,20 +52,20 @@ def retrieve(benefit_id, params = {}) # Updates an existing company-wide deduction or contribution # - # @param benefit_id [String] - # - # @param params [FinchAPI::Models::HRIS::BenefitUpdateParams, Hash{Symbol=>Object}] . + # @overload update(benefit_id, description: nil, request_options: {}) # - # @option params [String] :description Updated name or description. - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param benefit_id [String] + # @param description [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse] + # + # @see FinchAPI::Models::HRIS::BenefitUpdateParams def update(benefit_id, params = {}) parsed, options = FinchAPI::Models::HRIS::BenefitUpdateParams.dump_request(params) @client.request( method: :post, - path: ["employer/benefits/%0s", benefit_id], + path: ["employer/benefits/%1$s", benefit_id], body: parsed, model: FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse, options: options @@ -76,16 +74,18 @@ def update(benefit_id, params = {}) # List all company-wide deductions and contributions. # - # @param params [FinchAPI::Models::HRIS::BenefitListParams, Hash{Symbol=>Object}] . + # @overload list(request_options: {}) + # + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::SinglePage] # - # @return [FinchAPI::SinglePage] + # @see FinchAPI::Models::HRIS::BenefitListParams def list(params = {}) @client.request( method: :get, path: "employer/benefits", - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::HRIS::CompanyBenefit, options: params[:request_options] ) @@ -93,21 +93,25 @@ def list(params = {}) # Get deductions metadata # - # @param params [FinchAPI::Models::HRIS::BenefitListSupportedBenefitsParams, Hash{Symbol=>Object}] . + # @overload list_supported_benefits(request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [FinchAPI::SinglePage] + # @return [FinchAPI::Internal::SinglePage] + # + # @see FinchAPI::Models::HRIS::BenefitListSupportedBenefitsParams def list_supported_benefits(params = {}) @client.request( method: :get, path: "employer/benefits/meta", - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::HRIS::SupportedBenefit, options: params[:request_options] ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/benefits/individuals.rb b/lib/finch_api/resources/hris/benefits/individuals.rb similarity index 57% rename from lib/finch-api/resources/hris/benefits/individuals.rb rename to lib/finch_api/resources/hris/benefits/individuals.rb index fd91aaee..58493932 100644 --- a/lib/finch-api/resources/hris/benefits/individuals.rb +++ b/lib/finch_api/resources/hris/benefits/individuals.rb @@ -10,22 +10,22 @@ class Individuals # adjusted. Making the same request multiple times will not create new # enrollments, but will continue to set the state of the existing enrollment. # - # @param benefit_id [String] - # - # @param params [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams, Hash{Symbol=>Object}] . + # @overload enroll_many(benefit_id, individuals: nil, request_options: {}) # - # @option params [Array] :individuals Array of the individual_id to enroll and a configuration object. + # @param benefit_id [String] + # @param individuals [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::SinglePage] # - # @return [FinchAPI::SinglePage] + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams def enroll_many(benefit_id, params = {}) parsed, options = FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams.dump_request(params) @client.request( method: :post, - path: ["employer/benefits/%0s/individuals", benefit_id], + path: ["employer/benefits/%1$s/individuals", benefit_id], body: parsed[:individuals], - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual, options: options ) @@ -33,17 +33,18 @@ def enroll_many(benefit_id, params = {}) # Lists individuals currently enrolled in a given deduction. # - # @param benefit_id [String] + # @overload enrolled_ids(benefit_id, request_options: {}) # - # @param params [FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsParams, Hash{Symbol=>Object}] . - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param benefit_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse] + # + # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsParams def enrolled_ids(benefit_id, params = {}) @client.request( method: :get, - path: ["employer/benefits/%0s/enrolled", benefit_id], + path: ["employer/benefits/%1$s/enrolled", benefit_id], model: FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse, options: params[:request_options] ) @@ -51,24 +52,23 @@ def enrolled_ids(benefit_id, params = {}) # Get enrollment information for the given individuals. # - # @param benefit_id [String] - # - # @param params [FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams, Hash{Symbol=>Object}] . + # @overload retrieve_many_benefits(benefit_id, individual_ids: nil, request_options: {}) # - # @option params [String] :individual_ids comma-delimited list of stable Finch uuids for each individual. If empty, - # defaults to all individuals + # @param benefit_id [String] + # @param individual_ids [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::SinglePage] # - # @return [FinchAPI::SinglePage] + # @see FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams def retrieve_many_benefits(benefit_id, params = {}) parsed, options = FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams.dump_request(params) @client.request( method: :get, - path: ["employer/benefits/%0s/individuals", benefit_id], + path: ["employer/benefits/%1$s/individuals", benefit_id], query: parsed, - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::HRIS::Benefits::IndividualBenefit, options: options ) @@ -76,27 +76,29 @@ def retrieve_many_benefits(benefit_id, params = {}) # Unenroll individuals from a deduction or contribution # - # @param benefit_id [String] + # @overload unenroll_many(benefit_id, individual_ids: nil, request_options: {}) # - # @param params [FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams, Hash{Symbol=>Object}] . - # - # @option params [Array] :individual_ids Array of individual_ids to unenroll. + # @param benefit_id [String] + # @param individual_ids [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::SinglePage] # - # @return [FinchAPI::SinglePage] + # @see FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams def unenroll_many(benefit_id, params = {}) parsed, options = FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams.dump_request(params) @client.request( method: :delete, - path: ["employer/benefits/%0s/individuals", benefit_id], + path: ["employer/benefits/%1$s/individuals", benefit_id], body: parsed, - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual, options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/company.rb b/lib/finch_api/resources/hris/company.rb similarity index 57% rename from lib/finch-api/resources/hris/company.rb rename to lib/finch_api/resources/hris/company.rb index 05f07846..e47565ac 100644 --- a/lib/finch-api/resources/hris/company.rb +++ b/lib/finch_api/resources/hris/company.rb @@ -4,13 +4,18 @@ module FinchAPI module Resources class HRIS class Company + # @return [FinchAPI::Resources::HRIS::Company::PayStatementItem] + attr_reader :pay_statement_item + # Read basic company data # - # @param params [FinchAPI::Models::HRIS::CompanyRetrieveParams, Hash{Symbol=>Object}] . + # @overload retrieve(request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::HRISCompany] + # + # @see FinchAPI::Models::HRIS::CompanyRetrieveParams def retrieve(params = {}) @client.request( method: :get, @@ -20,9 +25,12 @@ def retrieve(params = {}) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client + @pay_statement_item = FinchAPI::Resources::HRIS::Company::PayStatementItem.new(client: client) end end end diff --git a/lib/finch_api/resources/hris/company/pay_statement_item.rb b/lib/finch_api/resources/hris/company/pay_statement_item.rb new file mode 100644 index 00000000..82a3bd2f --- /dev/null +++ b/lib/finch_api/resources/hris/company/pay_statement_item.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Company + class PayStatementItem + # @return [FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules] + attr_reader :rules + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Retrieve a list of detailed pay statement + # items for the access token's connection account. + # + # @overload list(categories: nil, end_date: nil, name: nil, start_date: nil, type: nil, request_options: {}) + # + # @param categories [Array] + # @param end_date [Date] + # @param name [String] + # @param start_date [Date] + # @param type [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Internal::ResponsesPage] + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItemListParams + def list(params = {}) + parsed, options = FinchAPI::Models::HRIS::Company::PayStatementItemListParams.dump_request(params) + @client.request( + method: :get, + path: "employer/pay-statement-item", + query: parsed, + page: FinchAPI::Internal::ResponsesPage, + model: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse, + options: options + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + @rules = FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules.new(client: client) + end + end + end + end + end +end diff --git a/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb b/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb new file mode 100644 index 00000000..93c52ff0 --- /dev/null +++ b/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Company + class PayStatementItem + class Rules + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Custom rules can be created to associate + # specific attributes to pay statement items depending on the use case. For + # example, pay statement items that meet certain conditions can be labeled as a + # pre-tax 401k. This metadata can be retrieved where pay statement item + # information is available. + # + # @overload create(attributes: nil, conditions: nil, effective_end_date: nil, effective_start_date: nil, entity_type: nil, request_options: {}) + # + # @param attributes [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes] + # @param conditions [Array] + # @param effective_end_date [String, nil] + # @param effective_start_date [String, nil] + # @param entity_type [Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse] + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams + def create(params = {}) + parsed, options = + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams.dump_request(params) + @client.request( + method: :post, + path: "employer/pay-statement-item/rule", + body: parsed, + model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse, + options: options + ) + end + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Update a rule for a pay statement item. + # + # @overload update(rule_id, optional_property: nil, request_options: {}) + # + # @param rule_id [String] + # @param optional_property [Object] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse] + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateParams + def update(rule_id, params = {}) + parsed, options = + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["employer/pay-statement-item/rule/%1$s", rule_id], + body: parsed, + model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse, + options: options + ) + end + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon List all rules of a connection account. + # + # @overload list(request_options: {}) + # + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Internal::ResponsesPage] + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListParams + def list(params = {}) + @client.request( + method: :get, + path: "employer/pay-statement-item/rule", + page: FinchAPI::Internal::ResponsesPage, + model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse, + options: params[:request_options] + ) + end + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Delete a rule for a pay statement item. + # + # @overload delete(rule_id, request_options: {}) + # + # @param rule_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse] + # + # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteParams + def delete(rule_id, params = {}) + @client.request( + method: :delete, + path: ["employer/pay-statement-item/rule/%1$s", rule_id], + model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + end + end + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/directory.rb b/lib/finch_api/resources/hris/directory.rb similarity index 63% rename from lib/finch-api/resources/hris/directory.rb rename to lib/finch_api/resources/hris/directory.rb index 051952f8..a9bc5b30 100644 --- a/lib/finch-api/resources/hris/directory.rb +++ b/lib/finch_api/resources/hris/directory.rb @@ -6,22 +6,22 @@ class HRIS class Directory # Read company directory and organization structure # - # @param params [FinchAPI::Models::HRIS::DirectoryListParams, Hash{Symbol=>Object}] . + # @overload list(limit: nil, offset: nil, request_options: {}) # - # @option params [Integer] :limit Number of employees to return (defaults to all) + # @param limit [Integer] + # @param offset [Integer] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [Integer] :offset Index to start from (defaults to 0) + # @return [FinchAPI::Internal::IndividualsPage] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::IndividualsPage] + # @see FinchAPI::Models::HRIS::DirectoryListParams def list(params = {}) parsed, options = FinchAPI::Models::HRIS::DirectoryListParams.dump_request(params) @client.request( method: :get, path: "employer/directory", query: parsed, - page: FinchAPI::IndividualsPage, + page: FinchAPI::Internal::IndividualsPage, model: FinchAPI::Models::HRIS::IndividualInDirectory, options: options ) @@ -32,6 +32,8 @@ def list(params = {}) # Read company directory and organization structure alias_method :list_individuals, :list + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/documents.rb b/lib/finch_api/resources/hris/documents.rb similarity index 54% rename from lib/finch-api/resources/hris/documents.rb rename to lib/finch_api/resources/hris/documents.rb index 996c99db..72a8b88c 100644 --- a/lib/finch-api/resources/hris/documents.rb +++ b/lib/finch_api/resources/hris/documents.rb @@ -7,21 +7,17 @@ class Documents # **Beta:** This endpoint is in beta and may change. Retrieve a list of # company-wide documents. # - # @param params [FinchAPI::Models::HRIS::DocumentListParams, Hash{Symbol=>Object}] . + # @overload list(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) # - # @option params [Array] :individual_ids Comma-delimited list of stable Finch uuids for each individual. If empty, - # defaults to all individuals - # - # @option params [Integer] :limit Number of documents to return (defaults to all) - # - # @option params [Integer] :offset Index to start from (defaults to 0) - # - # @option params [Array] :types Comma-delimited list of document types to filter on. If empty, defaults to all - # types - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param individual_ids [Array] + # @param limit [Integer] + # @param offset [Integer] + # @param types [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::DocumentListResponse] + # + # @see FinchAPI::Models::HRIS::DocumentListParams def list(params = {}) parsed, options = FinchAPI::Models::HRIS::DocumentListParams.dump_request(params) @client.request( @@ -36,22 +32,25 @@ def list(params = {}) # **Beta:** This endpoint is in beta and may change. Retrieve details of a # specific document by its ID. # - # @param document_id [String] The unique identifier of the document. - # - # @param params [FinchAPI::Models::HRIS::DocumentRetreiveParams, Hash{Symbol=>Object}] . + # @overload retreive(document_id, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param document_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005] + # + # @see FinchAPI::Models::HRIS::DocumentRetreiveParams def retreive(document_id, params = {}) @client.request( method: :get, - path: ["employer/documents/%0s", document_id], + path: ["employer/documents/%1$s", document_id], model: FinchAPI::Models::HRIS::DocumentRetreiveResponse, options: params[:request_options] ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/employments.rb b/lib/finch_api/resources/hris/employments.rb similarity index 58% rename from lib/finch-api/resources/hris/employments.rb rename to lib/finch_api/resources/hris/employments.rb index 524377f0..dc70cec9 100644 --- a/lib/finch-api/resources/hris/employments.rb +++ b/lib/finch_api/resources/hris/employments.rb @@ -6,25 +6,28 @@ class HRIS class Employments # Read individual employment and income data # - # @param params [FinchAPI::Models::HRIS::EmploymentRetrieveManyParams, Hash{Symbol=>Object}] . + # @overload retrieve_many(requests:, request_options: {}) # - # @option params [Array] :requests The array of batch requests. + # @param requests [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::ResponsesPage] # - # @return [FinchAPI::ResponsesPage] + # @see FinchAPI::Models::HRIS::EmploymentRetrieveManyParams def retrieve_many(params) parsed, options = FinchAPI::Models::HRIS::EmploymentRetrieveManyParams.dump_request(params) @client.request( method: :post, path: "employer/employment", body: parsed, - page: FinchAPI::ResponsesPage, + page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::EmploymentDataResponse, options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/individuals.rb b/lib/finch_api/resources/hris/individuals.rb similarity index 55% rename from lib/finch-api/resources/hris/individuals.rb rename to lib/finch_api/resources/hris/individuals.rb index fc4bb17f..cde9f43b 100644 --- a/lib/finch-api/resources/hris/individuals.rb +++ b/lib/finch_api/resources/hris/individuals.rb @@ -6,27 +6,29 @@ class HRIS class Individuals # Read individual data, excluding income and employment data # - # @param params [FinchAPI::Models::HRIS::IndividualRetrieveManyParams, Hash{Symbol=>Object}] . + # @overload retrieve_many(options: nil, requests: nil, request_options: {}) # - # @option params [FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, nil] :options + # @param options [FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, nil] + # @param requests [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [Array] :requests + # @return [FinchAPI::Internal::ResponsesPage] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::ResponsesPage] + # @see FinchAPI::Models::HRIS::IndividualRetrieveManyParams def retrieve_many(params = {}) parsed, options = FinchAPI::Models::HRIS::IndividualRetrieveManyParams.dump_request(params) @client.request( method: :post, path: "employer/individual", body: parsed, - page: FinchAPI::ResponsesPage, + page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::IndividualResponse, options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/pay_statements.rb b/lib/finch_api/resources/hris/pay_statements.rb similarity index 62% rename from lib/finch-api/resources/hris/pay_statements.rb rename to lib/finch_api/resources/hris/pay_statements.rb index 309e6d3d..1111a9c4 100644 --- a/lib/finch-api/resources/hris/pay_statements.rb +++ b/lib/finch_api/resources/hris/pay_statements.rb @@ -9,25 +9,28 @@ class PayStatements # Deduction and contribution types are supported by the payroll systems that # supports Benefits. # - # @param params [FinchAPI::Models::HRIS::PayStatementRetrieveManyParams, Hash{Symbol=>Object}] . + # @overload retrieve_many(requests:, request_options: {}) # - # @option params [Array] :requests The array of batch requests. + # @param requests [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::ResponsesPage] # - # @return [FinchAPI::ResponsesPage] + # @see FinchAPI::Models::HRIS::PayStatementRetrieveManyParams def retrieve_many(params) parsed, options = FinchAPI::Models::HRIS::PayStatementRetrieveManyParams.dump_request(params) @client.request( method: :post, path: "employer/pay-statement", body: parsed, - page: FinchAPI::ResponsesPage, + page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::PayStatementResponse, options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/hris/payments.rb b/lib/finch_api/resources/hris/payments.rb similarity index 54% rename from lib/finch-api/resources/hris/payments.rb rename to lib/finch_api/resources/hris/payments.rb index e54785ca..9c27d2f7 100644 --- a/lib/finch-api/resources/hris/payments.rb +++ b/lib/finch_api/resources/hris/payments.rb @@ -6,29 +6,29 @@ class HRIS class Payments # Read payroll and contractor related payments by the company. # - # @param params [FinchAPI::Models::HRIS::PaymentListParams, Hash{Symbol=>Object}] . + # @overload list(end_date:, start_date:, request_options: {}) # - # @option params [Date] :end_date The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` - # format. + # @param end_date [Date] + # @param start_date [Date] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [Date] :start_date The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` - # format. + # @return [FinchAPI::Internal::SinglePage] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options - # - # @return [FinchAPI::SinglePage] + # @see FinchAPI::Models::HRIS::PaymentListParams def list(params) parsed, options = FinchAPI::Models::HRIS::PaymentListParams.dump_request(params) @client.request( method: :get, path: "employer/payment", query: parsed, - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::HRIS::Payment, options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/jobs.rb b/lib/finch_api/resources/jobs.rb similarity index 94% rename from lib/finch-api/resources/jobs.rb rename to lib/finch_api/resources/jobs.rb index 06d80494..480b6854 100644 --- a/lib/finch-api/resources/jobs.rb +++ b/lib/finch_api/resources/jobs.rb @@ -9,6 +9,8 @@ class Jobs # @return [FinchAPI::Resources::Jobs::Manual] attr_reader :manual + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/jobs/automated.rb b/lib/finch_api/resources/jobs/automated.rb similarity index 74% rename from lib/finch-api/resources/jobs/automated.rb rename to lib/finch_api/resources/jobs/automated.rb index 66d2b505..3afa9591 100644 --- a/lib/finch-api/resources/jobs/automated.rb +++ b/lib/finch_api/resources/jobs/automated.rb @@ -19,15 +19,15 @@ class Automated # This endpoint is available for _Scale_ tier customers as an add-on. To request # access to this endpoint, please contact your Finch account manager. # - # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams, Hash{Symbol=>Object}] . + # @overload create(type:, params:, request_options: {}) # - # @option params [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] :type The type of job to start. - # - # @option params [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] :params - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param type [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] + # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Jobs::AutomatedCreateResponse] + # + # @see FinchAPI::Models::Jobs::AutomatedCreateParams def create(params) parsed, options = FinchAPI::Models::Jobs::AutomatedCreateParams.dump_request(params) @client.request( @@ -41,17 +41,18 @@ def create(params) # Get an automated job by `job_id`. # - # @param job_id [String] - # - # @param params [FinchAPI::Models::Jobs::AutomatedRetrieveParams, Hash{Symbol=>Object}] . + # @overload retrieve(job_id, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param job_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Jobs::AutomatedAsyncJob] + # + # @see FinchAPI::Models::Jobs::AutomatedRetrieveParams def retrieve(job_id, params = {}) @client.request( method: :get, - path: ["jobs/automated/%0s", job_id], + path: ["jobs/automated/%1$s", job_id], model: FinchAPI::Models::Jobs::AutomatedAsyncJob, options: params[:request_options] ) @@ -61,15 +62,15 @@ def retrieve(job_id, params = {}) # jobs are sorted in descending order by submission time. For scheduled jobs such # as data syncs, only the next scheduled job is shown. # - # @param params [FinchAPI::Models::Jobs::AutomatedListParams, Hash{Symbol=>Object}] . - # - # @option params [Integer] :limit Number of items to return - # - # @option params [Integer] :offset Index to start from (defaults to 0) + # @overload list(limit: nil, offset: nil, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param limit [Integer] + # @param offset [Integer] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Jobs::AutomatedListResponse] + # + # @see FinchAPI::Models::Jobs::AutomatedListParams def list(params = {}) parsed, options = FinchAPI::Models::Jobs::AutomatedListParams.dump_request(params) @client.request( @@ -81,6 +82,8 @@ def list(params = {}) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/jobs/manual.rb b/lib/finch_api/resources/jobs/manual.rb similarity index 71% rename from lib/finch-api/resources/jobs/manual.rb rename to lib/finch_api/resources/jobs/manual.rb index a6cdc88e..15a00d99 100644 --- a/lib/finch-api/resources/jobs/manual.rb +++ b/lib/finch_api/resources/jobs/manual.rb @@ -7,22 +7,25 @@ class Manual # Get a manual job by `job_id`. Manual jobs are completed by a human and include # Assisted Benefits jobs. # - # @param job_id [String] - # - # @param params [FinchAPI::Models::Jobs::ManualRetrieveParams, Hash{Symbol=>Object}] . + # @overload retrieve(job_id, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param job_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Jobs::ManualAsyncJob] + # + # @see FinchAPI::Models::Jobs::ManualRetrieveParams def retrieve(job_id, params = {}) @client.request( method: :get, - path: ["jobs/manual/%0s", job_id], + path: ["jobs/manual/%1$s", job_id], model: FinchAPI::Models::Jobs::ManualAsyncJob, options: params[:request_options] ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/payroll.rb b/lib/finch_api/resources/payroll.rb similarity index 92% rename from lib/finch-api/resources/payroll.rb rename to lib/finch_api/resources/payroll.rb index ae4d0c07..87a53271 100644 --- a/lib/finch-api/resources/payroll.rb +++ b/lib/finch_api/resources/payroll.rb @@ -6,6 +6,8 @@ class Payroll # @return [FinchAPI::Resources::Payroll::PayGroups] attr_reader :pay_groups + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/payroll/pay_groups.rb b/lib/finch_api/resources/payroll/pay_groups.rb similarity index 59% rename from lib/finch-api/resources/payroll/pay_groups.rb rename to lib/finch_api/resources/payroll/pay_groups.rb index 2c07d48e..b896dccc 100644 --- a/lib/finch-api/resources/payroll/pay_groups.rb +++ b/lib/finch_api/resources/payroll/pay_groups.rb @@ -6,17 +6,18 @@ class Payroll class PayGroups # Read information from a single pay group # - # @param pay_group_id [String] - # - # @param params [FinchAPI::Models::Payroll::PayGroupRetrieveParams, Hash{Symbol=>Object}] . + # @overload retrieve(pay_group_id, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param pay_group_id [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Payroll::PayGroupRetrieveResponse] + # + # @see FinchAPI::Models::Payroll::PayGroupRetrieveParams def retrieve(pay_group_id, params = {}) @client.request( method: :get, - path: ["employer/pay-groups/%0s", pay_group_id], + path: ["employer/pay-groups/%1$s", pay_group_id], model: FinchAPI::Models::Payroll::PayGroupRetrieveResponse, options: params[:request_options] ) @@ -24,27 +25,29 @@ def retrieve(pay_group_id, params = {}) # Read company pay groups and frequencies # - # @param params [FinchAPI::Models::Payroll::PayGroupListParams, Hash{Symbol=>Object}] . - # - # @option params [String] :individual_id + # @overload list(individual_id: nil, pay_frequencies: nil, request_options: {}) # - # @option params [Array] :pay_frequencies + # @param individual_id [String] + # @param pay_frequencies [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @return [FinchAPI::Internal::SinglePage] # - # @return [FinchAPI::SinglePage] + # @see FinchAPI::Models::Payroll::PayGroupListParams def list(params = {}) parsed, options = FinchAPI::Models::Payroll::PayGroupListParams.dump_request(params) @client.request( method: :get, path: "employer/pay-groups", query: parsed, - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::Payroll::PayGroupListResponse, options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/providers.rb b/lib/finch_api/resources/providers.rb similarity index 60% rename from lib/finch-api/resources/providers.rb rename to lib/finch_api/resources/providers.rb index 3edff480..3f22475f 100644 --- a/lib/finch-api/resources/providers.rb +++ b/lib/finch_api/resources/providers.rb @@ -5,21 +5,25 @@ module Resources class Providers # Return details on all available payroll and HR systems. # - # @param params [FinchAPI::Models::ProviderListParams, Hash{Symbol=>Object}] . + # @overload list(request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [FinchAPI::SinglePage] + # @return [FinchAPI::Internal::SinglePage] + # + # @see FinchAPI::Models::ProviderListParams def list(params = {}) @client.request( method: :get, path: "providers", - page: FinchAPI::SinglePage, + page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::Provider, options: params[:request_options] ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch_api/resources/request_forwarding.rb b/lib/finch_api/resources/request_forwarding.rb new file mode 100644 index 00000000..38131d3f --- /dev/null +++ b/lib/finch_api/resources/request_forwarding.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class RequestForwarding + # The Forward API allows you to make direct requests to an employment system. If + # Finch’s unified API doesn’t have a data model that cleanly fits your needs, then + # Forward allows you to push or pull data models directly against an integration’s + # API. + # + # @overload forward(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}) + # + # @param method_ [String] + # @param route [String] + # @param data [String, nil] + # @param headers [Object, nil] + # @param params [Object, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::RequestForwardingForwardResponse] + # + # @see FinchAPI::Models::RequestForwardingForwardParams + def forward(params) + parsed, options = FinchAPI::Models::RequestForwardingForwardParams.dump_request(params) + @client.request( + method: :post, + path: "forward", + body: parsed, + model: FinchAPI::Models::RequestForwardingForwardResponse, + options: options + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/finch-api/resources/sandbox.rb b/lib/finch_api/resources/sandbox.rb similarity index 97% rename from lib/finch-api/resources/sandbox.rb rename to lib/finch_api/resources/sandbox.rb index 6e34091f..d93a39b9 100644 --- a/lib/finch-api/resources/sandbox.rb +++ b/lib/finch_api/resources/sandbox.rb @@ -24,6 +24,8 @@ class Sandbox # @return [FinchAPI::Resources::Sandbox::Jobs] attr_reader :jobs + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch_api/resources/sandbox/company.rb b/lib/finch_api/resources/sandbox/company.rb new file mode 100644 index 00000000..352ac149 --- /dev/null +++ b/lib/finch_api/resources/sandbox/company.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Company + # Update a sandbox company's data + # + # @overload update(accounts:, departments:, ein:, entity:, legal_name:, locations:, primary_email:, primary_phone_number:, request_options: {}) + # + # @param accounts [Array, nil] + # @param departments [Array, nil] + # @param ein [String, nil] + # @param entity [FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, nil] + # @param legal_name [String, nil] + # @param locations [Array, nil] + # @param primary_email [String, nil] + # @param primary_phone_number [String, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::Sandbox::CompanyUpdateResponse] + # + # @see FinchAPI::Models::Sandbox::CompanyUpdateParams + def update(params) + parsed, options = FinchAPI::Models::Sandbox::CompanyUpdateParams.dump_request(params) + @client.request( + method: :put, + path: "sandbox/company", + body: parsed, + model: FinchAPI::Models::Sandbox::CompanyUpdateResponse, + options: options + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/connections.rb b/lib/finch_api/resources/sandbox/connections.rb similarity index 56% rename from lib/finch-api/resources/sandbox/connections.rb rename to lib/finch_api/resources/sandbox/connections.rb index f1c1c117..e8fbe3f5 100644 --- a/lib/finch-api/resources/sandbox/connections.rb +++ b/lib/finch_api/resources/sandbox/connections.rb @@ -9,21 +9,17 @@ class Connections # Create a new connection (new company/provider pair) with a new account # - # @param params [FinchAPI::Models::Sandbox::ConnectionCreateParams, Hash{Symbol=>Object}] . + # @overload create(provider_id:, authentication_type: nil, employee_size: nil, products: nil, request_options: {}) # - # @option params [String] :provider_id The provider associated with the connection - # - # @option params [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType] :authentication_type - # - # @option params [Integer] :employee_size Optional: the size of the employer to be created with this connection. Defaults - # to 20. Note that if this is higher than 100, historical payroll data will not be - # generated, and instead only one pay period will be created. - # - # @option params [Array] :products - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param provider_id [String] + # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType] + # @param employee_size [Integer] + # @param products [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Sandbox::ConnectionCreateResponse] + # + # @see FinchAPI::Models::Sandbox::ConnectionCreateParams def create(params) parsed, options = FinchAPI::Models::Sandbox::ConnectionCreateParams.dump_request(params) @client.request( @@ -35,6 +31,8 @@ def create(params) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/sandbox/connections/accounts.rb b/lib/finch_api/resources/sandbox/connections/accounts.rb similarity index 61% rename from lib/finch-api/resources/sandbox/connections/accounts.rb rename to lib/finch_api/resources/sandbox/connections/accounts.rb index e1589b6b..378d2dd7 100644 --- a/lib/finch-api/resources/sandbox/connections/accounts.rb +++ b/lib/finch_api/resources/sandbox/connections/accounts.rb @@ -7,20 +7,17 @@ class Connections class Accounts # Create a new account for an existing connection (company/provider pair) # - # @param params [FinchAPI::Models::Sandbox::Connections::AccountCreateParams, Hash{Symbol=>Object}] . + # @overload create(company_id:, provider_id:, authentication_type: nil, products: nil, request_options: {}) # - # @option params [String] :company_id - # - # @option params [String] :provider_id The provider associated with the `access_token` - # - # @option params [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType] :authentication_type - # - # @option params [Array] :products Optional, defaults to Organization products (`company`, `directory`, - # `employment`, `individual`) - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param company_id [String] + # @param provider_id [String] + # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType] + # @param products [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Sandbox::Connections::AccountCreateResponse] + # + # @see FinchAPI::Models::Sandbox::Connections::AccountCreateParams def create(params) parsed, options = FinchAPI::Models::Sandbox::Connections::AccountCreateParams.dump_request(params) @client.request( @@ -35,13 +32,14 @@ def create(params) # Update an existing sandbox account. Change the connection status to understand # how the Finch API responds. # - # @param params [FinchAPI::Models::Sandbox::Connections::AccountUpdateParams, Hash{Symbol=>Object}] . - # - # @option params [Symbol, FinchAPI::Models::ConnectionStatusType] :connection_status + # @overload update(connection_status: nil, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param connection_status [Symbol, FinchAPI::Models::ConnectionStatusType] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse] + # + # @see FinchAPI::Models::Sandbox::Connections::AccountUpdateParams def update(params = {}) parsed, options = FinchAPI::Models::Sandbox::Connections::AccountUpdateParams.dump_request(params) @client.request( @@ -53,6 +51,8 @@ def update(params = {}) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/sandbox/directory.rb b/lib/finch_api/resources/sandbox/directory.rb similarity index 57% rename from lib/finch-api/resources/sandbox/directory.rb rename to lib/finch_api/resources/sandbox/directory.rb index 04e5e44d..ad2da90e 100644 --- a/lib/finch-api/resources/sandbox/directory.rb +++ b/lib/finch_api/resources/sandbox/directory.rb @@ -6,25 +6,27 @@ class Sandbox class Directory # Add new individuals to a sandbox company # - # @param params [FinchAPI::Models::Sandbox::DirectoryCreateParams, Hash{Symbol=>Object}] . + # @overload create(body: nil, request_options: {}) # - # @option params [Array] :body Array of individuals to create. Takes all combined fields from `/individual` and - # `/employment` endpoints. All fields are optional. - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param body [Array] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Array] + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams def create(params = {}) parsed, options = FinchAPI::Models::Sandbox::DirectoryCreateParams.dump_request(params) @client.request( method: :post, path: "sandbox/directory", body: parsed[:body], - model: FinchAPI::ArrayOf[FinchAPI::Unknown], + model: FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown], options: options ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch_api/resources/sandbox/employment.rb b/lib/finch_api/resources/sandbox/employment.rb new file mode 100644 index 00000000..61152a87 --- /dev/null +++ b/lib/finch_api/resources/sandbox/employment.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Employment + # Update sandbox employment + # + # @overload update(individual_id, class_code: nil, custom_fields: nil, department: nil, employment: nil, employment_status: nil, end_date: nil, first_name: nil, income: nil, income_history: nil, is_active: nil, last_name: nil, latest_rehire_date: nil, location: nil, manager: nil, middle_name: nil, source_id: nil, start_date: nil, title: nil, request_options: {}) + # + # @param individual_id [String] + # @param class_code [String, nil] + # @param custom_fields [Array] + # @param department [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, nil] + # @param employment [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, nil] + # @param employment_status [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus, nil] + # @param end_date [String, nil] + # @param first_name [String, nil] + # @param income [FinchAPI::Models::Income, nil] + # @param income_history [Array, nil] + # @param is_active [Boolean, nil] + # @param last_name [String, nil] + # @param latest_rehire_date [String, nil] + # @param location [FinchAPI::Models::Location, nil] + # @param manager [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, nil] + # @param middle_name [String, nil] + # @param source_id [String] + # @param start_date [String, nil] + # @param title [String, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateResponse] + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateParams + def update(individual_id, params = {}) + parsed, options = FinchAPI::Models::Sandbox::EmploymentUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["sandbox/employment/%1$s", individual_id], + body: parsed, + model: FinchAPI::Models::Sandbox::EmploymentUpdateResponse, + options: options + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch_api/resources/sandbox/individual.rb b/lib/finch_api/resources/sandbox/individual.rb new file mode 100644 index 00000000..0ad5ddeb --- /dev/null +++ b/lib/finch_api/resources/sandbox/individual.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Individual + # Update sandbox individual + # + # @overload update(individual_id, dob: nil, emails: nil, encrypted_ssn: nil, ethnicity: nil, first_name: nil, gender: nil, last_name: nil, middle_name: nil, phone_numbers: nil, preferred_name: nil, residence: nil, ssn: nil, request_options: {}) + # + # @param individual_id [String] + # @param dob [String, nil] + # @param emails [Array, nil] + # @param encrypted_ssn [String, nil] + # @param ethnicity [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity, nil] + # @param first_name [String, nil] + # @param gender [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender, nil] + # @param last_name [String, nil] + # @param middle_name [String, nil] + # @param phone_numbers [Array, nil] + # @param preferred_name [String, nil] + # @param residence [FinchAPI::Models::Location, nil] + # @param ssn [String, nil] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [FinchAPI::Models::Sandbox::IndividualUpdateResponse] + # + # @see FinchAPI::Models::Sandbox::IndividualUpdateParams + def update(individual_id, params = {}) + parsed, options = FinchAPI::Models::Sandbox::IndividualUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["sandbox/individual/%1$s", individual_id], + body: parsed, + model: FinchAPI::Models::Sandbox::IndividualUpdateResponse, + options: options + ) + end + + # @api private + # + # @param client [FinchAPI::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/jobs.rb b/lib/finch_api/resources/sandbox/jobs.rb similarity index 72% rename from lib/finch-api/resources/sandbox/jobs.rb rename to lib/finch_api/resources/sandbox/jobs.rb index f98aaf4e..09501e74 100644 --- a/lib/finch-api/resources/sandbox/jobs.rb +++ b/lib/finch_api/resources/sandbox/jobs.rb @@ -9,13 +9,14 @@ class Jobs # Enqueue a new sandbox job # - # @param params [FinchAPI::Models::Sandbox::JobCreateParams, Hash{Symbol=>Object}] . + # @overload create(type:, request_options: {}) # - # @option params [Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type] :type The type of job to start. Currently the only supported type is `data_sync_all` - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param type [Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Sandbox::JobCreateResponse] + # + # @see FinchAPI::Models::Sandbox::JobCreateParams def create(params) parsed, options = FinchAPI::Models::Sandbox::JobCreateParams.dump_request(params) @client.request( @@ -27,6 +28,8 @@ def create(params) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/sandbox/jobs/configuration.rb b/lib/finch_api/resources/sandbox/jobs/configuration.rb similarity index 60% rename from lib/finch-api/resources/sandbox/jobs/configuration.rb rename to lib/finch_api/resources/sandbox/jobs/configuration.rb index c0464b09..00b07bf3 100644 --- a/lib/finch-api/resources/sandbox/jobs/configuration.rb +++ b/lib/finch_api/resources/sandbox/jobs/configuration.rb @@ -7,31 +7,33 @@ class Jobs class Configuration # Get configurations for sandbox jobs # - # @param params [FinchAPI::Models::Sandbox::Jobs::ConfigurationRetrieveParams, Hash{Symbol=>Object}] . + # @overload retrieve(request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Array] + # + # @see FinchAPI::Models::Sandbox::Jobs::ConfigurationRetrieveParams def retrieve(params = {}) @client.request( method: :get, path: "sandbox/jobs/configuration", - model: FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration], + model: FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration], options: params[:request_options] ) end # Update configurations for sandbox jobs # - # @param params [FinchAPI::Models::Sandbox::Jobs::ConfigurationUpdateParams, Hash{Symbol=>Object}] . - # - # @option params [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus] :completion_status - # - # @option params [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type] :type + # @overload update(completion_status:, type:, request_options: {}) # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param completion_status [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus] + # @param type [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration] + # + # @see FinchAPI::Models::Sandbox::Jobs::ConfigurationUpdateParams def update(params) parsed, options = FinchAPI::Models::Sandbox::Jobs::ConfigurationUpdateParams.dump_request(params) @client.request( @@ -43,6 +45,8 @@ def update(params) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/sandbox/payment.rb b/lib/finch_api/resources/sandbox/payment.rb similarity index 63% rename from lib/finch-api/resources/sandbox/payment.rb rename to lib/finch_api/resources/sandbox/payment.rb index 753ae9ac..e9c982f0 100644 --- a/lib/finch-api/resources/sandbox/payment.rb +++ b/lib/finch_api/resources/sandbox/payment.rb @@ -6,17 +6,16 @@ class Sandbox class Payment # Add a new sandbox payment # - # @param params [FinchAPI::Models::Sandbox::PaymentCreateParams, Hash{Symbol=>Object}] . + # @overload create(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}) # - # @option params [String] :end_date - # - # @option params [Array] :pay_statements - # - # @option params [String] :start_date - # - # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # @param end_date [String] + # @param pay_statements [Array] + # @param start_date [String] + # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Sandbox::PaymentCreateResponse] + # + # @see FinchAPI::Models::Sandbox::PaymentCreateParams def create(params = {}) parsed, options = FinchAPI::Models::Sandbox::PaymentCreateParams.dump_request(params) @client.request( @@ -28,6 +27,8 @@ def create(params = {}) ) end + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/resources/webhooks.rb b/lib/finch_api/resources/webhooks.rb similarity index 87% rename from lib/finch-api/resources/webhooks.rb rename to lib/finch_api/resources/webhooks.rb index c82af6c9..ca5f8a14 100644 --- a/lib/finch-api/resources/webhooks.rb +++ b/lib/finch_api/resources/webhooks.rb @@ -3,6 +3,8 @@ module FinchAPI module Resources class Webhooks + # @api private + # # @param client [FinchAPI::Client] def initialize(client:) @client = client diff --git a/lib/finch-api/version.rb b/lib/finch_api/version.rb similarity index 61% rename from lib/finch-api/version.rb rename to lib/finch_api/version.rb index 55cd0870..143ed57a 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.5" + VERSION = "0.1.0.pre.alpha.6" end diff --git a/manifest.yaml b/manifest.yaml index fa9c3e5e..556686f5 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,4 +1,5 @@ dependencies: + - English - cgi - date - erb diff --git a/rbi/lib/finch-api/errors.rbi b/rbi/lib/finch-api/errors.rbi deleted file mode 100644 index 7ffea6da..00000000 --- a/rbi/lib/finch-api/errors.rbi +++ /dev/null @@ -1,144 +0,0 @@ -# typed: strong - -module FinchAPI - class Error < StandardError - sig { returns(T.nilable(StandardError)) } - attr_accessor :cause - end - - class ConversionError < FinchAPI::Error - end - - class APIError < FinchAPI::Error - sig { returns(URI::Generic) } - attr_accessor :url - - sig { returns(T.nilable(Integer)) } - attr_accessor :status - - sig { returns(T.nilable(T.anything)) } - attr_accessor :body - - # @api private - sig do - params( - url: URI::Generic, - status: T.nilable(Integer), - body: T.nilable(Object), - request: NilClass, - response: NilClass, - message: T.nilable(String) - ) - .returns(T.attached_class) - end - def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil) - end - end - - class APIConnectionError < FinchAPI::APIError - sig { void } - attr_accessor :status - - sig { void } - attr_accessor :body - - # @api private - sig do - params( - url: URI::Generic, - status: NilClass, - body: NilClass, - request: NilClass, - response: NilClass, - message: T.nilable(String) - ) - .returns(T.attached_class) - end - 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, - status: NilClass, - body: NilClass, - request: NilClass, - response: NilClass, - message: T.nilable(String) - ) - .returns(T.attached_class) - end - 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, - status: Integer, - body: T.nilable(Object), - request: NilClass, - response: NilClass, - message: T.nilable(String) - ) - .returns(T.attached_class) - end - def self.for(url:, status:, body:, request:, response:, message: nil) - end - - sig { returns(Integer) } - attr_accessor :status - - # @api private - sig do - params( - url: URI::Generic, - status: Integer, - body: T.nilable(Object), - request: NilClass, - response: NilClass, - message: T.nilable(String) - ) - .returns(T.attached_class) - end - def self.new(url:, status:, body:, request:, response:, message: nil) - end - end - - class BadRequestError < FinchAPI::APIStatusError - HTTP_STATUS = 400 - end - - class AuthenticationError < FinchAPI::APIStatusError - HTTP_STATUS = 401 - end - - class PermissionDeniedError < FinchAPI::APIStatusError - HTTP_STATUS = 403 - end - - class NotFoundError < FinchAPI::APIStatusError - HTTP_STATUS = 404 - end - - class ConflictError < FinchAPI::APIStatusError - HTTP_STATUS = 409 - end - - class UnprocessableEntityError < FinchAPI::APIStatusError - HTTP_STATUS = 422 - end - - class RateLimitError < FinchAPI::APIStatusError - HTTP_STATUS = 429 - end - - class InternalServerError < FinchAPI::APIStatusError - HTTP_STATUS = T.let((500..), T::Range[Integer]) - end -end diff --git a/rbi/lib/finch-api/individuals_page.rbi b/rbi/lib/finch-api/individuals_page.rbi deleted file mode 100644 index 3e0af2ef..00000000 --- a/rbi/lib/finch-api/individuals_page.rbi +++ /dev/null @@ -1,19 +0,0 @@ -# typed: strong - -module FinchAPI - class IndividualsPage - include FinchAPI::Type::BasePage - - Elem = type_member - - sig { returns(T.nilable(T::Array[Elem])) } - attr_accessor :individuals - - sig { returns(FinchAPI::Models::Paging) } - attr_accessor :paging - - sig { returns(String) } - def inspect - end - end -end diff --git a/rbi/lib/finch-api/models/account_disconnect_params.rbi b/rbi/lib/finch-api/models/account_disconnect_params.rbi deleted file mode 100644 index 5b89384f..00000000 --- a/rbi/lib/finch-api/models/account_disconnect_params.rbi +++ /dev/null @@ -1,25 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - class AccountDisconnectParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end -end diff --git a/rbi/lib/finch-api/models/account_introspect_params.rbi b/rbi/lib/finch-api/models/account_introspect_params.rbi deleted file mode 100644 index 39f33a32..00000000 --- a/rbi/lib/finch-api/models/account_introspect_params.rbi +++ /dev/null @@ -1,25 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - class AccountIntrospectParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end -end diff --git a/rbi/lib/finch-api/models/hris/benefit_list_params.rbi b/rbi/lib/finch-api/models/hris/benefit_list_params.rbi deleted file mode 100644 index a6c61cec..00000000 --- a/rbi/lib/finch-api/models/hris/benefit_list_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module HRIS - class BenefitListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi b/rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi deleted file mode 100644 index f7fb6803..00000000 --- a/rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module HRIS - class BenefitListSupportedBenefitsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi b/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi deleted file mode 100644 index aab7154e..00000000 --- a/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module HRIS - class BenefitRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi deleted file mode 100644 index d6f289f6..00000000 --- a/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi +++ /dev/null @@ -1,29 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module HRIS - module Benefits - class IndividualEnrolledIDsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi b/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi deleted file mode 100644 index 6032b03c..00000000 --- a/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module HRIS - class CompanyRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/hris/document_retreive_params.rbi b/rbi/lib/finch-api/models/hris/document_retreive_params.rbi deleted file mode 100644 index 63fee264..00000000 --- a/rbi/lib/finch-api/models/hris/document_retreive_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module HRIS - class DocumentRetreiveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi b/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi deleted file mode 100644 index 5f5b5afb..00000000 --- a/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module Jobs - class AutomatedRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi b/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi deleted file mode 100644 index 225181dd..00000000 --- a/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module Jobs - class ManualRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi deleted file mode 100644 index 95823d0e..00000000 --- a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module Payroll - class PayGroupRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end -end diff --git a/rbi/lib/finch-api/models/provider_list_params.rbi b/rbi/lib/finch-api/models/provider_list_params.rbi deleted file mode 100644 index 129b1321..00000000 --- a/rbi/lib/finch-api/models/provider_list_params.rbi +++ /dev/null @@ -1,25 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - class ProviderListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end -end diff --git a/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi b/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi deleted file mode 100644 index db5f70a4..00000000 --- a/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi +++ /dev/null @@ -1,9 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module Sandbox - DirectoryCreateResponse = T.let(FinchAPI::ArrayOf[FinchAPI::Unknown], FinchAPI::Type::Converter) - end - end -end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi deleted file mode 100644 index c7b9a8d3..00000000 --- a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi +++ /dev/null @@ -1,29 +0,0 @@ -# typed: strong - -module FinchAPI - module Models - module Sandbox - module Jobs - class ConfigurationRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - 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}) } - def to_hash - end - end - end - end - end -end diff --git a/rbi/lib/finch-api/page.rbi b/rbi/lib/finch-api/page.rbi deleted file mode 100644 index 67e95f32..00000000 --- a/rbi/lib/finch-api/page.rbi +++ /dev/null @@ -1,19 +0,0 @@ -# typed: strong - -module FinchAPI - class Page - include FinchAPI::Type::BasePage - - Elem = type_member - - sig { returns(T.nilable(T::Array[Elem])) } - attr_accessor :data - - sig { returns(FinchAPI::Models::Paging) } - attr_accessor :paging - - sig { returns(String) } - def inspect - end - end -end diff --git a/rbi/lib/finch-api/responses_page.rbi b/rbi/lib/finch-api/responses_page.rbi deleted file mode 100644 index 0ba0a1a3..00000000 --- a/rbi/lib/finch-api/responses_page.rbi +++ /dev/null @@ -1,16 +0,0 @@ -# typed: strong - -module FinchAPI - class ResponsesPage - include FinchAPI::Type::BasePage - - Elem = type_member - - sig { returns(T.nilable(T::Array[Elem])) } - attr_accessor :responses - - 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 deleted file mode 100644 index 4e812475..00000000 --- a/rbi/lib/finch-api/single_page.rbi +++ /dev/null @@ -1,25 +0,0 @@ -# typed: strong - -module FinchAPI - class SinglePage < ::Array - include FinchAPI::Type::BasePage - - Elem = type_member - - sig { override.returns(T::Boolean) } - def next_page? - end - - sig { override.returns(T.self_type) } - def next_page - end - - sig { override.params(blk: T.proc.params(arg0: Elem).void).void } - def auto_paging_each(&blk) - end - - sig { returns(String) } - def inspect - end - end -end diff --git a/rbi/lib/finch-api/transport/base_client.rbi b/rbi/lib/finch-api/transport/base_client.rbi deleted file mode 100644 index f0b26490..00000000 --- a/rbi/lib/finch-api/transport/base_client.rbi +++ /dev/null @@ -1,204 +0,0 @@ -# typed: strong - -module FinchAPI - module Transport - # @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::Type::BasePage[FinchAPI::BaseModel]]), - stream: T.nilable(T::Class[T.anything]), - model: T.nilable(FinchAPI::Type::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] - - class << self - # @api private - sig { params(req: FinchAPI::Transport::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::Transport::BaseClient::RequestInputShape, - status: Integer, - response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) - ) - .returns(FinchAPI::Transport::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(FinchAPI::Transport::PooledNetRequester) } - attr_accessor :requester - - # @api private - sig do - params( - base_url: String, - timeout: Float, - max_retries: Integer, - initial_retry_delay: Float, - max_retry_delay: Float, - headers: T::Hash[String, - T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))], - idempotency_header: T.nilable(String) - ) - .returns(T.attached_class) - end - def self.new( - base_url:, - timeout: 0.0, - max_retries: 0, - initial_retry_delay: 0.0, - max_retry_delay: 0.0, - headers: {}, - idempotency_header: nil - ) - 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::Transport::BaseClient::RequestComponentsShape, opts: FinchAPI::Util::AnyHash) - .returns(FinchAPI::Transport::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::Transport::BaseClient::RequestInputShape, - redirect_count: Integer, - retry_count: Integer, - send_retry_header: T::Boolean - ) - .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) - end - private def send_request(request, redirect_count:, retry_count:, send_retry_header:) - end - - # Execute the request specified by `req`. This is the method that all resource - # methods call into. - sig do - params( - method: Symbol, - path: T.any(String, T::Array[String]), - query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), - headers: T.nilable( - T::Hash[String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - )] - ), - body: T.nilable(T.anything), - unwrap: T.nilable(Symbol), - page: T.nilable(T::Class[FinchAPI::Type::BasePage[FinchAPI::BaseModel]]), - stream: T.nilable(T::Class[T.anything]), - model: T.nilable(FinchAPI::Type::Converter::Input), - options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) - ) - .returns(T.anything) - end - def request( - method, - path, - query: {}, - headers: {}, - body: nil, - unwrap: nil, - page: nil, - stream: nil, - model: FinchAPI::Unknown, - options: {} - ) - end - - sig { returns(String) } - def inspect - end - end - end -end diff --git a/rbi/lib/finch-api/transport/pooled_net_requester.rbi b/rbi/lib/finch-api/transport/pooled_net_requester.rbi deleted file mode 100644 index 36effc04..00000000 --- a/rbi/lib/finch-api/transport/pooled_net_requester.rbi +++ /dev/null @@ -1,64 +0,0 @@ -# typed: strong - -module FinchAPI - module Transport - # @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 - - # from the golang stdlib - # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 - KEEP_ALIVE_TIMEOUT = 30 - - 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 - - # @api private - sig do - params( - request: FinchAPI::Transport::PooledNetRequester::RequestShape, - blk: T.proc.params(arg0: String).void - ) - .returns(Net::HTTPGenericRequest) - end - def build_request(request, &blk) - end - end - - # @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::Transport::PooledNetRequester::RequestShape) - .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) - end - def execute(request) - end - - # @api private - sig { params(size: Integer).returns(T.attached_class) } - def self.new(size: Etc.nprocessors) - end - end - end -end diff --git a/rbi/lib/finch-api/type.rbi b/rbi/lib/finch-api/type.rbi deleted file mode 100644 index bf175993..00000000 --- a/rbi/lib/finch-api/type.rbi +++ /dev/null @@ -1,23 +0,0 @@ -# typed: strong - -module FinchAPI - Unknown = FinchAPI::Type::Unknown - - BooleanModel = FinchAPI::Type::BooleanModel - - Enum = FinchAPI::Type::Enum - - Union = FinchAPI::Type::Union - - ArrayOf = FinchAPI::Type::ArrayOf - - HashOf = FinchAPI::Type::HashOf - - BaseModel = FinchAPI::Type::BaseModel - - RequestParameters = FinchAPI::Type::RequestParameters - - # This module contains various type declarations. - module Type - end -end diff --git a/rbi/lib/finch-api/type/array_of.rbi b/rbi/lib/finch-api/type/array_of.rbi deleted file mode 100644 index e8efa199..00000000 --- a/rbi/lib/finch-api/type/array_of.rbi +++ /dev/null @@ -1,82 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - # - # Array of items of a given type. - class ArrayOf - include FinchAPI::Type::Converter - - abstract! - final! - - Elem = type_member(:out) - - sig(:final) do - params( - type_info: T.any( - FinchAPI::Util::AnyHash, - T.proc.returns(FinchAPI::Type::Converter::Input), - FinchAPI::Type::Converter::Input - ), - spec: FinchAPI::Util::AnyHash - ) - .returns(T.attached_class) - end - def self.[](type_info, spec = {}) - end - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - # @api private - sig(:final) do - override - .params(value: T.any(T::Enumerable[Elem], T.anything), state: FinchAPI::Type::Converter::State) - .returns(T.any(T::Array[T.anything], T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig(:final) do - override - .params(value: T.any(T::Enumerable[Elem], T.anything)) - .returns(T.any(T::Array[T.anything], T.anything)) - end - def dump(value) - end - - # @api private - sig(:final) { returns(Elem) } - protected def item_type - end - - # @api private - sig(:final) { returns(T::Boolean) } - protected def nilable? - end - - # @api private - sig(:final) do - params( - type_info: T.any( - FinchAPI::Util::AnyHash, - T.proc.returns(FinchAPI::Type::Converter::Input), - FinchAPI::Type::Converter::Input - ), - spec: FinchAPI::Util::AnyHash - ) - .void - end - def initialize(type_info, spec = {}) - end - end - end -end diff --git a/rbi/lib/finch-api/type/base_model.rbi b/rbi/lib/finch-api/type/base_model.rbi deleted file mode 100644 index d0781091..00000000 --- a/rbi/lib/finch-api/type/base_model.rbi +++ /dev/null @@ -1,191 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - class BaseModel - extend FinchAPI::Type::Converter - - abstract! - - KnownFieldShape = T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean, nilable: T::Boolean} } - - 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::Type::Converter::Input)} - ) - ] - ) - end - def known_fields - end - - # @api private - sig do - returns( - T::Hash[Symbol, - T.all(FinchAPI::BaseModel::KnownFieldShape, {type: FinchAPI::Type::Converter::Input})] - ) - end - def fields - 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::Type::Converter::Input)), - union: T.nilable(T.proc.returns(FinchAPI::Type::Converter::Input)), - api_name: Symbol, - nil?: T::Boolean - }, - T.proc.returns(FinchAPI::Type::Converter::Input), - FinchAPI::Type::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::Type::Converter::Input), - FinchAPI::Type::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::Type::Converter::Input), - FinchAPI::Type::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 - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - class << self - # @api private - sig do - override - .params( - value: T.any(FinchAPI::BaseModel, T::Hash[T.anything, T.anything], T.anything), - state: FinchAPI::Type::Converter::State - ) - .returns(T.any(T.attached_class, T.anything)) - end - def coerce(value, state:) - 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 - 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 - - # 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 - - # 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(FinchAPI::Util::AnyHash) } - def deconstruct_keys(keys) - end - - # 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) } - def inspect - end - end - end -end diff --git a/rbi/lib/finch-api/type/base_page.rbi b/rbi/lib/finch-api/type/base_page.rbi deleted file mode 100644 index 89e3a4b0..00000000 --- a/rbi/lib/finch-api/type/base_page.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - module BasePage - Elem = type_member(:out) - - sig { overridable.returns(T::Boolean) } - def next_page? - end - - sig { overridable.returns(T.self_type) } - def next_page - end - - sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } - def auto_paging_each(&blk) - end - - sig { returns(T::Enumerable[Elem]) } - def to_enum - end - - # @api private - sig do - params( - client: FinchAPI::Transport::BaseClient, - req: FinchAPI::Transport::BaseClient::RequestComponentsShape, - headers: T.any(T::Hash[String, String], Net::HTTPHeader), - page_data: T.anything - ) - .void - end - def initialize(client:, req:, headers:, page_data:) - end - end - end -end diff --git a/rbi/lib/finch-api/type/boolean_model.rbi b/rbi/lib/finch-api/type/boolean_model.rbi deleted file mode 100644 index 1087c893..00000000 --- a/rbi/lib/finch-api/type/boolean_model.rbi +++ /dev/null @@ -1,41 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - # - # Ruby has no Boolean class; this is something for models to refer to. - class BooleanModel - extend FinchAPI::Type::Converter - - abstract! - final! - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def self.===(other) - end - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def self.==(other) - end - - class << self - # @api private - sig(:final) do - override - .params(value: T.any(T::Boolean, T.anything), state: FinchAPI::Type::Converter::State) - .returns(T.any(T::Boolean, T.anything)) - end - def coerce(value, state:) - 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 - end - end - end -end diff --git a/rbi/lib/finch-api/type/converter.rbi b/rbi/lib/finch-api/type/converter.rbi deleted file mode 100644 index 14425cf7..00000000 --- a/rbi/lib/finch-api/type/converter.rbi +++ /dev/null @@ -1,101 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - module Converter - Input = T.type_alias { T.any(FinchAPI::Type::Converter, T::Class[T.anything]) } - - State = - T.type_alias do - { - strictness: T.any(T::Boolean, Symbol), - exactness: {yes: Integer, no: Integer, maybe: Integer}, - branched: Integer - } - end - - # @api private - sig do - overridable.params(value: T.anything, state: FinchAPI::Type::Converter::State).returns(T.anything) - end - def coerce(value, state:) - end - - # @api private - sig { overridable.params(value: T.anything).returns(T.anything) } - def dump(value) - end - - 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::Type::Converter::Input)), - union: T.nilable(T.proc.returns(FinchAPI::Type::Converter::Input)) - }, - T.proc.returns(FinchAPI::Type::Converter::Input), - FinchAPI::Type::Converter::Input - ) - ) - .returns(T.proc.returns(T.anything)) - 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 - # - # The coercion process is subject to improvement between minor release versions. - # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode - sig do - params( - target: FinchAPI::Type::Converter::Input, - value: T.anything, - state: FinchAPI::Type::Converter::State - ) - .returns(T.anything) - end - def self.coerce( - target, - value, - # The `strictness` is one of `true`, `false`, or `:strong`. This informs the - # coercion strategy when we have to decide between multiple possible conversion - # targets: - # - # - `true`: the conversion must be exact, with minimum coercion. - # - `false`: the conversion can be approximate, with some coercion. - # - `:strong`: the conversion must be exact, with no coercion, and raise an error - # if not possible. - # - # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For - # any given conversion attempt, the exactness will be updated based on how closely - # the value recursively matches the target type: - # - # - `yes`: the value can be converted to the target type with minimum coercion. - # - `maybe`: the value can be converted to the target type with some reasonable - # coercion. - # - `no`: the value cannot be converted to the target type. - # - # See implementation below for more details. - state: {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} - ) - end - - # @api private - sig { params(target: FinchAPI::Type::Converter::Input, value: T.anything).returns(T.anything) } - def self.dump(target, value) - end - end - end - end -end diff --git a/rbi/lib/finch-api/type/enum.rbi b/rbi/lib/finch-api/type/enum.rbi deleted file mode 100644 index a7dc663b..00000000 --- a/rbi/lib/finch-api/type/enum.rbi +++ /dev/null @@ -1,58 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @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::Type::Converter - - # All of the valid Symbol values for this enum. - sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } - def values - end - - # @api private - # - # Guard against thread safety issues by instantiating `@values`. - sig { void } - private def finalize! - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - # @api private - # - # Unlike with primitives, `Enum` additionally validates that the value is a member - # of the enum. - sig do - override - .params(value: T.any(String, Symbol, T.anything), state: FinchAPI::Type::Converter::State) - .returns(T.any(Symbol, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } - def dump(value) - end - end - end -end diff --git a/rbi/lib/finch-api/type/hash_of.rbi b/rbi/lib/finch-api/type/hash_of.rbi deleted file mode 100644 index 5e222725..00000000 --- a/rbi/lib/finch-api/type/hash_of.rbi +++ /dev/null @@ -1,86 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - # - # Hash of items of a given type. - class HashOf - include FinchAPI::Type::Converter - - abstract! - final! - - Elem = type_member(:out) - - sig(:final) do - params( - type_info: T.any( - FinchAPI::Util::AnyHash, - T.proc.returns(FinchAPI::Type::Converter::Input), - FinchAPI::Type::Converter::Input - ), - spec: FinchAPI::Util::AnyHash - ) - .returns(T.attached_class) - end - def self.[](type_info, spec = {}) - end - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - # @api private - sig(:final) do - override - .params(value: T.any( - T::Hash[T.anything, T.anything], - T.anything - ), - state: FinchAPI::Type::Converter::State) - .returns(T.any(FinchAPI::Util::AnyHash, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig(:final) do - override - .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) - .returns(T.any(FinchAPI::Util::AnyHash, T.anything)) - end - def dump(value) - end - - # @api private - sig(:final) { returns(Elem) } - protected def item_type - end - - # @api private - sig(:final) { returns(T::Boolean) } - protected def nilable? - end - - # @api private - sig(:final) do - params( - type_info: T.any( - FinchAPI::Util::AnyHash, - T.proc.returns(FinchAPI::Type::Converter::Input), - FinchAPI::Type::Converter::Input - ), - spec: FinchAPI::Util::AnyHash - ) - .void - end - def initialize(type_info, spec = {}) - end - end - end -end diff --git a/rbi/lib/finch-api/type/request_parameters.rbi b/rbi/lib/finch-api/type/request_parameters.rbi deleted file mode 100644 index e41e3467..00000000 --- a/rbi/lib/finch-api/type/request_parameters.rbi +++ /dev/null @@ -1,20 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - module RequestParameters - # 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 - # @api private - sig { params(params: T.anything).returns([T.anything, FinchAPI::Util::AnyHash]) } - def dump_request(params) - end - end - end - end -end diff --git a/rbi/lib/finch-api/type/union.rbi b/rbi/lib/finch-api/type/union.rbi deleted file mode 100644 index 4e7f7a06..00000000 --- a/rbi/lib/finch-api/type/union.rbi +++ /dev/null @@ -1,66 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - module Union - include FinchAPI::Type::Converter - - # @api private - # - # All of the specified variant info for this union. - sig { returns(T::Array[[T.nilable(Symbol), T.proc.returns(FinchAPI::Type::Converter::Input)]]) } - private def known_variants - end - - # @api private - sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) } - protected def derefed_variants - end - - # 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 def discriminator(property) - end - - # @api private - sig do - params( - 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 def variant(key, spec = nil) - end - - # @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 ===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - # @api private - sig { override.params(value: T.anything, state: FinchAPI::Type::Converter::State).returns(T.anything) } - def coerce(value, state:) - end - - # @api private - sig { override.params(value: T.anything).returns(T.anything) } - def dump(value) - end - end - end -end diff --git a/rbi/lib/finch-api/type/unknown.rbi b/rbi/lib/finch-api/type/unknown.rbi deleted file mode 100644 index 684275a9..00000000 --- a/rbi/lib/finch-api/type/unknown.rbi +++ /dev/null @@ -1,37 +0,0 @@ -# typed: strong - -module FinchAPI - module Type - # @api private - # - # When we don't know what to expect for the value. - class Unknown - extend FinchAPI::Type::Converter - - abstract! - final! - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def self.===(other) - end - - sig(:final) { params(other: T.anything).returns(T::Boolean) } - def self.==(other) - end - - class << self - # @api private - sig(:final) do - override.params(value: T.anything, state: FinchAPI::Type::Converter::State).returns(T.anything) - end - def coerce(value, state:) - end - - # @api private - sig(:final) { override.params(value: T.anything).returns(T.anything) } - def dump(value) - end - end - end - end -end diff --git a/rbi/lib/finch-api/util.rbi b/rbi/lib/finch-api/util.rbi deleted file mode 100644 index e005e5d8..00000000 --- a/rbi/lib/finch-api/util.rbi +++ /dev/null @@ -1,280 +0,0 @@ -# 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 - - class << self - # @api private - sig { returns(String) } - def arch - end - - # @api private - sig { returns(String) } - def os - end - end - - class << self - # @api private - sig { params(input: T.anything).returns(T::Boolean) } - def primitive?(input) - end - - # @api private - sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } - def coerce_boolean(input) - end - - # @api private - sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } - def coerce_boolean!(input) - end - - # @api private - sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } - def coerce_integer(input) - end - - # @api private - sig { params(input: T.anything).returns(T.any(Float, T.anything)) } - def coerce_float(input) - end - - # @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) - - 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 - - # @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 - ) - end - - # @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 - - class << self - # @api private - sig { params(uri: URI::Generic).returns(String) } - def uri_origin(uri) - end - - # @api private - sig { params(path: T.any(String, T::Array[String])).returns(String) } - def interpolate_path(path) - end - end - - class << self - # @api private - sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } - def decode_query(query) - end - - # @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 - - 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 - - class << self - # @api private - sig { params(url: T.any(URI::Generic, String)).returns(FinchAPI::Util::ParsedUriShape) } - def parse_uri(url) - end - - # @api private - sig { params(parsed: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) } - def unparse_uri(parsed) - end - - # @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 - - 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 - - # @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 - - # @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 - - # @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 - - class << self - sig { params(blk: T.proc.params(y: Enumerator::Yielder).void).returns(T::Enumerable[String]) } - def string_io(&blk) - end - 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 - - # @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 - - 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 - - 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 deleted file mode 100644 index 4fc0d2de..00000000 --- a/rbi/lib/finch-api/version.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strong - -module FinchAPI - VERSION = "0.1.0-alpha.5" -end diff --git a/rbi/lib/finch-api/client.rbi b/rbi/lib/finch_api/client.rbi similarity index 97% rename from rbi/lib/finch-api/client.rbi rename to rbi/lib/finch_api/client.rbi index bcdc261e..91a4e57b 100644 --- a/rbi/lib/finch-api/client.rbi +++ b/rbi/lib/finch_api/client.rbi @@ -1,7 +1,7 @@ # typed: strong module FinchAPI - class Client < FinchAPI::Transport::BaseClient + class Client < FinchAPI::Internal::Transport::BaseClient DEFAULT_MAX_RETRIES = 2 DEFAULT_TIMEOUT_IN_SECONDS = T.let(60.0, Float) @@ -67,10 +67,10 @@ module FinchAPI # Creates and returns a new client for interacting with the API. sig do params( - base_url: T.nilable(String), - access_token: T.nilable(String), client_id: T.nilable(String), client_secret: T.nilable(String), + access_token: T.nilable(String), + base_url: T.nilable(String), max_retries: Integer, timeout: Float, initial_retry_delay: Float, @@ -79,13 +79,13 @@ module FinchAPI .returns(T.attached_class) end 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"], + access_token: nil, + # Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + base_url: nil, # Max number of retries to attempt after a failed retryable request. max_retries: DEFAULT_MAX_RETRIES, timeout: DEFAULT_TIMEOUT_IN_SECONDS, diff --git a/rbi/lib/finch_api/errors.rbi b/rbi/lib/finch_api/errors.rbi new file mode 100644 index 00000000..38251da7 --- /dev/null +++ b/rbi/lib/finch_api/errors.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module FinchAPI + module Errors + class Error < StandardError + sig { returns(T.nilable(StandardError)) } + attr_accessor :cause + end + + class ConversionError < FinchAPI::Errors::Error + end + + class APIError < FinchAPI::Errors::Error + sig { returns(URI::Generic) } + attr_accessor :url + + sig { returns(T.nilable(Integer)) } + attr_accessor :status + + sig { returns(T.nilable(T.anything)) } + attr_accessor :body + + # @api private + sig do + params( + url: URI::Generic, + status: T.nilable(Integer), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + end + end + + class APIConnectionError < FinchAPI::Errors::APIError + sig { void } + attr_accessor :status + + sig { void } + attr_accessor :body + + # @api private + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") + end + end + + class APITimeoutError < FinchAPI::Errors::APIConnectionError + # @api private + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") + end + end + + class APIStatusError < FinchAPI::Errors::APIError + # @api private + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.for(url:, status:, body:, request:, response:, message: nil) + end + + sig { returns(Integer) } + attr_accessor :status + + # @api private + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status:, body:, request:, response:, message: nil) + end + end + + class BadRequestError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < FinchAPI::Errors::APIStatusError + HTTP_STATUS = T.let((500..), T::Range[Integer]) + end + end +end diff --git a/rbi/lib/finch_api/internal.rbi b/rbi/lib/finch_api/internal.rbi new file mode 100644 index 00000000..1936f73e --- /dev/null +++ b/rbi/lib/finch_api/internal.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module FinchAPI + # @api private + module Internal + # 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] } + + OMIT = T.let(T.anything, T.anything) + end +end diff --git a/rbi/lib/finch_api/internal/individuals_page.rbi b/rbi/lib/finch_api/internal/individuals_page.rbi new file mode 100644 index 00000000..53be57c2 --- /dev/null +++ b/rbi/lib/finch_api/internal/individuals_page.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module FinchAPI + module Internal + class IndividualsPage + Elem = type_member + + include FinchAPI::Internal::Type::BasePage + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :individuals + + sig { returns(FinchAPI::Models::Paging) } + attr_accessor :paging + + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/lib/finch_api/internal/page.rbi b/rbi/lib/finch_api/internal/page.rbi new file mode 100644 index 00000000..3ff508d9 --- /dev/null +++ b/rbi/lib/finch_api/internal/page.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module FinchAPI + module Internal + class Page + Elem = type_member + + include FinchAPI::Internal::Type::BasePage + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :data + + sig { returns(FinchAPI::Models::Paging) } + attr_accessor :paging + + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/lib/finch_api/internal/responses_page.rbi b/rbi/lib/finch_api/internal/responses_page.rbi new file mode 100644 index 00000000..07d21c75 --- /dev/null +++ b/rbi/lib/finch_api/internal/responses_page.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Internal + class ResponsesPage + Elem = type_member + + include FinchAPI::Internal::Type::BasePage + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :responses + + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/lib/finch_api/internal/single_page.rbi b/rbi/lib/finch_api/internal/single_page.rbi new file mode 100644 index 00000000..852564ad --- /dev/null +++ b/rbi/lib/finch_api/internal/single_page.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module FinchAPI + module Internal + class SinglePage < ::Array + Elem = type_member + + include FinchAPI::Internal::Type::BasePage + + sig { override.returns(T::Boolean) } + def next_page? + end + + sig { override.returns(T.self_type) } + def next_page + end + + sig { override.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk) + end + + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/lib/finch_api/internal/transport/base_client.rbi b/rbi/lib/finch_api/internal/transport/base_client.rbi new file mode 100644 index 00000000..c44618ad --- /dev/null +++ b/rbi/lib/finch_api/internal/transport/base_client.rbi @@ -0,0 +1,212 @@ +# typed: strong + +module FinchAPI + module Internal + module Transport + # @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::Internal::Type::BasePage[FinchAPI::Internal::Type::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(FinchAPI::Internal::Type::Converter::Input), + options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::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] + + class << self + # @api private + sig { params(req: FinchAPI::Internal::Transport::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::Internal::Transport::BaseClient::RequestInputShape, + status: Integer, + response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) + ) + .returns(FinchAPI::Internal::Transport::BaseClient::RequestInputShape) + end + def follow_redirect(request, status:, response_headers:) + end + + # @api private + sig do + params( + status: T.any(Integer, FinchAPI::Errors::APIConnectionError), + stream: T.nilable(T::Enumerable[String]) + ) + .void + end + def reap_connection!(status, stream:) + end + end + + # @api private + sig { returns(FinchAPI::Internal::Transport::PooledNetRequester) } + attr_accessor :requester + + # @api private + sig do + params( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: T::Hash[String, + T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))], + idempotency_header: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + 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::Internal::Transport::BaseClient::RequestComponentsShape, + opts: FinchAPI::Internal::AnyHash + ) + .returns(FinchAPI::Internal::Transport::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::Internal::Transport::BaseClient::RequestInputShape, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: T::Boolean + ) + .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + private def send_request(request, redirect_count:, retry_count:, send_retry_header:) + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, options: {}) + sig do + params( + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[FinchAPI::Internal::Type::BasePage[FinchAPI::Internal::Type::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(FinchAPI::Internal::Type::Converter::Input), + options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + ) + .returns(T.anything) + end + def request( + method, + path, + query: {}, + headers: {}, + body: nil, + unwrap: nil, + page: nil, + stream: nil, + model: FinchAPI::Internal::Type::Unknown, + options: {} + ) + end + + sig { returns(String) } + def inspect + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/transport/pooled_net_requester.rbi b/rbi/lib/finch_api/internal/transport/pooled_net_requester.rbi new file mode 100644 index 00000000..8d44fc6c --- /dev/null +++ b/rbi/lib/finch_api/internal/transport/pooled_net_requester.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module FinchAPI + module Internal + module Transport + # @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 + + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 + + 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 + + # @api private + sig do + params( + request: FinchAPI::Internal::Transport::PooledNetRequester::RequestShape, + blk: T.proc.params(arg0: String).void + ) + .returns(Net::HTTPGenericRequest) + end + def build_request(request, &blk) + end + end + + # @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::Internal::Transport::PooledNetRequester::RequestShape) + .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + def execute(request) + end + + # @api private + sig { params(size: Integer).returns(T.attached_class) } + def self.new(size: Etc.nprocessors) + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/array_of.rbi b/rbi/lib/finch_api/internal/type/array_of.rbi new file mode 100644 index 00000000..2f8262d3 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/array_of.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + # + # Array of items of a given type. + class ArrayOf + include FinchAPI::Internal::Type::Converter + + abstract! + final! + + Elem = type_member(:out) + + sig(:final) do + params( + type_info: T.any( + FinchAPI::Internal::AnyHash, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::AnyHash + ) + .returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig(:final) do + override + .params(value: T.any( + T::Array[T.anything], + T.anything + ), + state: FinchAPI::Internal::Type::Converter::State) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig(:final) do + override + .params(value: T.any(T::Array[T.anything], T.anything)) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def dump(value) + end + + # @api private + sig(:final) { returns(Elem) } + protected def item_type + end + + # @api private + sig(:final) { returns(T::Boolean) } + protected def nilable? + end + + # @api private + sig(:final) do + params( + type_info: T.any( + FinchAPI::Internal::AnyHash, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::AnyHash + ) + .void + end + def initialize(type_info, spec = {}) + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/base_model.rbi b/rbi/lib/finch_api/internal/type/base_model.rbi new file mode 100644 index 00000000..b22404a9 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/base_model.rbi @@ -0,0 +1,212 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + class BaseModel + extend FinchAPI::Internal::Type::Converter + + abstract! + + KnownFieldShape = T.type_alias do + {mode: T.nilable(Symbol), required: T::Boolean, nilable: T::Boolean} + end + + 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::Internal::Type::BaseModel::KnownFieldShape, + {type_fn: T.proc.returns(FinchAPI::Internal::Type::Converter::Input)} + ) + ] + ) + end + def known_fields + end + + # @api private + sig do + returns( + T::Hash[ + Symbol, + T.all( + FinchAPI::Internal::Type::BaseModel::KnownFieldShape, + {type: FinchAPI::Internal::Type::Converter::Input} + ) + ] + ) + end + def fields + 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::Internal::Type::Converter::Input)), + union: T.nilable(T.proc.returns(FinchAPI::Internal::Type::Converter::Input)), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::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::Internal::AnyHash, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::AnyHash + ) + .void + end + def required(name_sym, type_info, spec = {}) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: T.any( + FinchAPI::Internal::AnyHash, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::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 + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + class << self + # @api private + sig do + override + .params( + value: T.any( + FinchAPI::Internal::Type::BaseModel, + T::Hash[T.anything, T.anything], + T.anything + ), + state: FinchAPI::Internal::Type::Converter::State + ) + .returns(T.any(T.attached_class, T.anything)) + end + def coerce(value, state:) + 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 + 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 + + # 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::Internal::AnyHash) } + def to_h + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + sig { overridable.returns(FinchAPI::Internal::AnyHash) } + def to_hash + end + + sig { params(keys: T.nilable(T::Array[Symbol])).returns(FinchAPI::Internal::AnyHash) } + def deconstruct_keys(keys) + end + + sig { params(a: T.anything).returns(String) } + def to_json(*a) + end + + sig { params(a: T.anything).returns(String) } + def to_yaml(*a) + end + + # 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) } + def inspect + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/base_page.rbi b/rbi/lib/finch_api/internal/type/base_page.rbi new file mode 100644 index 00000000..9239f4c8 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/base_page.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # This module provides a base implementation for paginated responses in the SDK. + module BasePage + Elem = type_member(:out) + + sig { overridable.returns(T::Boolean) } + def next_page? + end + + sig { overridable.returns(T.self_type) } + def next_page + end + + sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk) + end + + sig { returns(T::Enumerable[Elem]) } + def to_enum + end + + # @api private + sig do + params( + client: FinchAPI::Internal::Transport::BaseClient, + req: FinchAPI::Internal::Transport::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + page_data: T.anything + ) + .void + end + def initialize(client:, req:, headers:, page_data:) + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/boolean_model.rbi b/rbi/lib/finch_api/internal/type/boolean_model.rbi new file mode 100644 index 00000000..6a230050 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/boolean_model.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + # + # Ruby has no Boolean class; this is something for models to refer to. + class BooleanModel + extend FinchAPI::Internal::Type::Converter + + abstract! + final! + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + sig(:final) do + override + .params(value: T.any(T::Boolean, T.anything), state: FinchAPI::Internal::Type::Converter::State) + .returns(T.any(T::Boolean, T.anything)) + end + def coerce(value, state:) + 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 + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/converter.rbi b/rbi/lib/finch_api/internal/type/converter.rbi new file mode 100644 index 00000000..f9bdc3c8 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/converter.rbi @@ -0,0 +1,108 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + module Converter + Input = T.type_alias { T.any(FinchAPI::Internal::Type::Converter, T::Class[T.anything]) } + + State = + T.type_alias do + { + strictness: T.any(T::Boolean, Symbol), + exactness: {yes: Integer, no: Integer, maybe: Integer}, + branched: Integer + } + end + + # @api private + sig do + overridable.params( + value: T.anything, + state: FinchAPI::Internal::Type::Converter::State + ).returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig { overridable.params(value: T.anything).returns(T.anything) } + def dump(value) + end + + 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::Internal::Type::Converter::Input)), + union: T.nilable(T.proc.returns(FinchAPI::Internal::Type::Converter::Input)) + }, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ) + ) + .returns(T.proc.returns(T.anything)) + 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 + # + # The coercion process is subject to improvement between minor release versions. + # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode + sig do + params( + target: FinchAPI::Internal::Type::Converter::Input, + value: T.anything, + state: FinchAPI::Internal::Type::Converter::State + ) + .returns(T.anything) + end + def self.coerce( + target, + value, + # The `strictness` is one of `true`, `false`, or `:strong`. This informs the + # coercion strategy when we have to decide between multiple possible conversion + # targets: + # + # - `true`: the conversion must be exact, with minimum coercion. + # - `false`: the conversion can be approximate, with some coercion. + # - `:strong`: the conversion must be exact, with no coercion, and raise an error + # if not possible. + # + # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For + # any given conversion attempt, the exactness will be updated based on how closely + # the value recursively matches the target type: + # + # - `yes`: the value can be converted to the target type with minimum coercion. + # - `maybe`: the value can be converted to the target type with some reasonable + # coercion. + # - `no`: the value cannot be converted to the target type. + # + # See implementation below for more details. + state: {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} + ) + end + + # @api private + sig do + params(target: FinchAPI::Internal::Type::Converter::Input, value: T.anything).returns(T.anything) + end + def self.dump(target, value) + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/enum.rbi b/rbi/lib/finch_api/internal/type/enum.rbi new file mode 100644 index 00000000..eac9134a --- /dev/null +++ b/rbi/lib/finch_api/internal/type/enum.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @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::Internal::Type::Converter + + # All of the valid Symbol values for this enum. + sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } + def values + end + + # @api private + # + # Guard against thread safety issues by instantiating `@values`. + sig { void } + private def finalize! + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + # + # Unlike with primitives, `Enum` additionally validates that the value is a member + # of the enum. + sig do + override + .params(value: T.any( + String, + Symbol, + T.anything + ), + state: FinchAPI::Internal::Type::Converter::State) + .returns(T.any(Symbol, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def dump(value) + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/hash_of.rbi b/rbi/lib/finch_api/internal/type/hash_of.rbi new file mode 100644 index 00000000..e14c3402 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/hash_of.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + # + # Hash of items of a given type. + class HashOf + include FinchAPI::Internal::Type::Converter + + abstract! + final! + + Elem = type_member(:out) + + sig(:final) do + params( + type_info: T.any( + FinchAPI::Internal::AnyHash, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::AnyHash + ) + .returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig(:final) do + override + .params( + value: T.any(T::Hash[T.anything, T.anything], T.anything), + state: FinchAPI::Internal::Type::Converter::State + ) + .returns(T.any(FinchAPI::Internal::AnyHash, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig(:final) do + override + .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(FinchAPI::Internal::AnyHash, T.anything)) + end + def dump(value) + end + + # @api private + sig(:final) { returns(Elem) } + protected def item_type + end + + # @api private + sig(:final) { returns(T::Boolean) } + protected def nilable? + end + + # @api private + sig(:final) do + params( + type_info: T.any( + FinchAPI::Internal::AnyHash, + T.proc.returns(FinchAPI::Internal::Type::Converter::Input), + FinchAPI::Internal::Type::Converter::Input + ), + spec: FinchAPI::Internal::AnyHash + ) + .void + end + def initialize(type_info, spec = {}) + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/request_parameters.rbi b/rbi/lib/finch_api/internal/type/request_parameters.rbi new file mode 100644 index 00000000..7051d977 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/request_parameters.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + module RequestParameters + # Options to specify HTTP behaviour for this request. + sig { returns(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) } + attr_accessor :request_options + + # @api private + module Converter + # @api private + sig { params(params: T.anything).returns([T.anything, FinchAPI::Internal::AnyHash]) } + def dump_request(params) + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/union.rbi b/rbi/lib/finch_api/internal/type/union.rbi new file mode 100644 index 00000000..6cfbb747 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/union.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + module Union + include FinchAPI::Internal::Type::Converter + + # @api private + # + # All of the specified variant info for this union. + sig do + returns(T::Array[[T.nilable(Symbol), T.proc.returns(FinchAPI::Internal::Type::Converter::Input)]]) + end + private def known_variants + end + + # @api private + sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) } + protected def derefed_variants + end + + # 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 def discriminator(property) + end + + # @api private + sig do + params( + key: T.any(Symbol, FinchAPI::Internal::AnyHash, T.proc.returns(T.anything), T.anything), + spec: T.any(FinchAPI::Internal::AnyHash, T.proc.returns(T.anything), T.anything) + ) + .void + end + private def variant(key, spec = nil) + end + + # @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 ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig do + override.params( + value: T.anything, + state: FinchAPI::Internal::Type::Converter::State + ).returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig { override.params(value: T.anything).returns(T.anything) } + def dump(value) + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/type/unknown.rbi b/rbi/lib/finch_api/internal/type/unknown.rbi new file mode 100644 index 00000000..cae010c6 --- /dev/null +++ b/rbi/lib/finch_api/internal/type/unknown.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module FinchAPI + module Internal + module Type + # @api private + # + # When we don't know what to expect for the value. + class Unknown + extend FinchAPI::Internal::Type::Converter + + abstract! + final! + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + sig(:final) do + override.params( + value: T.anything, + state: FinchAPI::Internal::Type::Converter::State + ).returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig(:final) { override.params(value: T.anything).returns(T.anything) } + def dump(value) + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/internal/util.rbi b/rbi/lib/finch_api/internal/util.rbi new file mode 100644 index 00000000..de992e41 --- /dev/null +++ b/rbi/lib/finch_api/internal/util.rbi @@ -0,0 +1,280 @@ +# typed: strong + +module FinchAPI + module Internal + # @api private + module Util + # @api private + sig { returns(Float) } + def self.monotonic_secs + end + + class << self + # @api private + sig { returns(String) } + def arch + end + + # @api private + sig { returns(String) } + def os + end + end + + class << self + # @api private + sig { params(input: T.anything).returns(T::Boolean) } + def primitive?(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def coerce_boolean(input) + end + + # @api private + sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } + def coerce_boolean!(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } + def coerce_integer(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(Float, T.anything)) } + def coerce_float(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) } + def coerce_hash(input) + end + 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 + + # @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 + ) + end + + # @api private + sig do + params( + data: T.any(FinchAPI::Internal::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 + + class << self + # @api private + sig { params(uri: URI::Generic).returns(String) } + def uri_origin(uri) + end + + # @api private + sig { params(path: T.any(String, T::Array[String])).returns(String) } + def interpolate_path(path) + end + end + + class << self + # @api private + sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } + def decode_query(query) + end + + # @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 + + 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 + + class << self + # @api private + sig { params(url: T.any(URI::Generic, String)).returns(FinchAPI::Internal::Util::ParsedUriShape) } + def parse_uri(url) + end + + # @api private + sig { params(parsed: FinchAPI::Internal::Util::ParsedUriShape).returns(URI::Generic) } + def unparse_uri(parsed) + end + + # @api private + sig do + params(lhs: FinchAPI::Internal::Util::ParsedUriShape, rhs: FinchAPI::Internal::Util::ParsedUriShape) + .returns(URI::Generic) + end + def join_parsed_uri(lhs, rhs) + end + end + + 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 + + # @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 + + # @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 + + # @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 + + class << self + sig { params(blk: T.proc.params(y: Enumerator::Yielder).void).returns(T::Enumerable[String]) } + def writable_enum(&blk) + end + 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 write_multipart_chunk(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 + + # @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 + + 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 + + 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::Internal::Util::ServerSentEvent) } + def decode_sse(lines) + end + end + 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 similarity index 85% rename from rbi/lib/finch-api/models/access_token_create_params.rbi rename to rbi/lib/finch_api/models/access_token_create_params.rbi index 65374866..07518a4c 100644 --- a/rbi/lib/finch-api/models/access_token_create_params.rbi +++ b/rbi/lib/finch_api/models/access_token_create_params.rbi @@ -2,9 +2,9 @@ module FinchAPI module Models - class AccessTokenCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AccessTokenCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(String) } attr_accessor :code @@ -33,7 +33,7 @@ module FinchAPI client_id: String, client_secret: String, redirect_uri: String, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch_api/models/account_disconnect_params.rbi b/rbi/lib/finch_api/models/account_disconnect_params.rbi new file mode 100644 index 00000000..db9aca6b --- /dev/null +++ b/rbi/lib/finch_api/models/account_disconnect_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module FinchAPI + module Models + class AccountDisconnectParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch_api/models/account_introspect_params.rbi b/rbi/lib/finch_api/models/account_introspect_params.rbi new file mode 100644 index 00000000..fff8d15b --- /dev/null +++ b/rbi/lib/finch_api/models/account_introspect_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module FinchAPI + module Models + class AccountIntrospectParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/account_update_event.rbi b/rbi/lib/finch_api/models/account_update_event.rbi similarity index 92% rename from rbi/lib/finch-api/models/account_update_event.rbi rename to rbi/lib/finch_api/models/account_update_event.rbi index ef218692..eebee298 100644 --- a/rbi/lib/finch-api/models/account_update_event.rbi +++ b/rbi/lib/finch_api/models/account_update_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::AccountUpdateEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::AccountUpdateEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::AccountUpdateEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::AccountUpdateEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::AccountUpdateEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,13 +37,13 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel sig { returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) } attr_reader :authentication_method sig do params( - authentication_method: T.any(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, FinchAPI::Util::AnyHash) + authentication_method: T.any(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, FinchAPI::Internal::AnyHash) ) .void end @@ -54,7 +54,7 @@ module FinchAPI sig do params( - authentication_method: T.any(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, FinchAPI::Util::AnyHash), + authentication_method: T.any(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, FinchAPI::Internal::AnyHash), status: FinchAPI::Models::ConnectionStatusType::OrSymbol ) .returns(T.attached_class) @@ -74,7 +74,7 @@ module FinchAPI def to_hash end - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::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)) } @@ -82,7 +82,7 @@ module FinchAPI sig do params( - benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)) + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Internal::AnyHash)) ) .void end @@ -97,7 +97,7 @@ module FinchAPI supported_fields: T.nilable( T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ) @@ -114,11 +114,11 @@ module FinchAPI sig do params( - benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)), + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Internal::AnyHash)), supported_fields: T.nilable( T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ), type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::OrSymbol @@ -141,7 +141,7 @@ module FinchAPI def to_hash end - class SupportedFields < FinchAPI::BaseModel + class SupportedFields < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) @@ -153,7 +153,7 @@ module FinchAPI params( company: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -171,7 +171,7 @@ module FinchAPI params( directory: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -189,7 +189,7 @@ module FinchAPI params( employment: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -207,7 +207,7 @@ module FinchAPI params( individual: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -225,7 +225,7 @@ module FinchAPI params( pay_group: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -243,7 +243,7 @@ module FinchAPI params( pay_statement: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -261,7 +261,7 @@ module FinchAPI params( payment: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -273,31 +273,31 @@ module FinchAPI params( company: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), directory: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employment: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), individual: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), pay_group: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), pay_statement: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), payment: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -330,7 +330,7 @@ module FinchAPI def to_hash end - class Company < FinchAPI::BaseModel + class Company < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -350,7 +350,7 @@ module FinchAPI params( accounts: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -370,7 +370,7 @@ module FinchAPI params( departments: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -396,7 +396,7 @@ module FinchAPI params( entity: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -422,7 +422,7 @@ module FinchAPI params( locations: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -446,21 +446,21 @@ module FinchAPI id: T::Boolean, accounts: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), departments: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), ein: T::Boolean, entity: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), legal_name: T::Boolean, locations: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), primary_email: T::Boolean, primary_phone_number: T::Boolean @@ -499,7 +499,7 @@ module FinchAPI def to_hash end - class Accounts < FinchAPI::BaseModel + class Accounts < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :account_name @@ -540,7 +540,13 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -559,7 +565,7 @@ module FinchAPI end end - class Departments < FinchAPI::BaseModel + class Departments < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :name @@ -579,7 +585,7 @@ module FinchAPI params( parent: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -591,7 +597,7 @@ module FinchAPI name: T::Boolean, parent: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -611,7 +617,7 @@ module FinchAPI def to_hash end - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :name @@ -628,7 +634,7 @@ module FinchAPI end end - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :subtype @@ -650,7 +656,7 @@ module FinchAPI end end - class Locations < FinchAPI::BaseModel + class Locations < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :city @@ -719,7 +725,7 @@ module FinchAPI end end - class Directory < FinchAPI::BaseModel + class Directory < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable( @@ -733,7 +739,7 @@ module FinchAPI params( individuals: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -753,7 +759,7 @@ module FinchAPI params( paging: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -764,11 +770,11 @@ module FinchAPI params( individuals: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), paging: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -788,7 +794,7 @@ module FinchAPI def to_hash end - class Individuals < FinchAPI::BaseModel + class Individuals < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -832,7 +838,7 @@ module FinchAPI params( manager: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -854,13 +860,21 @@ module FinchAPI last_name: T::Boolean, manager: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), middle_name: T::Boolean ) .returns(T.attached_class) end - def self.new(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 @@ -880,7 +894,7 @@ module FinchAPI def to_hash end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -897,7 +911,7 @@ module FinchAPI end end - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :count @@ -920,7 +934,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -952,7 +966,7 @@ module FinchAPI params( department: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -972,7 +986,7 @@ module FinchAPI params( employment: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1010,7 +1024,7 @@ module FinchAPI params( income: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1048,7 +1062,7 @@ module FinchAPI params( location: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1068,7 +1082,7 @@ module FinchAPI params( manager: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1100,29 +1114,29 @@ module FinchAPI custom_fields: T::Boolean, department: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employment: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employment_status: T::Boolean, end_date: T::Boolean, first_name: T::Boolean, income: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), income_history: T::Boolean, is_active: T::Boolean, last_name: T::Boolean, location: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), manager: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), middle_name: T::Boolean, start_date: T::Boolean, @@ -1178,7 +1192,7 @@ module FinchAPI def to_hash end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :name @@ -1194,7 +1208,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :subtype @@ -1216,7 +1230,7 @@ module FinchAPI end end - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -1246,7 +1260,7 @@ module FinchAPI end end - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :city @@ -1314,7 +1328,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -1331,7 +1345,7 @@ module FinchAPI end end - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -1357,7 +1371,7 @@ module FinchAPI params( emails: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1413,7 +1427,7 @@ module FinchAPI params( phone_numbers: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1439,7 +1453,7 @@ module FinchAPI params( residence: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1458,7 +1472,7 @@ module FinchAPI dob: T::Boolean, emails: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), encrypted_ssn: T::Boolean, ethnicity: T::Boolean, @@ -1468,12 +1482,12 @@ module FinchAPI middle_name: T::Boolean, phone_numbers: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), preferred_name: T::Boolean, residence: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), ssn: T::Boolean ) @@ -1519,7 +1533,7 @@ module FinchAPI def to_hash end - class Emails < FinchAPI::BaseModel + class Emails < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :data @@ -1541,7 +1555,7 @@ module FinchAPI end end - class PhoneNumbers < FinchAPI::BaseModel + class PhoneNumbers < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :data @@ -1563,7 +1577,7 @@ module FinchAPI end end - class Residence < FinchAPI::BaseModel + class Residence < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :city @@ -1632,7 +1646,7 @@ module FinchAPI end end - class PayGroup < FinchAPI::BaseModel + class PayGroup < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -1682,7 +1696,7 @@ module FinchAPI end end - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable( @@ -1696,7 +1710,7 @@ module FinchAPI params( paging: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1716,7 +1730,7 @@ module FinchAPI params( pay_statements: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1727,11 +1741,11 @@ module FinchAPI params( paging: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), pay_statements: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -1751,7 +1765,7 @@ module FinchAPI def to_hash end - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel sig { returns(T::Boolean) } attr_accessor :count @@ -1767,7 +1781,7 @@ module FinchAPI end end - class PayStatements < FinchAPI::BaseModel + class PayStatements < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable( @@ -1781,7 +1795,7 @@ module FinchAPI params( earnings: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1801,7 +1815,7 @@ module FinchAPI params( employee_deductions: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1821,7 +1835,7 @@ module FinchAPI params( employer_contributions: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1865,7 +1879,7 @@ module FinchAPI params( taxes: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1888,15 +1902,15 @@ module FinchAPI params( earnings: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employee_deductions: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employer_contributions: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), gross_pay: T::Boolean, individual_id: T::Boolean, @@ -1904,7 +1918,7 @@ module FinchAPI payment_method: T::Boolean, taxes: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), total_hours: T::Boolean, type: T::Boolean @@ -1945,7 +1959,7 @@ module FinchAPI def to_hash end - class Earnings < FinchAPI::BaseModel + class Earnings < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -1991,7 +2005,7 @@ module FinchAPI end end - class EmployeeDeductions < FinchAPI::BaseModel + class EmployeeDeductions < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -2051,7 +2065,7 @@ module FinchAPI end end - class EmployerContributions < FinchAPI::BaseModel + class EmployerContributions < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -2085,7 +2099,7 @@ module FinchAPI end end - class Taxes < FinchAPI::BaseModel + class Taxes < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -2147,7 +2161,7 @@ module FinchAPI end end - class Payment < FinchAPI::BaseModel + class Payment < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -2227,7 +2241,7 @@ module FinchAPI params( pay_period: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -2249,7 +2263,7 @@ module FinchAPI pay_group_ids: T::Boolean, pay_period: T.any( FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -2292,7 +2306,7 @@ module FinchAPI def to_hash end - class PayPeriod < FinchAPI::BaseModel + class PayPeriod < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :end_date @@ -2318,12 +2332,18 @@ module FinchAPI # The type of authentication method. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol + ) + end ASSISTED = T.let(:assisted, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol) @@ -2350,10 +2370,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::AccountUpdateEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol) } ACCOUNT_UPDATED = T.let(:"account.updated", FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/base_webhook_event.rbi b/rbi/lib/finch_api/models/base_webhook_event.rbi similarity index 94% rename from rbi/lib/finch-api/models/base_webhook_event.rbi rename to rbi/lib/finch_api/models/base_webhook_event.rbi index 0516e4ce..fc24be47 100644 --- a/rbi/lib/finch-api/models/base_webhook_event.rbi +++ b/rbi/lib/finch_api/models/base_webhook_event.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class BaseWebhookEvent < FinchAPI::BaseModel + class BaseWebhookEvent < FinchAPI::Internal::Type::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. diff --git a/rbi/lib/finch-api/models/company_event.rbi b/rbi/lib/finch_api/models/company_event.rbi similarity index 88% rename from rbi/lib/finch-api/models/company_event.rbi rename to rbi/lib/finch_api/models/company_event.rbi index 5dc180c6..526be753 100644 --- a/rbi/lib/finch-api/models/company_event.rbi +++ b/rbi/lib/finch_api/models/company_event.rbi @@ -35,10 +35,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::CompanyEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol) } COMPANY_UPDATED = T.let(:"company.updated", FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/connect/session_new_params.rbi b/rbi/lib/finch_api/models/connect/session_new_params.rbi similarity index 87% rename from rbi/lib/finch-api/models/connect/session_new_params.rbi rename to rbi/lib/finch_api/models/connect/session_new_params.rbi index 784c1e83..1cb3caf7 100644 --- a/rbi/lib/finch-api/models/connect/session_new_params.rbi +++ b/rbi/lib/finch_api/models/connect/session_new_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Connect - class SessionNewParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class SessionNewParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(String) } attr_accessor :customer_id @@ -24,7 +24,7 @@ module FinchAPI sig do params( - integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Util::AnyHash)) + integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Internal::AnyHash)) ) .void end @@ -50,12 +50,12 @@ module FinchAPI customer_name: String, products: T::Array[FinchAPI::Models::Connect::SessionNewParams::Product::OrSymbol], customer_email: T.nilable(String), - integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Util::AnyHash)), + integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Internal::AnyHash)), manual: T.nilable(T::Boolean), minutes_to_expire: T.nilable(Float), redirect_uri: T.nilable(String), sandbox: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Sandbox::OrSymbol), - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -95,11 +95,11 @@ module FinchAPI # The Finch products that can be requested during the Connect flow. module Product - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) } COMPANY = T.let(:company, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) DIRECTORY = T.let(:directory, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) @@ -115,7 +115,7 @@ module FinchAPI end end - class Integration < FinchAPI::BaseModel + class Integration < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::OrSymbol)) } attr_accessor :auth_method @@ -145,12 +145,12 @@ module FinchAPI end module AuthMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) } ASSISTED = T.let(:assisted, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) @@ -170,11 +170,11 @@ module FinchAPI end module Sandbox - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol) } FINCH = T.let(:finch, FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol) PROVIDER = T.let(:provider, FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/connect/session_new_response.rbi b/rbi/lib/finch_api/models/connect/session_new_response.rbi similarity index 90% rename from rbi/lib/finch-api/models/connect/session_new_response.rbi rename to rbi/lib/finch_api/models/connect/session_new_response.rbi index 99b78779..5ed8a052 100644 --- a/rbi/lib/finch-api/models/connect/session_new_response.rbi +++ b/rbi/lib/finch_api/models/connect/session_new_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Connect - class SessionNewResponse < FinchAPI::BaseModel + class SessionNewResponse < FinchAPI::Internal::Type::BaseModel # The Connect URL to redirect the user to for authentication sig { returns(String) } attr_accessor :connect_url diff --git a/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi b/rbi/lib/finch_api/models/connect/session_reauthenticate_params.rbi similarity index 84% rename from rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi rename to rbi/lib/finch_api/models/connect/session_reauthenticate_params.rbi index 52d255d3..a108d50b 100644 --- a/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi +++ b/rbi/lib/finch_api/models/connect/session_reauthenticate_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Connect - class SessionReauthenticateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class SessionReauthenticateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The ID of the existing connection to reauthenticate sig { returns(String) } @@ -30,11 +30,17 @@ module FinchAPI minutes_to_expire: T.nilable(Integer), products: T.nilable(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::OrSymbol]), redirect_uri: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end - def self.new(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 @@ -54,12 +60,12 @@ module FinchAPI # The Finch products that can be requested during the Connect flow. module Product - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) } COMPANY = T.let(:company, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) DIRECTORY = diff --git a/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi b/rbi/lib/finch_api/models/connect/session_reauthenticate_response.rbi similarity index 88% rename from rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi rename to rbi/lib/finch_api/models/connect/session_reauthenticate_response.rbi index fa8b1c7d..b1f4b7ea 100644 --- a/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi +++ b/rbi/lib/finch_api/models/connect/session_reauthenticate_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Connect - class SessionReauthenticateResponse < FinchAPI::BaseModel + class SessionReauthenticateResponse < FinchAPI::Internal::Type::BaseModel # The Connect URL to redirect the user to for reauthentication sig { returns(String) } attr_accessor :connect_url diff --git a/rbi/lib/finch-api/models/connection_status_type.rbi b/rbi/lib/finch_api/models/connection_status_type.rbi similarity index 85% rename from rbi/lib/finch-api/models/connection_status_type.rbi rename to rbi/lib/finch_api/models/connection_status_type.rbi index 672cd482..5762e16b 100644 --- a/rbi/lib/finch-api/models/connection_status_type.rbi +++ b/rbi/lib/finch_api/models/connection_status_type.rbi @@ -3,10 +3,10 @@ module FinchAPI module Models module ConnectionStatusType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::ConnectionStatusType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) } PENDING = T.let(:pending, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) PROCESSING = T.let(:processing, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/create_access_token_response.rbi b/rbi/lib/finch_api/models/create_access_token_response.rbi similarity index 91% rename from rbi/lib/finch-api/models/create_access_token_response.rbi rename to rbi/lib/finch_api/models/create_access_token_response.rbi index bfcc9759..bf5e740e 100644 --- a/rbi/lib/finch-api/models/create_access_token_response.rbi +++ b/rbi/lib/finch_api/models/create_access_token_response.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class CreateAccessTokenResponse < FinchAPI::BaseModel + class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel # The access token for the connection. sig { returns(String) } attr_accessor :access_token @@ -103,11 +103,11 @@ module FinchAPI # The type of application associated with a token. module ClientType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ClientType) } OrSymbol = - T.type_alias { T.any(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) } PRODUCTION = T.let(:production, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) DEVELOPMENT = T.let(:development, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) @@ -123,12 +123,12 @@ module FinchAPI # - `provider` - connection to an external provider # - `finch` - finch-generated data. module ConnectionType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType) } OrSymbol = - T.type_alias { T.any(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) } PROVIDER = T.let(:provider, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) FINCH = T.let(:finch, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/directory_event.rbi b/rbi/lib/finch_api/models/directory_event.rbi similarity index 88% rename from rbi/lib/finch-api/models/directory_event.rbi rename to rbi/lib/finch_api/models/directory_event.rbi index 6854755f..fd577676 100644 --- a/rbi/lib/finch-api/models/directory_event.rbi +++ b/rbi/lib/finch_api/models/directory_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::DirectoryEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::DirectoryEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::DirectoryEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::DirectoryEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::DirectoryEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::DirectoryEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,7 +37,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # The ID of the individual related to the event. sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -55,10 +55,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::DirectoryEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) } DIRECTORY_CREATED = T.let(:"directory.created", FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/disconnect_response.rbi b/rbi/lib/finch_api/models/disconnect_response.rbi similarity index 85% rename from rbi/lib/finch-api/models/disconnect_response.rbi rename to rbi/lib/finch_api/models/disconnect_response.rbi index 1b96cae8..0bce5375 100644 --- a/rbi/lib/finch-api/models/disconnect_response.rbi +++ b/rbi/lib/finch_api/models/disconnect_response.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class DisconnectResponse < FinchAPI::BaseModel + class DisconnectResponse < FinchAPI::Internal::Type::BaseModel # If the request is successful, Finch will return “success” (HTTP 200 status). sig { returns(String) } attr_accessor :status diff --git a/rbi/lib/finch-api/models/employment_event.rbi b/rbi/lib/finch_api/models/employment_event.rbi similarity index 88% rename from rbi/lib/finch-api/models/employment_event.rbi rename to rbi/lib/finch_api/models/employment_event.rbi index 3a6e3e7d..cc0f185f 100644 --- a/rbi/lib/finch-api/models/employment_event.rbi +++ b/rbi/lib/finch_api/models/employment_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::EmploymentEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::EmploymentEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::EmploymentEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::EmploymentEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::EmploymentEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::EmploymentEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,7 +37,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # The ID of the individual related to the event. sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -55,10 +55,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::EmploymentEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) } EMPLOYMENT_CREATED = T.let(:"employment.created", FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/hris/benefit_contribution.rbi b/rbi/lib/finch_api/models/hris/benefit_contribution.rbi similarity index 86% rename from rbi/lib/finch-api/models/hris/benefit_contribution.rbi rename to rbi/lib/finch_api/models/hris/benefit_contribution.rbi index e946879e..6fbaacca 100644 --- a/rbi/lib/finch-api/models/hris/benefit_contribution.rbi +++ b/rbi/lib/finch_api/models/hris/benefit_contribution.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class BenefitContribution < FinchAPI::BaseModel + class BenefitContribution < FinchAPI::Internal::Type::BaseModel # Contribution amount in cents (if `fixed`) or basis points (if `percent`). sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -33,11 +33,11 @@ module FinchAPI # Contribution type. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol) } FIXED = T.let(:fixed, FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol) PERCENT = T.let(:percent, FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/hris/benefit_create_params.rbi b/rbi/lib/finch_api/models/hris/benefit_create_params.rbi similarity index 84% rename from rbi/lib/finch-api/models/hris/benefit_create_params.rbi rename to rbi/lib/finch_api/models/hris/benefit_create_params.rbi index 044347e1..1f879443 100644 --- a/rbi/lib/finch-api/models/hris/benefit_create_params.rbi +++ b/rbi/lib/finch_api/models/hris/benefit_create_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class BenefitCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::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. @@ -16,6 +16,7 @@ module FinchAPI sig { params(description: String).void } attr_writer :description + # The frequency of the benefit deduction/contribution. sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol)) } attr_accessor :frequency @@ -28,7 +29,7 @@ module FinchAPI description: String, 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) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi b/rbi/lib/finch_api/models/hris/benefit_features_and_operations.rbi similarity index 92% rename from rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi rename to rbi/lib/finch_api/models/hris/benefit_features_and_operations.rbi index 45f38f6b..73cea373 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 @@ -3,13 +3,16 @@ module FinchAPI module Models module HRIS - class BenefitFeaturesAndOperations < FinchAPI::BaseModel + class BenefitFeaturesAndOperations < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures)) } attr_reader :supported_features sig do params( - supported_features: T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, FinchAPI::Util::AnyHash) + supported_features: T.any( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + FinchAPI::Internal::AnyHash + ) ) .void end @@ -20,7 +23,7 @@ module FinchAPI sig do params( - supported_operations: T.any(FinchAPI::Models::HRIS::SupportPerBenefitType, FinchAPI::Util::AnyHash) + supported_operations: T.any(FinchAPI::Models::HRIS::SupportPerBenefitType, FinchAPI::Internal::AnyHash) ) .void end @@ -28,8 +31,11 @@ module FinchAPI sig do params( - supported_features: T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, FinchAPI::Util::AnyHash), - supported_operations: T.any(FinchAPI::Models::HRIS::SupportPerBenefitType, FinchAPI::Util::AnyHash) + supported_features: T.any( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + FinchAPI::Internal::AnyHash + ), + supported_operations: T.any(FinchAPI::Models::HRIS::SupportPerBenefitType, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -48,7 +54,7 @@ module FinchAPI def to_hash end - class SupportedFeatures < FinchAPI::BaseModel + class SupportedFeatures < FinchAPI::Internal::Type::BaseModel # Whether the provider supports an annual maximum for this benefit. sig { returns(T.nilable(T::Boolean)) } attr_accessor :annual_maximum @@ -190,7 +196,7 @@ module FinchAPI end module CompanyContribution - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias do @@ -200,6 +206,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol ) end @@ -226,7 +233,7 @@ module FinchAPI end module EmployeeDeduction - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction) } @@ -234,6 +241,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol ) end @@ -260,7 +268,7 @@ module FinchAPI end module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias do @@ -270,6 +278,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol ) end diff --git a/rbi/lib/finch-api/models/hris/benefit_frequency.rbi b/rbi/lib/finch_api/models/hris/benefit_frequency.rbi similarity index 74% rename from rbi/lib/finch-api/models/hris/benefit_frequency.rbi rename to rbi/lib/finch_api/models/hris/benefit_frequency.rbi index cfec91c8..c9dc062b 100644 --- a/rbi/lib/finch-api/models/hris/benefit_frequency.rbi +++ b/rbi/lib/finch_api/models/hris/benefit_frequency.rbi @@ -3,11 +3,12 @@ module FinchAPI module Models module HRIS + # The frequency of the benefit deduction/contribution. module BenefitFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitFrequency) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) } ONE_TIME = T.let(:one_time, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) EVERY_PAYCHECK = T.let(:every_paycheck, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) diff --git a/rbi/lib/finch_api/models/hris/benefit_list_params.rbi b/rbi/lib/finch_api/models/hris/benefit_list_params.rbi new file mode 100644 index 00000000..aca8a6da --- /dev/null +++ b/rbi/lib/finch_api/models/hris/benefit_list_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/benefit_list_supported_benefits_params.rbi b/rbi/lib/finch_api/models/hris/benefit_list_supported_benefits_params.rbi new file mode 100644 index 00000000..29ae55c3 --- /dev/null +++ b/rbi/lib/finch_api/models/hris/benefit_list_supported_benefits_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitListSupportedBenefitsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/benefit_retrieve_params.rbi b/rbi/lib/finch_api/models/hris/benefit_retrieve_params.rbi new file mode 100644 index 00000000..b6582168 --- /dev/null +++ b/rbi/lib/finch_api/models/hris/benefit_retrieve_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_type.rbi b/rbi/lib/finch_api/models/hris/benefit_type.rbi similarity index 63% rename from rbi/lib/finch-api/models/hris/benefit_type.rbi rename to rbi/lib/finch_api/models/hris/benefit_type.rbi index cd0e2c26..9b113fa7 100644 --- a/rbi/lib/finch-api/models/hris/benefit_type.rbi +++ b/rbi/lib/finch_api/models/hris/benefit_type.rbi @@ -5,18 +5,18 @@ module FinchAPI module HRIS # Type of benefit. module BenefitType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } - 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) + BENEFIT_TYPE_401K = T.let(:"401k", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + BENEFIT_TYPE_401K_ROTH = T.let(:"401k_roth", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + BENEFIT_TYPE_401K_LOAN = T.let(:"401k_loan", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + BENEFIT_TYPE_403B = T.let(:"403b", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + BENEFIT_TYPE_403B_ROTH = T.let(:"403b_roth", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + BENEFIT_TYPE_457 = T.let(:"457", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + BENEFIT_TYPE_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) diff --git a/rbi/lib/finch-api/models/hris/benefit_update_params.rbi b/rbi/lib/finch_api/models/hris/benefit_update_params.rbi similarity index 65% rename from rbi/lib/finch-api/models/hris/benefit_update_params.rbi rename to rbi/lib/finch_api/models/hris/benefit_update_params.rbi index f8d06c9a..f222f948 100644 --- a/rbi/lib/finch-api/models/hris/benefit_update_params.rbi +++ b/rbi/lib/finch_api/models/hris/benefit_update_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class BenefitUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class BenefitUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Updated name or description. sig { returns(T.nilable(String)) } @@ -17,7 +17,10 @@ module FinchAPI sig do params( description: String, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Internal::AnyHash + ) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi b/rbi/lib/finch_api/models/hris/benefits/enrolled_individual.rbi similarity index 89% rename from rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi rename to rbi/lib/finch_api/models/hris/benefits/enrolled_individual.rbi index 965d62f4..08f7a8b7 100644 --- a/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi +++ b/rbi/lib/finch_api/models/hris/benefits/enrolled_individual.rbi @@ -4,12 +4,14 @@ module FinchAPI module Models module HRIS module Benefits - class EnrolledIndividual < FinchAPI::BaseModel + class EnrolledIndividual < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body)) } attr_reader :body sig do - params(body: T.any(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, FinchAPI::Util::AnyHash)) + params( + body: T.any(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, FinchAPI::Internal::AnyHash) + ) .void end attr_writer :body @@ -29,7 +31,7 @@ module FinchAPI sig do params( - body: T.any(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, FinchAPI::Util::AnyHash), + body: T.any(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, FinchAPI::Internal::AnyHash), code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::OrInteger, individual_id: String ) @@ -51,8 +53,8 @@ module FinchAPI def to_hash end - class Body < FinchAPI::BaseModel - # A descriptive identifier for the response + class Body < FinchAPI::Internal::Type::BaseModel + # A descriptive identifier for the response. sig { returns(T.nilable(String)) } attr_accessor :finch_code @@ -86,7 +88,7 @@ module FinchAPI # HTTP status code. Either 201 or 200 module Code - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedInteger = T.type_alias { T.all(Integer, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code) } diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi b/rbi/lib/finch_api/models/hris/benefits/individual_benefit.rbi similarity index 88% rename from rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi rename to rbi/lib/finch_api/models/hris/benefits/individual_benefit.rbi index c481e71e..f91662b1 100644 --- a/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi +++ b/rbi/lib/finch_api/models/hris/benefits/individual_benefit.rbi @@ -4,12 +4,14 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualBenefit < FinchAPI::BaseModel + class IndividualBenefit < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body)) } attr_reader :body sig do - params(body: T.any(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, FinchAPI::Util::AnyHash)) + params( + body: T.any(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, FinchAPI::Internal::AnyHash) + ) .void end attr_writer :body @@ -28,7 +30,7 @@ module FinchAPI sig do params( - body: T.any(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, FinchAPI::Util::AnyHash), + body: T.any(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, FinchAPI::Internal::AnyHash), code: Integer, individual_id: String ) @@ -46,7 +48,7 @@ module FinchAPI def to_hash end - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel # If the benefit supports annual maximum, the amount in cents for this individual. sig { returns(T.nilable(Integer)) } attr_accessor :annual_maximum @@ -61,7 +63,7 @@ module FinchAPI sig do params( - company_contribution: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Util::AnyHash)) + company_contribution: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Internal::AnyHash)) ) .void end @@ -72,7 +74,7 @@ module FinchAPI sig do params( - employee_deduction: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Util::AnyHash)) + employee_deduction: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Internal::AnyHash)) ) .void end @@ -90,8 +92,8 @@ module FinchAPI params( annual_maximum: T.nilable(Integer), catch_up: T.nilable(T::Boolean), - 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)), + company_contribution: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Internal::AnyHash)), + employee_deduction: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Internal::AnyHash)), hsa_contribution_limit: T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::OrSymbol) ) .returns(T.attached_class) @@ -122,7 +124,7 @@ module FinchAPI # Type for HSA contribution limit if the benefit is a HSA. module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit) } @@ -130,6 +132,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol ) 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 similarity index 88% rename from rbi/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rbi rename to rbi/lib/finch_api/models/hris/benefits/individual_enroll_many_params.rbi index 6d484da7..8b3e60c9 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 @@ -4,9 +4,9 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualEnrollManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualEnrollManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Array of the individual_id to enroll and a configuration object. sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual])) } @@ -14,7 +14,12 @@ module FinchAPI sig do params( - individuals: T::Array[T.any(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, FinchAPI::Util::AnyHash)] + individuals: T::Array[ + T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, + FinchAPI::Internal::AnyHash + ) + ] ) .void end @@ -22,8 +27,13 @@ module FinchAPI sig do params( - individuals: T::Array[T.any(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, FinchAPI::Util::AnyHash)], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + individuals: T::Array[ + T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, + FinchAPI::Internal::AnyHash + ) + ], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -42,7 +52,7 @@ module FinchAPI def to_hash end - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) @@ -54,7 +64,7 @@ module FinchAPI params( configuration: T.any( FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -72,7 +82,7 @@ module FinchAPI params( configuration: T.any( FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), individual_id: String ) @@ -93,7 +103,7 @@ module FinchAPI def to_hash end - class Configuration < FinchAPI::BaseModel + class Configuration < FinchAPI::Internal::Type::BaseModel # For HSA benefits only - whether the contribution limit is for an individual or # family sig do @@ -137,13 +147,20 @@ module FinchAPI params( company_contribution: T.any( FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void end attr_writer :company_contribution + # The date the enrollment will take effect + sig { returns(T.nilable(Date)) } + attr_reader :effective_date + + sig { params(effective_date: Date).void } + attr_writer :effective_date + sig do returns( T.nilable( @@ -157,7 +174,7 @@ module FinchAPI params( employee_deduction: T.any( FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -171,11 +188,12 @@ module FinchAPI catch_up: T::Boolean, company_contribution: T.any( FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), + effective_date: Date, employee_deduction: T.any( FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -185,6 +203,7 @@ module FinchAPI annual_maximum: nil, catch_up: nil, company_contribution: nil, + effective_date: nil, employee_deduction: nil ) end @@ -197,6 +216,7 @@ module FinchAPI annual_maximum: T.nilable(Integer), catch_up: T::Boolean, company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + effective_date: Date, employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction } ) @@ -207,7 +227,7 @@ module FinchAPI # For HSA benefits only - whether the contribution limit is for an individual or # family module AnnualContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias do @@ -217,6 +237,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::TaggedSymbol ) end @@ -244,7 +265,7 @@ module FinchAPI end end - class CompanyContribution < FinchAPI::BaseModel + class CompanyContribution < FinchAPI::Internal::Type::BaseModel # Amount in cents for fixed type or basis points (1/100th of a percent) for # percent type sig { returns(T.nilable(Integer)) } @@ -293,7 +314,7 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias do @@ -303,6 +324,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::TaggedSymbol ) end @@ -331,7 +353,7 @@ module FinchAPI end end - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # Amount in cents for fixed type or basis points (1/100th of a percent) for # percent type sig { returns(T.nilable(Integer)) } @@ -380,7 +402,7 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias do @@ -390,6 +412,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::TaggedSymbol ) end diff --git a/rbi/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi b/rbi/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi new file mode 100644 index 00000000..f7720c79 --- /dev/null +++ b/rbi/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrolledIDsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbi b/rbi/lib/finch_api/models/hris/benefits/individual_enrolled_ids_response.rbi similarity index 83% rename from rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbi rename to rbi/lib/finch_api/models/hris/benefits/individual_enrolled_ids_response.rbi index ef979642..7aa2de46 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 @@ -4,7 +4,8 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualEnrolledIDsResponse < FinchAPI::BaseModel + class IndividualEnrolledIDsResponse < FinchAPI::Internal::Type::BaseModel + # The id of the benefit. sig { returns(String) } attr_accessor :benefit_id 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 similarity index 71% rename from rbi/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi rename to rbi/lib/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi index 63a57ee2..ee1bf5cf 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 @@ -4,9 +4,9 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualRetrieveManyBenefitsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # comma-delimited list of stable Finch uuids for each individual. If empty, # defaults to all individuals @@ -19,10 +19,7 @@ module FinchAPI sig do params( individual_ids: String, - request_options: T.any( - FinchAPI::RequestOptions, - FinchAPI::Util::AnyHash - ) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rbi b/rbi/lib/finch_api/models/hris/benefits/individual_unenroll_many_params.rbi similarity index 77% rename from rbi/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rbi rename to rbi/lib/finch_api/models/hris/benefits/individual_unenroll_many_params.rbi index 7b2b615f..4563d344 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 @@ -4,9 +4,9 @@ module FinchAPI module Models module HRIS module Benefits - class IndividualUnenrollManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualUnenrollManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Array of individual_ids to unenroll. sig { returns(T.nilable(T::Array[String])) } @@ -18,7 +18,7 @@ module FinchAPI sig do params( individual_ids: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi b/rbi/lib/finch_api/models/hris/benefits/unenrolled_individual.rbi similarity index 87% rename from rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi rename to rbi/lib/finch_api/models/hris/benefits/unenrolled_individual.rbi index 5a8206ce..ac932e6d 100644 --- a/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi +++ b/rbi/lib/finch_api/models/hris/benefits/unenrolled_individual.rbi @@ -4,12 +4,14 @@ module FinchAPI module Models module HRIS module Benefits - class UnenrolledIndividual < FinchAPI::BaseModel + class UnenrolledIndividual < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body)) } attr_reader :body sig do - params(body: T.any(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, FinchAPI::Util::AnyHash)) + params( + body: T.any(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, FinchAPI::Internal::AnyHash) + ) .void end attr_writer :body @@ -29,7 +31,7 @@ module FinchAPI sig do params( - body: T.any(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, FinchAPI::Util::AnyHash), + body: T.any(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, FinchAPI::Internal::AnyHash), code: Integer, individual_id: String ) @@ -47,7 +49,7 @@ module FinchAPI def to_hash end - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel # A descriptive identifier for the response. sig { returns(T.nilable(String)) } attr_accessor :finch_code diff --git a/rbi/lib/finch-api/models/hris/benefits_support.rbi b/rbi/lib/finch_api/models/hris/benefits_support.rbi similarity index 80% rename from rbi/lib/finch-api/models/hris/benefits_support.rbi rename to rbi/lib/finch_api/models/hris/benefits_support.rbi index 0394d2d9..e69b5ab7 100644 --- a/rbi/lib/finch-api/models/hris/benefits_support.rbi +++ b/rbi/lib/finch_api/models/hris/benefits_support.rbi @@ -3,13 +3,13 @@ module FinchAPI module Models module HRIS - class BenefitsSupport < FinchAPI::BaseModel + class BenefitsSupport < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } attr_reader :commuter sig do params( - commuter: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + commuter: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -20,7 +20,7 @@ module FinchAPI sig do params( - custom_post_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + custom_post_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -31,7 +31,7 @@ module FinchAPI sig do params( - custom_pre_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + custom_pre_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -42,7 +42,7 @@ module FinchAPI sig do params( - fsa_dependent_care: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + fsa_dependent_care: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -53,7 +53,7 @@ module FinchAPI sig do params( - fsa_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + fsa_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -64,7 +64,7 @@ module FinchAPI sig do params( - hsa_post: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + hsa_post: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -75,7 +75,7 @@ module FinchAPI sig do params( - hsa_pre: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + hsa_pre: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -86,7 +86,7 @@ module FinchAPI sig do params( - s125_dental: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + s125_dental: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -97,7 +97,7 @@ module FinchAPI sig do params( - s125_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + s125_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -108,7 +108,7 @@ module FinchAPI sig do params( - s125_vision: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + s125_vision: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -119,7 +119,7 @@ module FinchAPI sig do params( - simple: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + simple: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -130,7 +130,7 @@ module FinchAPI sig do params( - simple_ira: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + simple_ira: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .void end @@ -140,18 +140,18 @@ module FinchAPI # supported, the property will be null sig do params( - 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)) + commuter: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + custom_post_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + custom_pre_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + fsa_dependent_care: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + fsa_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + hsa_post: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + hsa_pre: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + s125_dental: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + s125_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + s125_vision: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + simple: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)), + simple_ira: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Internal::AnyHash)) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/benfit_contribution.rbi b/rbi/lib/finch_api/models/hris/benfit_contribution.rbi similarity index 100% rename from rbi/lib/finch-api/models/hris/benfit_contribution.rbi rename to rbi/lib/finch_api/models/hris/benfit_contribution.rbi diff --git a/rbi/lib/finch-api/models/hris/company.rbi b/rbi/lib/finch_api/models/hris/company.rbi similarity index 86% rename from rbi/lib/finch-api/models/hris/company.rbi rename to rbi/lib/finch_api/models/hris/company.rbi index 1309816e..95fc74b6 100644 --- a/rbi/lib/finch-api/models/hris/company.rbi +++ b/rbi/lib/finch_api/models/hris/company.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class HRISCompany < FinchAPI::BaseModel + class HRISCompany < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for the company. sig { returns(String) } attr_accessor :id @@ -24,7 +24,10 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) } attr_reader :entity - sig { params(entity: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Entity, FinchAPI::Util::AnyHash))).void } + sig do + params(entity: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Entity, FinchAPI::Internal::AnyHash))) + .void + end attr_writer :entity # The legal name of the company. @@ -45,14 +48,14 @@ module FinchAPI sig do params( id: String, - accounts: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::HRISCompany::Account, FinchAPI::Util::AnyHash)]), + accounts: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::HRISCompany::Account, FinchAPI::Internal::AnyHash)]), departments: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department, FinchAPI::Internal::AnyHash))] ), ein: T.nilable(String), - entity: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Entity, FinchAPI::Util::AnyHash)), + entity: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Entity, FinchAPI::Internal::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String) ) @@ -90,7 +93,7 @@ module FinchAPI def to_hash end - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel # The name of the bank associated in the payroll/HRIS system. sig { returns(T.nilable(String)) } attr_accessor :account_name @@ -122,7 +125,13 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -142,11 +151,11 @@ module FinchAPI # The type of bank account. module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol) } CHECKING = T.let(:checking, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol) SAVINGS = T.let(:savings, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol) @@ -157,7 +166,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The department name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -168,7 +177,7 @@ module FinchAPI sig do params( - parent: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department::Parent, FinchAPI::Util::AnyHash)) + parent: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department::Parent, FinchAPI::Internal::AnyHash)) ) .void end @@ -177,7 +186,7 @@ module FinchAPI sig do params( name: T.nilable(String), - parent: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department::Parent, FinchAPI::Util::AnyHash)) + parent: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department::Parent, FinchAPI::Internal::AnyHash)) ) .returns(T.attached_class) end @@ -193,7 +202,7 @@ module FinchAPI def to_hash end - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel # The parent department's name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -209,7 +218,7 @@ module FinchAPI end end - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel # The tax payer subtype of the company. sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol)) } attr_accessor :subtype @@ -243,11 +252,11 @@ module FinchAPI # The tax payer subtype of the company. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol) } 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) @@ -260,11 +269,11 @@ module FinchAPI # The tax payer type of the company. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) } LLC = T.let(:llc, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) LP = T.let(:lp, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rbi new file mode 100644 index 00000000..52f9b57e --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # Specifies the fields to be applied when the condition is met. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes)) } + attr_reader :attributes + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + FinchAPI::Internal::AnyHash + ) + ) + .void + end + attr_writer :attributes + + sig do + returns( + T.nilable(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition]) + ) + end + attr_reader :conditions + + sig do + params( + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition, + FinchAPI::Internal::AnyHash + ) + ] + ) + .void + end + attr_writer :conditions + + # Specifies when the rules should stop applying rules based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_end_date + + # Specifies when the rule should begin applying based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_start_date + + # The entity type to which the rule is applied. + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::OrSymbol) + ) + end + attr_reader :entity_type + + sig do + params( + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::OrSymbol + ) + .void + end + attr_writer :entity_type + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + FinchAPI::Internal::AnyHash + ), + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition, + FinchAPI::Internal::AnyHash + ) + ], + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::OrSymbol, + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + attributes: nil, + conditions: nil, + effective_end_date: nil, + effective_start_date: nil, + entity_type: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + conditions: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition], + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::OrSymbol, + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::Internal::Type::BaseModel + # The metadata to be attached in the entity. 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])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + attr_writer :metadata + + # Specifies the fields to be applied when the condition is met. + 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]}) } + def to_hash + end + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # The field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # The operator to be used in the rule. + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::OrSymbol + ) + ) + end + attr_reader :operator + + sig do + params( + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::OrSymbol + ) + .void + end + attr_writer :operator + + # The value of the field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::OrSymbol, + value: String + ) + .returns(T.attached_class) + end + def self.new(field: nil, operator: nil, value: nil) + end + + sig do + override + .returns( + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::OrSymbol, + value: String + } + ) + end + def to_hash + end + + # The operator to be used in the rule. + module Operator + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::TaggedSymbol + ) + end + + EQUALS = + T.let( + :equals, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::Operator::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The entity type to which the rule is applied. + module EntityType + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::TaggedSymbol + ) + end + + PAY_STATEMENT_ITEM = + T.let( + :pay_statement_item, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_create_response.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_create_response.rbi new file mode 100644 index 00000000..aba6f7ac --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_create_response.rbi @@ -0,0 +1,293 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleCreateResponse < FinchAPI::Internal::Type::BaseModel + # Finch id (uuidv4) for the rule. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Specifies the fields to be applied when the condition is met. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes)) } + attr_reader :attributes + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes, + FinchAPI::Internal::AnyHash + ) + ) + .void + end + attr_writer :attributes + + sig do + returns( + T.nilable(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition]) + ) + end + attr_reader :conditions + + sig do + params( + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ] + ) + .void + end + attr_writer :conditions + + # The datetime when the rule was created. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Specifies when the rules should stop applying rules based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_end_date + + # Specifies when the rule should begin applying based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_start_date + + # The entity type to which the rule is applied. + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::TaggedSymbol) + ) + end + attr_reader :entity_type + + sig do + params( + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::OrSymbol + ) + .void + end + attr_writer :entity_type + + # The priority of the rule. + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + # The datetime when the rule was last updated. + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes, + FinchAPI::Internal::AnyHash + ), + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ], + created_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::OrSymbol, + priority: Integer, + updated_at: Time + ) + .returns(T.attached_class) + end + def self.new( + id: nil, + attributes: nil, + conditions: nil, + created_at: nil, + effective_end_date: nil, + effective_start_date: nil, + entity_type: nil, + priority: nil, + updated_at: nil + ) + end + + sig do + override + .returns( + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes, + conditions: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition], + created_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::TaggedSymbol, + priority: Integer, + updated_at: Time + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::Internal::Type::BaseModel + # The metadata to be attached in the entity. 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])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + attr_writer :metadata + + # Specifies the fields to be applied when the condition is met. + 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]}) } + def to_hash + end + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # The field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # The operator to be used in the rule. + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::TaggedSymbol + ) + ) + end + attr_reader :operator + + sig do + params( + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::OrSymbol + ) + .void + end + attr_writer :operator + + # The value of the field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::OrSymbol, + value: String + ) + .returns(T.attached_class) + end + def self.new(field: nil, operator: nil, value: nil) + end + + sig do + override + .returns( + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The operator to be used in the rule. + module Operator + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::TaggedSymbol + ) + end + + EQUALS = + T.let( + :equals, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::Operator::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The entity type to which the rule is applied. + module EntityType + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::TaggedSymbol + ) + end + + PAY_STATEMENT_ITEM = + T.let( + :pay_statement_item, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi new file mode 100644 index 00000000..45ccf9be --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleDeleteParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rbi new file mode 100644 index 00000000..218e80bf --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rbi @@ -0,0 +1,303 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleDeleteResponse < FinchAPI::Internal::Type::BaseModel + # Finch id (uuidv4) for the rule. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Specifies the fields to be applied when the condition is met. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes)) } + attr_reader :attributes + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes, + FinchAPI::Internal::AnyHash + ) + ) + .void + end + attr_writer :attributes + + sig do + returns( + T.nilable(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition]) + ) + end + attr_reader :conditions + + sig do + params( + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ] + ) + .void + end + attr_writer :conditions + + # The datetime when the rule was created. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # The datetime when the rule was deleted. + sig { returns(T.nilable(Time)) } + attr_reader :deleted_at + + sig { params(deleted_at: Time).void } + attr_writer :deleted_at + + # Specifies when the rules should stop applying rules based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_end_date + + # Specifies when the rule should begin applying based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_start_date + + # The entity type to which the rule is applied. + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::TaggedSymbol) + ) + end + attr_reader :entity_type + + sig do + params( + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::OrSymbol + ) + .void + end + attr_writer :entity_type + + # The priority of the rule. + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + # The datetime when the rule was last updated. + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes, + FinchAPI::Internal::AnyHash + ), + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ], + created_at: Time, + deleted_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::OrSymbol, + priority: Integer, + updated_at: Time + ) + .returns(T.attached_class) + end + def self.new( + id: nil, + attributes: nil, + conditions: nil, + created_at: nil, + deleted_at: nil, + effective_end_date: nil, + effective_start_date: nil, + entity_type: nil, + priority: nil, + updated_at: nil + ) + end + + sig do + override + .returns( + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes, + conditions: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition], + created_at: Time, + deleted_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::TaggedSymbol, + priority: Integer, + updated_at: Time + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::Internal::Type::BaseModel + # The metadata to be attached in the entity. 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])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + attr_writer :metadata + + # Specifies the fields to be applied when the condition is met. + 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]}) } + def to_hash + end + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # The field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # The operator to be used in the rule. + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::TaggedSymbol + ) + ) + end + attr_reader :operator + + sig do + params( + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::OrSymbol + ) + .void + end + attr_writer :operator + + # The value of the field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::OrSymbol, + value: String + ) + .returns(T.attached_class) + end + def self.new(field: nil, operator: nil, value: nil) + end + + sig do + override + .returns( + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The operator to be used in the rule. + module Operator + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::TaggedSymbol + ) + end + + EQUALS = + T.let( + :equals, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::Operator::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The entity type to which the rule is applied. + module EntityType + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::TaggedSymbol + ) + end + + PAY_STATEMENT_ITEM = + T.let( + :pay_statement_item, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_list_params.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_list_params.rbi new file mode 100644 index 00000000..2fd7c9b0 --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_list_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_list_response.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_list_response.rbi new file mode 100644 index 00000000..4cfe9db5 --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_list_response.rbi @@ -0,0 +1,293 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleListResponse < FinchAPI::Internal::Type::BaseModel + # Finch id (uuidv4) for the rule. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Specifies the fields to be applied when the condition is met. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes)) } + attr_reader :attributes + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes, + FinchAPI::Internal::AnyHash + ) + ) + .void + end + attr_writer :attributes + + sig do + returns( + T.nilable(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition]) + ) + end + attr_reader :conditions + + sig do + params( + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ] + ) + .void + end + attr_writer :conditions + + # The datetime when the rule was created. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Specifies when the rules should stop applying rules based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_end_date + + # Specifies when the rule should begin applying based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_start_date + + # The entity type to which the rule is applied. + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::TaggedSymbol) + ) + end + attr_reader :entity_type + + sig do + params( + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::OrSymbol + ) + .void + end + attr_writer :entity_type + + # The priority of the rule. + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + # The datetime when the rule was last updated. + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes, + FinchAPI::Internal::AnyHash + ), + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ], + created_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::OrSymbol, + priority: Integer, + updated_at: Time + ) + .returns(T.attached_class) + end + def self.new( + id: nil, + attributes: nil, + conditions: nil, + created_at: nil, + effective_end_date: nil, + effective_start_date: nil, + entity_type: nil, + priority: nil, + updated_at: nil + ) + end + + sig do + override + .returns( + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes, + conditions: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition], + created_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::TaggedSymbol, + priority: Integer, + updated_at: Time + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::Internal::Type::BaseModel + # The metadata to be attached in the entity. 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])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + attr_writer :metadata + + # Specifies the fields to be applied when the condition is met. + 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]}) } + def to_hash + end + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # The field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # The operator to be used in the rule. + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::TaggedSymbol + ) + ) + end + attr_reader :operator + + sig do + params( + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::OrSymbol + ) + .void + end + attr_writer :operator + + # The value of the field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::OrSymbol, + value: String + ) + .returns(T.attached_class) + end + def self.new(field: nil, operator: nil, value: nil) + end + + sig do + override + .returns( + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The operator to be used in the rule. + module Operator + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::TaggedSymbol + ) + end + + EQUALS = + T.let( + :equals, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::Operator::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The entity type to which the rule is applied. + module EntityType + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::TaggedSymbol + ) + end + + PAY_STATEMENT_ITEM = + T.let( + :pay_statement_item, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi new file mode 100644 index 00000000..78303f2a --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig { returns(T.nilable(T.anything)) } + attr_reader :optional_property + + sig { params(optional_property: T.anything).void } + attr_writer :optional_property + + sig do + params( + optional_property: T.anything, + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(optional_property: nil, request_options: {}) + end + + sig do + override.returns({optional_property: T.anything, request_options: FinchAPI::RequestOptions}) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_update_response.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_update_response.rbi new file mode 100644 index 00000000..18e4c80a --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item/rule_update_response.rbi @@ -0,0 +1,293 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + class RuleUpdateResponse < FinchAPI::Internal::Type::BaseModel + # Finch id (uuidv4) for the rule. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Specifies the fields to be applied when the condition is met. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes)) } + attr_reader :attributes + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes, + FinchAPI::Internal::AnyHash + ) + ) + .void + end + attr_writer :attributes + + sig do + returns( + T.nilable(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition]) + ) + end + attr_reader :conditions + + sig do + params( + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ] + ) + .void + end + attr_writer :conditions + + # The datetime when the rule was created. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Specifies when the rules should stop applying rules based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_end_date + + # Specifies when the rule should begin applying based on the date. + sig { returns(T.nilable(String)) } + attr_accessor :effective_start_date + + # The entity type to which the rule is applied. + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::TaggedSymbol) + ) + end + attr_reader :entity_type + + sig do + params( + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::OrSymbol + ) + .void + end + attr_writer :entity_type + + # The priority of the rule. + sig { returns(T.nilable(Integer)) } + attr_reader :priority + + sig { params(priority: Integer).void } + attr_writer :priority + + # The datetime when the rule was last updated. + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + id: String, + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes, + FinchAPI::Internal::AnyHash + ), + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition, + FinchAPI::Internal::AnyHash + ) + ], + created_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::OrSymbol, + priority: Integer, + updated_at: Time + ) + .returns(T.attached_class) + end + def self.new( + id: nil, + attributes: nil, + conditions: nil, + created_at: nil, + effective_end_date: nil, + effective_start_date: nil, + entity_type: nil, + priority: nil, + updated_at: nil + ) + end + + sig do + override + .returns( + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes, + conditions: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition], + created_at: Time, + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::TaggedSymbol, + priority: Integer, + updated_at: Time + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::Internal::Type::BaseModel + # The metadata to be attached in the entity. 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])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + attr_writer :metadata + + # Specifies the fields to be applied when the condition is met. + 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]}) } + def to_hash + end + end + + class Condition < FinchAPI::Internal::Type::BaseModel + # The field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # The operator to be used in the rule. + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::TaggedSymbol + ) + ) + end + attr_reader :operator + + sig do + params( + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::OrSymbol + ) + .void + end + attr_writer :operator + + # The value of the field to be checked in the rule. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::OrSymbol, + value: String + ) + .returns(T.attached_class) + end + def self.new(field: nil, operator: nil, value: nil) + end + + sig do + override + .returns( + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The operator to be used in the rule. + module Operator + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::TaggedSymbol + ) + end + + EQUALS = + T.let( + :equals, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::Operator::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The entity type to which the rule is applied. + module EntityType + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::TaggedSymbol + ) + end + + PAY_STATEMENT_ITEM = + T.let( + :pay_statement_item, + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item_list_params.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item_list_params.rbi new file mode 100644 index 00000000..68c23b78 --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item_list_params.rbi @@ -0,0 +1,129 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + class PayStatementItemListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + # Comma-delimited list of pay statement item categories to filter on. If empty, + # defaults to all categories. + sig do + returns( + T.nilable(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::OrSymbol]) + ) + end + attr_reader :categories + + sig do + params( + categories: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::OrSymbol] + ) + .void + end + attr_writer :categories + + # The end date to retrieve pay statement items by via their last seen pay date in + # `YYYY-MM-DD` format. + sig { returns(T.nilable(Date)) } + attr_reader :end_date + + sig { params(end_date: Date).void } + attr_writer :end_date + + # Case-insensitive partial match search by pay statement item name. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The start date to retrieve pay statement items by via their last seen pay date + # (inclusive) in `YYYY-MM-DD` format. + sig { returns(T.nilable(Date)) } + attr_reader :start_date + + sig { params(start_date: Date).void } + attr_writer :start_date + + # String search by pay statement item type. + sig { returns(T.nilable(String)) } + attr_reader :type + + sig { params(type: String).void } + attr_writer :type + + sig do + params( + categories: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::OrSymbol], + end_date: Date, + name: String, + start_date: Date, + type: String, + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + categories: nil, + end_date: nil, + name: nil, + start_date: nil, + type: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + categories: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::OrSymbol], + end_date: Date, + name: String, + start_date: Date, + type: String, + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::TaggedSymbol) } + + EARNINGS = + T.let(:earnings, FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::TaggedSymbol) + TAXES = + T.let(:taxes, FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::TaggedSymbol) + EMPLOYEE_DEDUCTIONS = + T.let( + :employee_deductions, + FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::TaggedSymbol + ) + EMPLOYER_CONTRIBUTIONS = + T.let( + :employer_contributions, + FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::TaggedSymbol + ) + + sig do + override + .returns(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::TaggedSymbol]) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/models/hris/company/pay_statement_item_list_response.rbi b/rbi/lib/finch_api/models/hris/company/pay_statement_item_list_response.rbi new file mode 100644 index 00000000..d13b716a --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company/pay_statement_item_list_response.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Company + class PayStatementItemListResponse < FinchAPI::Internal::Type::BaseModel + # The attributes of the pay statement item. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes)) } + attr_reader :attributes + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes, + FinchAPI::Internal::AnyHash + ) + ) + .void + end + attr_writer :attributes + + # The category of the pay statement item. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol)) } + attr_reader :category + + sig { params(category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::OrSymbol).void } + attr_writer :category + + # The name of the pay statement item. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes, + FinchAPI::Internal::AnyHash + ), + category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::OrSymbol, + name: String + ) + .returns(T.attached_class) + end + def self.new(attributes: nil, category: nil, name: nil) + end + + sig do + override + .returns( + { + attributes: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes, + category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol, + name: String + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::Internal::Type::BaseModel + # `true` if the amount is paid by the employers. This field is only available for + # taxes. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :employer + + # The metadata of the pay statement item derived by the rules engine if available. + # Each attribute will be a key-value pair defined by a rule. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # `true` if the pay statement item is pre-tax. This field is only available for + # employee deductions. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :pre_tax + + # The type of the pay statement item. + sig { returns(T.nilable(String)) } + attr_accessor :type + + # The attributes of the pay statement item. + sig do + params( + employer: T.nilable(T::Boolean), + metadata: T.nilable(T.anything), + pre_tax: T.nilable(T::Boolean), + type: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(employer: nil, metadata: nil, pre_tax: nil, type: nil) + end + + sig do + override + .returns( + { + employer: T.nilable(T::Boolean), + metadata: T.nilable(T.anything), + pre_tax: T.nilable(T::Boolean), + type: T.nilable(String) + } + ) + end + def to_hash + end + end + + # The category of the pay statement item. + module Category + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol + ) + end + + EARNINGS = + T.let(:earnings, FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol) + TAXES = + T.let(:taxes, FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol) + EMPLOYEE_DEDUCTIONS = + T.let( + :employee_deductions, + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol + ) + EMPLOYER_CONTRIBUTIONS = + T.let( + :employer_contributions, + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol + ) + + sig do + override + .returns(T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category::TaggedSymbol]) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/company_benefit.rbi b/rbi/lib/finch_api/models/hris/company_benefit.rbi similarity index 89% rename from rbi/lib/finch-api/models/hris/company_benefit.rbi rename to rbi/lib/finch_api/models/hris/company_benefit.rbi index 265758ee..e2192755 100644 --- a/rbi/lib/finch-api/models/hris/company_benefit.rbi +++ b/rbi/lib/finch_api/models/hris/company_benefit.rbi @@ -3,13 +3,15 @@ module FinchAPI module Models module HRIS - class CompanyBenefit < FinchAPI::BaseModel + class CompanyBenefit < FinchAPI::Internal::Type::BaseModel + # The id of the benefit. sig { returns(String) } attr_accessor :benefit_id sig { returns(T.nilable(String)) } attr_accessor :description + # The frequency of the benefit deduction/contribution. sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol)) } attr_accessor :frequency diff --git a/rbi/lib/finch_api/models/hris/company_retrieve_params.rbi b/rbi/lib/finch_api/models/hris/company_retrieve_params.rbi new file mode 100644 index 00000000..6ff5954c --- /dev/null +++ b/rbi/lib/finch_api/models/hris/company_retrieve_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class CompanyRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi b/rbi/lib/finch_api/models/hris/create_company_benefits_response.rbi similarity index 76% rename from rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi rename to rbi/lib/finch_api/models/hris/create_company_benefits_response.rbi index 5ff70dca..d0dfddd3 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 @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class CreateCompanyBenefitsResponse < FinchAPI::BaseModel + class CreateCompanyBenefitsResponse < FinchAPI::Internal::Type::BaseModel + # The id of the benefit. sig { returns(String) } attr_accessor :benefit_id 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 similarity index 79% rename from rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi rename to rbi/lib/finch_api/models/hris/directory_list_individuals_params.rbi index 62401a2c..85e11cd7 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 @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class DirectoryListIndividualsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DirectoryListIndividualsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Number of employees to return (defaults to all) sig { returns(T.nilable(Integer)) } @@ -25,7 +25,7 @@ module FinchAPI params( limit: Integer, offset: Integer, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/directory_list_params.rbi b/rbi/lib/finch_api/models/hris/directory_list_params.rbi similarity index 80% rename from rbi/lib/finch-api/models/hris/directory_list_params.rbi rename to rbi/lib/finch_api/models/hris/directory_list_params.rbi index 42313e6b..ea0509f7 100644 --- a/rbi/lib/finch-api/models/hris/directory_list_params.rbi +++ b/rbi/lib/finch_api/models/hris/directory_list_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class DirectoryListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DirectoryListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Number of employees to return (defaults to all) sig { returns(T.nilable(Integer)) } @@ -25,7 +25,7 @@ module FinchAPI params( limit: Integer, offset: Integer, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/document_list_params.rbi b/rbi/lib/finch_api/models/hris/document_list_params.rbi similarity index 86% rename from rbi/lib/finch-api/models/hris/document_list_params.rbi rename to rbi/lib/finch_api/models/hris/document_list_params.rbi index 75610793..cac45839 100644 --- a/rbi/lib/finch-api/models/hris/document_list_params.rbi +++ b/rbi/lib/finch_api/models/hris/document_list_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class DocumentListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DocumentListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Comma-delimited list of stable Finch uuids for each individual. If empty, # defaults to all individuals @@ -43,7 +43,7 @@ module FinchAPI limit: Integer, offset: Integer, types: T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -66,10 +66,11 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol) } W4_2020 = T.let(:w4_2020, FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol) W4_2005 = T.let(:w4_2005, FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/hris/document_list_response.rbi b/rbi/lib/finch_api/models/hris/document_list_response.rbi similarity index 77% rename from rbi/lib/finch-api/models/hris/document_list_response.rbi rename to rbi/lib/finch_api/models/hris/document_list_response.rbi index 4c912a9d..8bf2e28d 100644 --- a/rbi/lib/finch-api/models/hris/document_list_response.rbi +++ b/rbi/lib/finch_api/models/hris/document_list_response.rbi @@ -3,20 +3,20 @@ module FinchAPI module Models module HRIS - class DocumentListResponse < FinchAPI::BaseModel + class DocumentListResponse < FinchAPI::Internal::Type::BaseModel sig { returns(T::Array[FinchAPI::Models::HRIS::DocumentResponse]) } attr_accessor :documents sig { returns(FinchAPI::Models::Paging) } attr_reader :paging - sig { params(paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash)).void } + sig { params(paging: T.any(FinchAPI::Models::Paging, FinchAPI::Internal::AnyHash)).void } attr_writer :paging sig do params( - documents: T::Array[T.any(FinchAPI::Models::HRIS::DocumentResponse, FinchAPI::Util::AnyHash)], - paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash) + documents: T::Array[T.any(FinchAPI::Models::HRIS::DocumentResponse, FinchAPI::Internal::AnyHash)], + paging: T.any(FinchAPI::Models::Paging, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/document_response.rbi b/rbi/lib/finch_api/models/hris/document_response.rbi similarity index 90% rename from rbi/lib/finch-api/models/hris/document_response.rbi rename to rbi/lib/finch_api/models/hris/document_response.rbi index 431a3dba..0d467e0c 100644 --- a/rbi/lib/finch-api/models/hris/document_response.rbi +++ b/rbi/lib/finch_api/models/hris/document_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class DocumentResponse < FinchAPI::BaseModel + class DocumentResponse < FinchAPI::Internal::Type::BaseModel # A stable Finch id for the document. sig { returns(T.nilable(String)) } attr_reader :id @@ -65,10 +65,11 @@ module FinchAPI # The type of document. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol) } W4_2020 = T.let(:w4_2020, FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol) W4_2005 = T.let(:w4_2005, FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol) diff --git a/rbi/lib/finch_api/models/hris/document_retreive_params.rbi b/rbi/lib/finch_api/models/hris/document_retreive_params.rbi new file mode 100644 index 00000000..f46fbb9b --- /dev/null +++ b/rbi/lib/finch_api/models/hris/document_retreive_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DocumentRetreiveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/document_retreive_response.rbi b/rbi/lib/finch_api/models/hris/document_retreive_response.rbi similarity index 89% rename from rbi/lib/finch-api/models/hris/document_retreive_response.rbi rename to rbi/lib/finch_api/models/hris/document_retreive_response.rbi index 478d82fc..72100193 100644 --- a/rbi/lib/finch-api/models/hris/document_retreive_response.rbi +++ b/rbi/lib/finch_api/models/hris/document_retreive_response.rbi @@ -6,7 +6,7 @@ module FinchAPI # 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 + extend FinchAPI::Internal::Type::Union sig { override.returns([FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005]) } def self.variants diff --git a/rbi/lib/finch-api/models/hris/employment_data.rbi b/rbi/lib/finch_api/models/hris/employment_data.rbi similarity index 88% rename from rbi/lib/finch-api/models/hris/employment_data.rbi rename to rbi/lib/finch_api/models/hris/employment_data.rbi index 22e9c824..060c3ad1 100644 --- a/rbi/lib/finch-api/models/hris/employment_data.rbi +++ b/rbi/lib/finch_api/models/hris/employment_data.rbi @@ -3,8 +3,8 @@ module FinchAPI module Models module HRIS - class EmploymentData < FinchAPI::BaseModel - # string A stable Finch `id` (UUID v4) for an individual in the company. + class EmploymentData < FinchAPI::Internal::Type::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id @@ -26,7 +26,7 @@ module FinchAPI sig do params( - department: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Department, FinchAPI::Util::AnyHash)) + department: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Department, FinchAPI::Internal::AnyHash)) ) .void end @@ -38,7 +38,7 @@ module FinchAPI sig do params( - employment: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Employment, FinchAPI::Util::AnyHash)) + employment: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Employment, FinchAPI::Internal::AnyHash)) ) .void end @@ -62,7 +62,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Income)) } attr_reader :income - sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))).void } attr_writer :income # The array of income history. @@ -83,7 +83,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :location - sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :location # The manager object representing the manager of the individual within the org. @@ -92,7 +92,7 @@ module FinchAPI sig do params( - manager: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Manager, FinchAPI::Util::AnyHash)) + manager: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Manager, FinchAPI::Internal::AnyHash)) ) .void end @@ -121,19 +121,21 @@ module FinchAPI params( id: String, class_code: T.nilable(String), - 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)), + custom_fields: T.nilable( + T::Array[T.any(FinchAPI::Models::HRIS::EmploymentData::CustomField, FinchAPI::Internal::AnyHash)] + ), + department: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Department, FinchAPI::Internal::AnyHash)), + employment: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Employment, FinchAPI::Internal::AnyHash)), employment_status: T.nilable(FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::OrSymbol), end_date: T.nilable(String), first_name: T.nilable(String), - 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))]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))]), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), - location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), - manager: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Manager, FinchAPI::Util::AnyHash)), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Manager, FinchAPI::Internal::AnyHash)), middle_name: T.nilable(String), source_id: T.nilable(String), start_date: T.nilable(String), @@ -196,7 +198,7 @@ module FinchAPI def to_hash end - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :name @@ -218,7 +220,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The name of the department associated with the individual. sig { returns(T.nilable(String)) } attr_accessor :name @@ -233,7 +235,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel # 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)) } @@ -269,12 +271,12 @@ module FinchAPI # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, 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) @@ -291,11 +293,11 @@ module FinchAPI # The main employment type of the individual. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) } EMPLOYEE = T.let(:employee, FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) CONTRACTOR = T.let(:contractor, FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) @@ -309,11 +311,11 @@ module FinchAPI # The detailed employment status of the individual. Available options: `active`, # `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) } ACTIVE = T.let(:active, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) DECEASED = T.let(:deceased, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) @@ -328,7 +330,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id diff --git a/rbi/lib/finch-api/models/hris/employment_data_response.rbi b/rbi/lib/finch_api/models/hris/employment_data_response.rbi similarity index 82% rename from rbi/lib/finch-api/models/hris/employment_data_response.rbi rename to rbi/lib/finch_api/models/hris/employment_data_response.rbi index c4f4ed80..b20e0e1e 100644 --- a/rbi/lib/finch-api/models/hris/employment_data_response.rbi +++ b/rbi/lib/finch_api/models/hris/employment_data_response.rbi @@ -3,11 +3,11 @@ module FinchAPI module Models module HRIS - class EmploymentDataResponse < FinchAPI::BaseModel + class EmploymentDataResponse < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData)) } attr_reader :body - sig { params(body: T.any(FinchAPI::Models::HRIS::EmploymentData, FinchAPI::Util::AnyHash)).void } + sig { params(body: T.any(FinchAPI::Models::HRIS::EmploymentData, FinchAPI::Internal::AnyHash)).void } attr_writer :body sig { returns(T.nilable(Integer)) } @@ -16,6 +16,7 @@ module FinchAPI sig { params(code: Integer).void } attr_writer :code + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -24,7 +25,7 @@ module FinchAPI sig do params( - body: T.any(FinchAPI::Models::HRIS::EmploymentData, FinchAPI::Util::AnyHash), + body: T.any(FinchAPI::Models::HRIS::EmploymentData, FinchAPI::Internal::AnyHash), 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 similarity index 79% rename from rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi rename to rbi/lib/finch_api/models/hris/employment_retrieve_many_params.rbi index 01339ff9..f996d5b8 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 @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class EmploymentRetrieveManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class EmploymentRetrieveManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The array of batch requests. sig { returns(T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request]) } @@ -13,8 +13,8 @@ module FinchAPI sig do params( - requests: T::Array[T.any(FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + requests: T::Array[T.any(FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -33,7 +33,7 @@ module FinchAPI def to_hash end - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::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. diff --git a/rbi/lib/finch-api/models/hris/individual.rbi b/rbi/lib/finch_api/models/hris/individual.rbi similarity index 89% rename from rbi/lib/finch-api/models/hris/individual.rbi rename to rbi/lib/finch_api/models/hris/individual.rbi index 1a80d0df..2c80d708 100644 --- a/rbi/lib/finch-api/models/hris/individual.rbi +++ b/rbi/lib/finch_api/models/hris/individual.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id @@ -53,7 +53,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :residence - sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :residence # Social Security Number of the individual. This field is only available with the @@ -67,7 +67,7 @@ module FinchAPI params( id: String, dob: T.nilable(String), - emails: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::Individual::Email, FinchAPI::Util::AnyHash)]), + emails: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::Individual::Email, FinchAPI::Internal::AnyHash)]), encrypted_ssn: T.nilable(String), ethnicity: T.nilable(FinchAPI::Models::HRIS::Individual::Ethnicity::OrSymbol), first_name: T.nilable(String), @@ -75,10 +75,10 @@ module FinchAPI last_name: T.nilable(String), middle_name: T.nilable(String), phone_numbers: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::Individual::PhoneNumber, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::Individual::PhoneNumber, FinchAPI::Internal::AnyHash))] ), preferred_name: T.nilable(String), - residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), ssn: T.nilable(String) ) .returns(T.attached_class) @@ -123,7 +123,7 @@ module FinchAPI def to_hash end - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :data @@ -148,10 +148,11 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol) } WORK = T.let(:work, FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol) PERSONAL = T.let(:personal, FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol) @@ -164,10 +165,11 @@ module FinchAPI # The EEOC-defined ethnicity of the individual. module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, 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) @@ -191,10 +193,11 @@ module FinchAPI # The gender of the individual. module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) } FEMALE = T.let(:female, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) MALE = T.let(:male, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) @@ -206,7 +209,7 @@ module FinchAPI end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :data @@ -236,11 +239,11 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) } WORK = T.let(:work, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) PERSONAL = T.let(:personal, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/hris/individual_in_directory.rbi b/rbi/lib/finch_api/models/hris/individual_in_directory.rbi similarity index 81% rename from rbi/lib/finch-api/models/hris/individual_in_directory.rbi rename to rbi/lib/finch_api/models/hris/individual_in_directory.rbi index 96c1af08..2fac4783 100644 --- a/rbi/lib/finch-api/models/hris/individual_in_directory.rbi +++ b/rbi/lib/finch_api/models/hris/individual_in_directory.rbi @@ -3,8 +3,8 @@ module FinchAPI module Models module HRIS - class IndividualInDirectory < FinchAPI::BaseModel - # A stable Finch id (UUID v4) for an individual in the company. + class IndividualInDirectory < FinchAPI::Internal::Type::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id @@ -17,7 +17,7 @@ module FinchAPI sig do params( - department: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Department, FinchAPI::Util::AnyHash)) + department: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Department, FinchAPI::Internal::AnyHash)) ) .void end @@ -41,7 +41,7 @@ module FinchAPI sig do params( - manager: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Manager, FinchAPI::Util::AnyHash)) + manager: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Manager, FinchAPI::Internal::AnyHash)) ) .void end @@ -54,16 +54,24 @@ module FinchAPI sig do params( id: String, - department: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Department, FinchAPI::Util::AnyHash)), + department: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Department, FinchAPI::Internal::AnyHash)), first_name: T.nilable(String), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), - manager: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Manager, FinchAPI::Util::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Manager, FinchAPI::Internal::AnyHash)), middle_name: T.nilable(String) ) .returns(T.attached_class) end - def self.new(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 @@ -83,7 +91,7 @@ module FinchAPI def to_hash end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The name of the department. sig { returns(T.nilable(String)) } attr_accessor :name @@ -98,7 +106,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id diff --git a/rbi/lib/finch-api/models/hris/individual_response.rbi b/rbi/lib/finch_api/models/hris/individual_response.rbi similarity index 88% rename from rbi/lib/finch-api/models/hris/individual_response.rbi rename to rbi/lib/finch_api/models/hris/individual_response.rbi index 19ed5262..9b5314ae 100644 --- a/rbi/lib/finch-api/models/hris/individual_response.rbi +++ b/rbi/lib/finch_api/models/hris/individual_response.rbi @@ -3,11 +3,11 @@ module FinchAPI module Models module HRIS - class IndividualResponse < FinchAPI::BaseModel + class IndividualResponse < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual)) } attr_reader :body - sig { params(body: T.any(FinchAPI::Models::HRIS::Individual, FinchAPI::Util::AnyHash)).void } + sig { params(body: T.any(FinchAPI::Models::HRIS::Individual, FinchAPI::Internal::AnyHash)).void } attr_writer :body sig { returns(T.nilable(Integer)) } @@ -24,7 +24,7 @@ module FinchAPI sig do params( - body: T.any(FinchAPI::Models::HRIS::Individual, FinchAPI::Util::AnyHash), + body: T.any(FinchAPI::Models::HRIS::Individual, FinchAPI::Internal::AnyHash), 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 similarity index 73% rename from rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi rename to rbi/lib/finch_api/models/hris/individual_retrieve_many_params.rbi index db8515ec..f6f2303a 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 @@ -3,16 +3,18 @@ module FinchAPI module Models module HRIS - class IndividualRetrieveManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualRetrieveManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) } attr_reader :options sig do params( - options: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Util::AnyHash)) + options: T.nilable( + T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -23,7 +25,7 @@ module FinchAPI sig do params( - requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Util::AnyHash)] + requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)] ) .void end @@ -31,9 +33,11 @@ module FinchAPI sig do params( - 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) + options: T.nilable( + T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Internal::AnyHash) + ), + requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -53,7 +57,7 @@ module FinchAPI def to_hash end - class Options < FinchAPI::BaseModel + class Options < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -69,7 +73,7 @@ module FinchAPI end end - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :individual_id diff --git a/rbi/lib/finch-api/models/hris/pay_statement.rbi b/rbi/lib/finch_api/models/hris/pay_statement.rbi similarity index 88% rename from rbi/lib/finch-api/models/hris/pay_statement.rbi rename to rbi/lib/finch_api/models/hris/pay_statement.rbi index 8c107cfa..697b501b 100644 --- a/rbi/lib/finch-api/models/hris/pay_statement.rbi +++ b/rbi/lib/finch_api/models/hris/pay_statement.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel # The array of earnings objects associated with this pay statement sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning)])) } attr_accessor :earnings @@ -18,7 +18,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :gross_pay - sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :gross_pay # A stable Finch `id` (UUID v4) for an individual in the company @@ -31,7 +31,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :net_pay - sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :net_pay # The payment method. @@ -53,19 +53,21 @@ module FinchAPI sig do params( earnings: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning, FinchAPI::Internal::AnyHash))] ), employee_deductions: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction, FinchAPI::Internal::AnyHash))] ), employer_contributions: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution, FinchAPI::Internal::AnyHash))] ), - gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), individual_id: String, - net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::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))]), + taxes: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax, FinchAPI::Internal::AnyHash))] + ), total_hours: T.nilable(Float), type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Type::OrSymbol) ) @@ -105,7 +107,7 @@ module FinchAPI def to_hash end - class Earning < FinchAPI::BaseModel + class Earning < FinchAPI::Internal::Type::BaseModel # The earnings amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -115,7 +117,7 @@ module FinchAPI sig do params( - attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, FinchAPI::Util::AnyHash)) + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, FinchAPI::Internal::AnyHash)) ) .void end @@ -141,7 +143,7 @@ module FinchAPI sig do params( amount: T.nilable(Integer), - attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, FinchAPI::Util::AnyHash)), + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, FinchAPI::Internal::AnyHash)), currency: T.nilable(String), hours: T.nilable(Float), name: T.nilable(String), @@ -168,13 +170,13 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata)) } attr_reader :metadata sig do params( - metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, FinchAPI::Util::AnyHash) + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, FinchAPI::Internal::AnyHash) ) .void end @@ -182,7 +184,7 @@ module FinchAPI sig do params( - metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, FinchAPI::Util::AnyHash) + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -193,7 +195,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -215,11 +217,11 @@ module FinchAPI # The type of earning. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, 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) @@ -233,7 +235,7 @@ module FinchAPI 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) + TYPE_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]) } @@ -242,7 +244,7 @@ module FinchAPI end end - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # The deduction amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -253,7 +255,7 @@ module FinchAPI sig do params( attributes: T.nilable( - T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, FinchAPI::Internal::AnyHash) ) ) .void @@ -280,7 +282,7 @@ module FinchAPI params( amount: T.nilable(Integer), attributes: T.nilable( - T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, FinchAPI::Internal::AnyHash) ), currency: T.nilable(String), name: T.nilable(String), @@ -308,7 +310,7 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata)) } attr_reader :metadata @@ -316,7 +318,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -327,7 +329,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -341,7 +343,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -362,7 +364,7 @@ module FinchAPI end end - class EmployerContribution < FinchAPI::BaseModel + class EmployerContribution < FinchAPI::Internal::Type::BaseModel # The contribution amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -373,7 +375,7 @@ module FinchAPI sig do params( attributes: T.nilable( - T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, FinchAPI::Internal::AnyHash) ) ) .void @@ -396,7 +398,7 @@ module FinchAPI params( amount: T.nilable(Integer), attributes: T.nilable( - T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, FinchAPI::Internal::AnyHash) ), currency: T.nilable(String), name: T.nilable(String), @@ -422,7 +424,7 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata)) } attr_reader :metadata @@ -430,7 +432,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -441,7 +443,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -456,7 +458,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -479,11 +481,11 @@ module FinchAPI # The payment method. module PaymentMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol) } CHECK = T.let(:check, FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol) DIRECT_DEPOSIT = @@ -494,7 +496,7 @@ module FinchAPI end end - class Tax < FinchAPI::BaseModel + class Tax < FinchAPI::Internal::Type::BaseModel # The tax amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -504,7 +506,7 @@ module FinchAPI sig do params( - attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, FinchAPI::Util::AnyHash)) + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, FinchAPI::Internal::AnyHash)) ) .void end @@ -529,7 +531,7 @@ module FinchAPI sig do params( amount: T.nilable(Integer), - attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, FinchAPI::Util::AnyHash)), + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, FinchAPI::Internal::AnyHash)), currency: T.nilable(String), employer: T.nilable(T::Boolean), name: T.nilable(String), @@ -556,13 +558,13 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata)) } attr_reader :metadata sig do params( - metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, FinchAPI::Util::AnyHash) + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, FinchAPI::Internal::AnyHash) ) .void end @@ -570,7 +572,7 @@ module FinchAPI sig do params( - metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, FinchAPI::Util::AnyHash) + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -581,7 +583,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -603,10 +605,11 @@ module FinchAPI # The type of taxes. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) } STATE = T.let(:state, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) FEDERAL = T.let(:federal, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) @@ -621,10 +624,11 @@ module FinchAPI # The type of the payment associated with the pay statement. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol) } 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) diff --git a/rbi/lib/finch-api/models/hris/pay_statement_response.rbi b/rbi/lib/finch_api/models/hris/pay_statement_response.rbi similarity index 86% rename from rbi/lib/finch-api/models/hris/pay_statement_response.rbi rename to rbi/lib/finch_api/models/hris/pay_statement_response.rbi index 0a080722..bb60aa9b 100644 --- a/rbi/lib/finch-api/models/hris/pay_statement_response.rbi +++ b/rbi/lib/finch_api/models/hris/pay_statement_response.rbi @@ -3,11 +3,11 @@ module FinchAPI module Models module HRIS - class PayStatementResponse < FinchAPI::BaseModel + class PayStatementResponse < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatementResponseBody)) } attr_reader :body - sig { params(body: T.any(FinchAPI::Models::HRIS::PayStatementResponseBody, FinchAPI::Util::AnyHash)).void } + sig { params(body: T.any(FinchAPI::Models::HRIS::PayStatementResponseBody, FinchAPI::Internal::AnyHash)).void } attr_writer :body sig { returns(T.nilable(Integer)) } @@ -24,7 +24,7 @@ module FinchAPI sig do params( - body: T.any(FinchAPI::Models::HRIS::PayStatementResponseBody, FinchAPI::Util::AnyHash), + body: T.any(FinchAPI::Models::HRIS::PayStatementResponseBody, FinchAPI::Internal::AnyHash), code: Integer, payment_id: String ) 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 similarity index 70% rename from rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi rename to rbi/lib/finch_api/models/hris/pay_statement_response_body.rbi index 906ab10f..104c12d6 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 @@ -3,24 +3,27 @@ module FinchAPI module Models module HRIS - class PayStatementResponseBody < FinchAPI::BaseModel + class PayStatementResponseBody < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::Paging)) } attr_reader :paging - sig { params(paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash)).void } + sig { params(paging: T.any(FinchAPI::Models::Paging, FinchAPI::Internal::AnyHash)).void } attr_writer :paging # The array of pay statements for the current payment. sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::PayStatement])) } attr_reader :pay_statements - sig { params(pay_statements: T::Array[T.any(FinchAPI::Models::HRIS::PayStatement, FinchAPI::Util::AnyHash)]).void } + sig do + params(pay_statements: T::Array[T.any(FinchAPI::Models::HRIS::PayStatement, FinchAPI::Internal::AnyHash)]) + .void + end attr_writer :pay_statements sig do params( - paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash), - pay_statements: T::Array[T.any(FinchAPI::Models::HRIS::PayStatement, FinchAPI::Util::AnyHash)] + paging: T.any(FinchAPI::Models::Paging, FinchAPI::Internal::AnyHash), + pay_statements: T::Array[T.any(FinchAPI::Models::HRIS::PayStatement, FinchAPI::Internal::AnyHash)] ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rbi b/rbi/lib/finch_api/models/hris/pay_statement_retrieve_many_params.rbi similarity index 82% rename from rbi/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rbi rename to rbi/lib/finch_api/models/hris/pay_statement_retrieve_many_params.rbi index 45115323..279c9ea8 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 @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class PayStatementRetrieveManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PayStatementRetrieveManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The array of batch requests. sig { returns(T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request]) } @@ -13,8 +13,8 @@ module FinchAPI sig do params( - requests: T::Array[T.any(FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + requests: T::Array[T.any(FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -33,7 +33,7 @@ module FinchAPI def to_hash end - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for a payment. sig { returns(String) } attr_accessor :payment_id diff --git a/rbi/lib/finch-api/models/hris/payment.rbi b/rbi/lib/finch_api/models/hris/payment.rbi similarity index 86% rename from rbi/lib/finch-api/models/hris/payment.rbi rename to rbi/lib/finch_api/models/hris/payment.rbi index eba3e803..804b287c 100644 --- a/rbi/lib/finch-api/models/hris/payment.rbi +++ b/rbi/lib/finch_api/models/hris/payment.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class Payment < FinchAPI::BaseModel + class Payment < FinchAPI::Internal::Type::BaseModel # The unique id for the payment. sig { returns(T.nilable(String)) } attr_reader :id @@ -14,7 +14,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :company_debit - sig { params(company_debit: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(company_debit: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :company_debit sig { returns(T.nilable(String)) } @@ -23,19 +23,19 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :employee_taxes - sig { params(employee_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(employee_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :employee_taxes sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :employer_taxes - sig { params(employer_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(employer_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :employer_taxes sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :gross_pay - sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :gross_pay # Array of every individual on this payment. @@ -45,7 +45,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :net_pay - sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :net_pay sig { returns(T.nilable(String)) } @@ -64,7 +64,9 @@ module FinchAPI attr_reader :pay_period sig do - params(pay_period: T.nilable(T.any(FinchAPI::Models::HRIS::Payment::PayPeriod, FinchAPI::Util::AnyHash))) + params( + pay_period: T.nilable(T.any(FinchAPI::Models::HRIS::Payment::PayPeriod, FinchAPI::Internal::AnyHash)) + ) .void end attr_writer :pay_period @@ -72,17 +74,17 @@ module FinchAPI sig do params( id: String, - company_debit: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + company_debit: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), debit_date: T.nilable(String), - 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)), + employee_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), + employer_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), + gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), individual_ids: T.nilable(T::Array[String]), - net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), pay_date: T.nilable(String), pay_frequencies: T.nilable(T::Array[FinchAPI::Models::HRIS::Payment::PayFrequency::OrSymbol]), pay_group_ids: T.nilable(T::Array[String]), - pay_period: T.nilable(T.any(FinchAPI::Models::HRIS::Payment::PayPeriod, FinchAPI::Util::AnyHash)) + pay_period: T.nilable(T.any(FinchAPI::Models::HRIS::Payment::PayPeriod, FinchAPI::Internal::AnyHash)) ) .returns(T.attached_class) end @@ -125,10 +127,11 @@ module FinchAPI end module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) } ANNUALLY = T.let(:annually, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) SEMI_ANNUALLY = T.let(:semi_annually, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) @@ -145,7 +148,7 @@ module FinchAPI end end - class PayPeriod < FinchAPI::BaseModel + class PayPeriod < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :end_date diff --git a/rbi/lib/finch-api/models/hris/payment_list_params.rbi b/rbi/lib/finch_api/models/hris/payment_list_params.rbi similarity index 80% rename from rbi/lib/finch-api/models/hris/payment_list_params.rbi rename to rbi/lib/finch_api/models/hris/payment_list_params.rbi index cf033dcd..93e55327 100644 --- a/rbi/lib/finch-api/models/hris/payment_list_params.rbi +++ b/rbi/lib/finch_api/models/hris/payment_list_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module HRIS - class PaymentListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PaymentListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` # format. @@ -21,7 +21,7 @@ module FinchAPI params( end_date: Date, start_date: Date, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi b/rbi/lib/finch_api/models/hris/support_per_benefit_type.rbi similarity index 73% rename from rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi rename to rbi/lib/finch_api/models/hris/support_per_benefit_type.rbi index 0d8cea7c..bea67e12 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 @@ -3,23 +3,26 @@ module FinchAPI module Models module HRIS - class SupportPerBenefitType < FinchAPI::BaseModel + class SupportPerBenefitType < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::OperationSupportMatrix)) } attr_reader :company_benefits - sig { params(company_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash)).void } + sig { params(company_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Internal::AnyHash)).void } attr_writer :company_benefits sig { returns(T.nilable(FinchAPI::Models::OperationSupportMatrix)) } attr_reader :individual_benefits - sig { params(individual_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash)).void } + sig do + params(individual_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Internal::AnyHash)) + .void + end attr_writer :individual_benefits sig do params( - company_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash), - individual_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash) + company_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Internal::AnyHash), + individual_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/hris/supported_benefit.rbi b/rbi/lib/finch_api/models/hris/supported_benefit.rbi similarity index 91% rename from rbi/lib/finch-api/models/hris/supported_benefit.rbi rename to rbi/lib/finch_api/models/hris/supported_benefit.rbi index 7afe8e13..554c6823 100644 --- a/rbi/lib/finch-api/models/hris/supported_benefit.rbi +++ b/rbi/lib/finch_api/models/hris/supported_benefit.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - class SupportedBenefit < FinchAPI::BaseModel + class SupportedBenefit < FinchAPI::Internal::Type::BaseModel # Whether the provider supports an annual maximum for this benefit. sig { returns(T.nilable(T::Boolean)) } attr_accessor :annual_maximum @@ -106,12 +106,12 @@ module FinchAPI end module CompanyContribution - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol) } FIXED = T.let(:fixed, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol) PERCENT = T.let(:percent, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol) @@ -122,12 +122,12 @@ module FinchAPI end module EmployeeDeduction - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol) } FIXED = T.let(:fixed, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol) PERCENT = T.let(:percent, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol) @@ -138,12 +138,12 @@ module FinchAPI end module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol) } INDIVIDUAL = T.let(:individual, FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol) 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 similarity index 76% rename from rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi rename to rbi/lib/finch_api/models/hris/update_company_benefit_response.rbi index 822dbf5c..73b407cd 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 @@ -3,7 +3,8 @@ module FinchAPI module Models module HRIS - class UpdateCompanyBenefitResponse < FinchAPI::BaseModel + class UpdateCompanyBenefitResponse < FinchAPI::Internal::Type::BaseModel + # The id of the benefit. sig { returns(String) } attr_accessor :benefit_id diff --git a/rbi/lib/finch-api/models/hris/w42005.rbi b/rbi/lib/finch_api/models/hris/w42005.rbi similarity index 89% rename from rbi/lib/finch-api/models/hris/w42005.rbi rename to rbi/lib/finch_api/models/hris/w42005.rbi index 78380257..592a30c6 100644 --- a/rbi/lib/finch-api/models/hris/w42005.rbi +++ b/rbi/lib/finch_api/models/hris/w42005.rbi @@ -3,12 +3,12 @@ module FinchAPI module Models module HRIS - class W42005 < FinchAPI::BaseModel + class W42005 < FinchAPI::Internal::Type::BaseModel # Detailed information specific to the 2005 W4 form. sig { returns(T.nilable(FinchAPI::Models::HRIS::W42005::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::HRIS::W42005::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::HRIS::W42005::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data # Specifies the form type, indicating that this document is a 2005 W4 form. @@ -26,7 +26,7 @@ module FinchAPI # filing status, dependents, and withholding details. sig do params( - data: T.any(FinchAPI::Models::HRIS::W42005::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::HRIS::W42005::Data, FinchAPI::Internal::AnyHash), type: FinchAPI::Models::HRIS::W42005::Type::OrSymbol, year: T.nilable(Float) ) @@ -48,7 +48,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # Additional withholding amount (in cents). sig { returns(T.nilable(Integer)) } attr_accessor :additional_withholding @@ -112,10 +112,11 @@ module FinchAPI # Indicates exemption status from federal tax withholding. module Exemption - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol) } EXEMPT = T.let(:exempt, FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol) NON_EXEMPT = T.let(:non_exempt, FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol) @@ -127,11 +128,11 @@ module FinchAPI # The individual's filing status for tax purposes. module FilingStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol) } MARRIED = T.let(:married, FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol) MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = @@ -149,10 +150,10 @@ module FinchAPI # Specifies the form type, indicating that this document is a 2005 W4 form. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol) } W4_2005 = T.let(:w4_2005, FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/hris/w42020.rbi b/rbi/lib/finch_api/models/hris/w42020.rbi similarity index 92% rename from rbi/lib/finch-api/models/hris/w42020.rbi rename to rbi/lib/finch_api/models/hris/w42020.rbi index f8852091..68916c29 100644 --- a/rbi/lib/finch-api/models/hris/w42020.rbi +++ b/rbi/lib/finch_api/models/hris/w42020.rbi @@ -3,12 +3,12 @@ module FinchAPI module Models module HRIS - class W42020 < FinchAPI::BaseModel + class W42020 < FinchAPI::Internal::Type::BaseModel # Detailed information specific to the 2020 W4 form. sig { returns(T.nilable(FinchAPI::Models::HRIS::W42020::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::HRIS::W42020::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::HRIS::W42020::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data # Specifies the form type, indicating that this document is a 2020 W4 form. @@ -26,7 +26,7 @@ module FinchAPI # filing status, dependents, and withholding details. sig do params( - data: T.any(FinchAPI::Models::HRIS::W42020::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::HRIS::W42020::Data, FinchAPI::Internal::AnyHash), type: FinchAPI::Models::HRIS::W42020::Type::OrSymbol, year: T.nilable(Float) ) @@ -48,7 +48,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # Amount claimed for dependents other than qualifying children under 17 (in # cents). sig { returns(T.nilable(Integer)) } @@ -131,11 +131,11 @@ module FinchAPI # The individual's filing status for tax purposes. module FilingStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol) } HEAD_OF_HOUSEHOLD = T.let(:head_of_household, FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol) @@ -158,10 +158,10 @@ module FinchAPI # Specifies the form type, indicating that this document is a 2020 W4 form. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol) } W4_2020 = T.let(:w4_2020, FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/income.rbi b/rbi/lib/finch_api/models/income.rbi similarity index 93% rename from rbi/lib/finch-api/models/income.rbi rename to rbi/lib/finch_api/models/income.rbi index 667a7e62..2464c872 100644 --- a/rbi/lib/finch-api/models/income.rbi +++ b/rbi/lib/finch_api/models/income.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel # The income amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -52,10 +52,10 @@ module FinchAPI # The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, # `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. module Unit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Income::Unit) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Income::Unit::TaggedSymbol) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::Income::Unit::TaggedSymbol) } YEARLY = T.let(:yearly, FinchAPI::Models::Income::Unit::TaggedSymbol) QUARTERLY = T.let(:quarterly, FinchAPI::Models::Income::Unit::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/individual_event.rbi b/rbi/lib/finch_api/models/individual_event.rbi similarity index 88% rename from rbi/lib/finch-api/models/individual_event.rbi rename to rbi/lib/finch_api/models/individual_event.rbi index 2a8dc066..13b295ba 100644 --- a/rbi/lib/finch-api/models/individual_event.rbi +++ b/rbi/lib/finch_api/models/individual_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::IndividualEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::IndividualEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::IndividualEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::IndividualEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::IndividualEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::IndividualEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,7 +37,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # The ID of the individual related to the event. sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -55,10 +55,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::IndividualEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) } INDIVIDUAL_CREATED = T.let(:"individual.created", FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/introspection.rbi b/rbi/lib/finch_api/models/introspection.rbi similarity index 89% rename from rbi/lib/finch-api/models/introspection.rbi rename to rbi/lib/finch_api/models/introspection.rbi index cf0f037f..29032326 100644 --- a/rbi/lib/finch-api/models/introspection.rbi +++ b/rbi/lib/finch_api/models/introspection.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class Introspection < FinchAPI::BaseModel + class Introspection < FinchAPI::Internal::Type::BaseModel # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection # instead of this account ID. sig { returns(String) } @@ -33,7 +33,7 @@ module FinchAPI sig do params( - connection_status: T.any(FinchAPI::Models::Introspection::ConnectionStatus, FinchAPI::Util::AnyHash) + connection_status: T.any(FinchAPI::Models::Introspection::ConnectionStatus, FinchAPI::Internal::AnyHash) ) .void end @@ -87,12 +87,12 @@ module FinchAPI sig do params( account_id: String, - authentication_methods: T::Array[T.any(FinchAPI::Models::Introspection::AuthenticationMethod, FinchAPI::Util::AnyHash)], + authentication_methods: T::Array[T.any(FinchAPI::Models::Introspection::AuthenticationMethod, FinchAPI::Internal::AnyHash)], client_id: String, client_type: FinchAPI::Models::Introspection::ClientType::OrSymbol, company_id: String, connection_id: String, - connection_status: T.any(FinchAPI::Models::Introspection::ConnectionStatus, FinchAPI::Util::AnyHash), + connection_status: T.any(FinchAPI::Models::Introspection::ConnectionStatus, FinchAPI::Internal::AnyHash), connection_type: FinchAPI::Models::Introspection::ConnectionType::OrSymbol, customer_email: T.nilable(String), customer_id: T.nilable(String), @@ -151,13 +151,16 @@ module FinchAPI def to_hash end - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus)) } attr_reader :connection_status sig do params( - connection_status: T.any(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, FinchAPI::Util::AnyHash) + connection_status: T.any( + FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + FinchAPI::Internal::AnyHash + ) ) .void end @@ -179,7 +182,10 @@ module FinchAPI sig do params( - connection_status: T.any(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, FinchAPI::Util::AnyHash), + connection_status: T.any( + FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + FinchAPI::Internal::AnyHash + ), products: T::Array[String], type: FinchAPI::Models::Introspection::AuthenticationMethod::Type::OrSymbol ) @@ -201,7 +207,7 @@ module FinchAPI def to_hash end - class ConnectionStatus < FinchAPI::BaseModel + class ConnectionStatus < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :message @@ -227,12 +233,12 @@ module FinchAPI # The type of authentication method. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) } ASSISTED = T.let(:assisted, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) CREDENTIAL = @@ -250,10 +256,11 @@ module FinchAPI # The type of application associated with a token. module ClientType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Introspection::ClientType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) } PRODUCTION = T.let(:production, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) DEVELOPMENT = T.let(:development, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) @@ -264,7 +271,7 @@ module FinchAPI end end - class ConnectionStatus < FinchAPI::BaseModel + class ConnectionStatus < FinchAPI::Internal::Type::BaseModel # The datetime when the connection was last successfully synced. sig { returns(T.nilable(Time)) } attr_reader :last_successful_sync @@ -310,10 +317,11 @@ module FinchAPI # - `provider` - connection to an external provider # - `finch` - finch-generated data. module ConnectionType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Introspection::ConnectionType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) } PROVIDER = T.let(:provider, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) FINCH = T.let(:finch, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/job_completion_event.rbi b/rbi/lib/finch_api/models/job_completion_event.rbi similarity index 90% rename from rbi/lib/finch-api/models/job_completion_event.rbi rename to rbi/lib/finch_api/models/job_completion_event.rbi index dff4174b..c6659326 100644 --- a/rbi/lib/finch-api/models/job_completion_event.rbi +++ b/rbi/lib/finch_api/models/job_completion_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::JobCompletionEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::JobCompletionEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::JobCompletionEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::JobCompletionEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::JobCompletionEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::JobCompletionEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,7 +37,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # The id of the job which has completed. sig { returns(String) } attr_accessor :job_id @@ -56,10 +56,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::JobCompletionEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) } JOB_BENEFIT_CREATE_COMPLETED = T.let(:"job.benefit_create.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/jobs/automated_async_job.rbi b/rbi/lib/finch_api/models/jobs/automated_async_job.rbi similarity index 86% rename from rbi/lib/finch-api/models/jobs/automated_async_job.rbi rename to rbi/lib/finch_api/models/jobs/automated_async_job.rbi index f07be912..08607b87 100644 --- a/rbi/lib/finch-api/models/jobs/automated_async_job.rbi +++ b/rbi/lib/finch_api/models/jobs/automated_async_job.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Jobs - class AutomatedAsyncJob < FinchAPI::BaseModel + class AutomatedAsyncJob < FinchAPI::Internal::Type::BaseModel # The datetime the job completed. sig { returns(T.nilable(Time)) } attr_accessor :completed_at @@ -28,7 +28,7 @@ module FinchAPI sig do params( - params: T.nilable(T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, FinchAPI::Util::AnyHash)) + params: T.nilable(T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, FinchAPI::Internal::AnyHash)) ) .void end @@ -57,7 +57,7 @@ module FinchAPI created_at: Time, job_id: String, job_url: String, - params: T.nilable(T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, FinchAPI::Util::AnyHash)), + params: T.nilable(T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, FinchAPI::Internal::AnyHash)), scheduled_at: T.nilable(Time), started_at: T.nilable(Time), status: FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::OrSymbol, @@ -65,7 +65,17 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -87,7 +97,7 @@ module FinchAPI def to_hash end - class Params < FinchAPI::BaseModel + class Params < FinchAPI::Internal::Type::BaseModel # The ID of the individual that the job was completed for. sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -106,11 +116,11 @@ module FinchAPI end module Status - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) } PENDING = T.let(:pending, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) IN_PROGRESS = T.let(:in_progress, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) @@ -127,10 +137,11 @@ module FinchAPI # The type of automated job module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol) } DATA_SYNC_ALL = T.let(:data_sync_all, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol) W4_FORM_EMPLOYEE_SYNC = diff --git a/rbi/lib/finch-api/models/jobs/automated_create_params.rbi b/rbi/lib/finch_api/models/jobs/automated_create_params.rbi similarity index 75% rename from rbi/lib/finch-api/models/jobs/automated_create_params.rbi rename to rbi/lib/finch_api/models/jobs/automated_create_params.rbi index fbb9d827..64ed7c4f 100644 --- a/rbi/lib/finch-api/models/jobs/automated_create_params.rbi +++ b/rbi/lib/finch_api/models/jobs/automated_create_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Jobs - class AutomatedCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AutomatedCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The type of job to start. sig { returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Type::OrSymbol) } @@ -14,14 +14,17 @@ module FinchAPI sig { returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Params) } attr_reader :params - sig { params(params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Util::AnyHash)).void } + sig do + params(params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Internal::AnyHash)) + .void + end attr_writer :params sig do params( 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) + params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Internal::AnyHash), + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -43,11 +46,11 @@ module FinchAPI # The type of job to start. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Jobs::AutomatedCreateParams::Type::TaggedSymbol) } W4_FORM_EMPLOYEE_SYNC = T.let(:w4_form_employee_sync, FinchAPI::Models::Jobs::AutomatedCreateParams::Type::TaggedSymbol) @@ -57,7 +60,7 @@ module FinchAPI end end - class Params < FinchAPI::BaseModel + class Params < FinchAPI::Internal::Type::BaseModel # The unique ID of the individual for W-4 data sync. sig { returns(String) } attr_accessor :individual_id diff --git a/rbi/lib/finch-api/models/jobs/automated_create_response.rbi b/rbi/lib/finch_api/models/jobs/automated_create_response.rbi similarity index 94% rename from rbi/lib/finch-api/models/jobs/automated_create_response.rbi rename to rbi/lib/finch_api/models/jobs/automated_create_response.rbi index b431553e..0b33740d 100644 --- a/rbi/lib/finch-api/models/jobs/automated_create_response.rbi +++ b/rbi/lib/finch_api/models/jobs/automated_create_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Jobs - class AutomatedCreateResponse < FinchAPI::BaseModel + class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel # The number of allowed refreshes per hour (per hour, fixed window) sig { returns(Integer) } attr_accessor :allowed_refreshes diff --git a/rbi/lib/finch-api/models/jobs/automated_list_params.rbi b/rbi/lib/finch_api/models/jobs/automated_list_params.rbi similarity index 80% rename from rbi/lib/finch-api/models/jobs/automated_list_params.rbi rename to rbi/lib/finch_api/models/jobs/automated_list_params.rbi index e4d01c52..b59aea5e 100644 --- a/rbi/lib/finch-api/models/jobs/automated_list_params.rbi +++ b/rbi/lib/finch_api/models/jobs/automated_list_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Jobs - class AutomatedListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AutomatedListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Number of items to return sig { returns(T.nilable(Integer)) } @@ -25,7 +25,7 @@ module FinchAPI params( limit: Integer, offset: Integer, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/jobs/automated_list_response.rbi b/rbi/lib/finch_api/models/jobs/automated_list_response.rbi similarity index 80% rename from rbi/lib/finch-api/models/jobs/automated_list_response.rbi rename to rbi/lib/finch_api/models/jobs/automated_list_response.rbi index eb420941..93b59fef 100644 --- a/rbi/lib/finch-api/models/jobs/automated_list_response.rbi +++ b/rbi/lib/finch_api/models/jobs/automated_list_response.rbi @@ -3,20 +3,20 @@ module FinchAPI module Models module Jobs - class AutomatedListResponse < FinchAPI::BaseModel + class AutomatedListResponse < FinchAPI::Internal::Type::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 } + sig { params(meta: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta, FinchAPI::Internal::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) + data: T::Array[T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob, FinchAPI::Internal::AnyHash)], + meta: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -35,7 +35,7 @@ module FinchAPI def to_hash end - class Meta < FinchAPI::BaseModel + class Meta < FinchAPI::Internal::Type::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 @@ -45,7 +45,7 @@ module FinchAPI sig do params( - quotas: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, FinchAPI::Util::AnyHash) + quotas: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, FinchAPI::Internal::AnyHash) ) .void end @@ -53,7 +53,7 @@ module FinchAPI sig do params( - quotas: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, FinchAPI::Util::AnyHash) + quotas: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -64,13 +64,16 @@ module FinchAPI def to_hash end - class Quotas < FinchAPI::BaseModel + class Quotas < FinchAPI::Internal::Type::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) + data_sync_all: T.any( + FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, + FinchAPI::Internal::AnyHash + ) ) .void end @@ -82,7 +85,10 @@ module FinchAPI # details. sig do params( - data_sync_all: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, FinchAPI::Util::AnyHash) + data_sync_all: T.any( + FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, + FinchAPI::Internal::AnyHash + ) ) .returns(T.attached_class) end @@ -95,7 +101,7 @@ module FinchAPI def to_hash end - class DataSyncAll < FinchAPI::BaseModel + class DataSyncAll < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(Integer)) } attr_reader :allowed_refreshes diff --git a/rbi/lib/finch_api/models/jobs/automated_retrieve_params.rbi b/rbi/lib/finch_api/models/jobs/automated_retrieve_params.rbi new file mode 100644 index 00000000..54f48b91 --- /dev/null +++ b/rbi/lib/finch_api/models/jobs/automated_retrieve_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/manual_async_job.rbi b/rbi/lib/finch_api/models/jobs/manual_async_job.rbi similarity index 87% rename from rbi/lib/finch-api/models/jobs/manual_async_job.rbi rename to rbi/lib/finch_api/models/jobs/manual_async_job.rbi index 67d1d5ee..f78c7215 100644 --- a/rbi/lib/finch-api/models/jobs/manual_async_job.rbi +++ b/rbi/lib/finch_api/models/jobs/manual_async_job.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Jobs - class ManualAsyncJob < FinchAPI::BaseModel + class ManualAsyncJob < FinchAPI::Internal::Type::BaseModel # Specific information about the job, such as individual statuses for batch jobs. sig { returns(T.nilable(T::Array[T.anything])) } attr_accessor :body @@ -39,10 +39,11 @@ module FinchAPI end module Status - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) } PENDING = T.let(:pending, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) IN_PROGRESS = T.let(:in_progress, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) diff --git a/rbi/lib/finch_api/models/jobs/manual_retrieve_params.rbi b/rbi/lib/finch_api/models/jobs/manual_retrieve_params.rbi new file mode 100644 index 00000000..93160846 --- /dev/null +++ b/rbi/lib/finch_api/models/jobs/manual_retrieve_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class ManualRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/location.rbi b/rbi/lib/finch_api/models/location.rbi similarity index 87% rename from rbi/lib/finch-api/models/location.rbi rename to rbi/lib/finch_api/models/location.rbi index 0c7df5cc..5792276d 100644 --- a/rbi/lib/finch-api/models/location.rbi +++ b/rbi/lib/finch_api/models/location.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel # City, district, suburb, town, or village. sig { returns(T.nilable(String)) } attr_accessor :city @@ -46,7 +46,16 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 similarity index 91% rename from rbi/lib/finch-api/models/money.rbi rename to rbi/lib/finch_api/models/money.rbi index c95b3321..64f5f82b 100644 --- a/rbi/lib/finch-api/models/money.rbi +++ b/rbi/lib/finch_api/models/money.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class Money < FinchAPI::BaseModel + class Money < FinchAPI::Internal::Type::BaseModel # Amount for money object (in cents) sig { returns(T.nilable(Integer)) } attr_accessor :amount diff --git a/rbi/lib/finch-api/models/operation_support.rbi b/rbi/lib/finch_api/models/operation_support.rbi similarity index 88% rename from rbi/lib/finch-api/models/operation_support.rbi rename to rbi/lib/finch_api/models/operation_support.rbi index 6cb9ccc4..b2084508 100644 --- a/rbi/lib/finch-api/models/operation_support.rbi +++ b/rbi/lib/finch_api/models/operation_support.rbi @@ -10,10 +10,10 @@ module FinchAPI # - `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 + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::OperationSupport) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::OperationSupport::TaggedSymbol) } + OrSymbol = T.type_alias { T.any(Symbol, String, FinchAPI::Models::OperationSupport::TaggedSymbol) } SUPPORTED = T.let(:supported, FinchAPI::Models::OperationSupport::TaggedSymbol) NOT_SUPPORTED_BY_FINCH = T.let(:not_supported_by_finch, FinchAPI::Models::OperationSupport::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/operation_support_matrix.rbi b/rbi/lib/finch_api/models/operation_support_matrix.rbi similarity index 98% rename from rbi/lib/finch-api/models/operation_support_matrix.rbi rename to rbi/lib/finch_api/models/operation_support_matrix.rbi index 193dff70..b31a673a 100644 --- a/rbi/lib/finch-api/models/operation_support_matrix.rbi +++ b/rbi/lib/finch_api/models/operation_support_matrix.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class OperationSupportMatrix < FinchAPI::BaseModel + class OperationSupportMatrix < FinchAPI::Internal::Type::BaseModel # - `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 diff --git a/rbi/lib/finch-api/models/paging.rbi b/rbi/lib/finch_api/models/paging.rbi similarity index 92% rename from rbi/lib/finch-api/models/paging.rbi rename to rbi/lib/finch_api/models/paging.rbi index 4b8b236d..3179e672 100644 --- a/rbi/lib/finch-api/models/paging.rbi +++ b/rbi/lib/finch_api/models/paging.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel # The total number of elements for the entire query (not just the given page) sig { returns(T.nilable(Integer)) } attr_reader :count diff --git a/rbi/lib/finch-api/models/pay_statement_event.rbi b/rbi/lib/finch_api/models/pay_statement_event.rbi similarity index 89% rename from rbi/lib/finch-api/models/pay_statement_event.rbi rename to rbi/lib/finch_api/models/pay_statement_event.rbi index db6f59f3..61f1af46 100644 --- a/rbi/lib/finch-api/models/pay_statement_event.rbi +++ b/rbi/lib/finch_api/models/pay_statement_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::PayStatementEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::PayStatementEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::PayStatementEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::PayStatementEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::PayStatementEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::PayStatementEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,7 +37,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # The ID of the individual associated with the pay statement. sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -62,10 +62,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::PayStatementEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) } PAY_STATEMENT_CREATED = T.let(:"pay_statement.created", FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/payment_event.rbi b/rbi/lib/finch_api/models/payment_event.rbi similarity index 88% rename from rbi/lib/finch-api/models/payment_event.rbi rename to rbi/lib/finch_api/models/payment_event.rbi index 6937f19a..be4efa8a 100644 --- a/rbi/lib/finch-api/models/payment_event.rbi +++ b/rbi/lib/finch_api/models/payment_event.rbi @@ -6,7 +6,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::PaymentEvent::Data)) } attr_reader :data - sig { params(data: T.any(FinchAPI::Models::PaymentEvent::Data, FinchAPI::Util::AnyHash)).void } + sig { params(data: T.any(FinchAPI::Models::PaymentEvent::Data, FinchAPI::Internal::AnyHash)).void } attr_writer :data sig { returns(T.nilable(FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol)) } @@ -17,7 +17,7 @@ module FinchAPI sig do params( - data: T.any(FinchAPI::Models::PaymentEvent::Data, FinchAPI::Util::AnyHash), + data: T.any(FinchAPI::Models::PaymentEvent::Data, FinchAPI::Internal::AnyHash), event_type: FinchAPI::Models::PaymentEvent::EventType::OrSymbol ) .returns(T.attached_class) @@ -37,7 +37,7 @@ module FinchAPI def to_hash end - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel # The date of the payment. sig { returns(String) } attr_accessor :pay_date @@ -56,10 +56,11 @@ module FinchAPI end module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::PaymentEvent::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) } PAYMENT_CREATED = T.let(:"payment.created", FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) PAYMENT_UPDATED = T.let(:"payment.updated", FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) 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 similarity index 82% rename from rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi rename to rbi/lib/finch_api/models/payroll/pay_group_list_params.rbi index 187e9b8e..d4d58f05 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 @@ -3,9 +3,9 @@ module FinchAPI module Models module Payroll - class PayGroupListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PayGroupListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(T.nilable(String)) } attr_reader :individual_id @@ -23,7 +23,7 @@ module FinchAPI params( individual_id: String, pay_frequencies: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi b/rbi/lib/finch_api/models/payroll/pay_group_list_response.rbi similarity index 92% rename from rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi rename to rbi/lib/finch_api/models/payroll/pay_group_list_response.rbi index 8eea3178..c7ed3914 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 @@ -3,7 +3,7 @@ module FinchAPI module Models module Payroll - class PayGroupListResponse < FinchAPI::BaseModel + class PayGroupListResponse < FinchAPI::Internal::Type::BaseModel # Finch id (uuidv4) for the pay group sig { returns(T.nilable(String)) } attr_reader :id @@ -53,12 +53,12 @@ module FinchAPI end module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) } ANNUALLY = T.let(:annually, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) SEMI_ANNUALLY = diff --git a/rbi/lib/finch_api/models/payroll/pay_group_retrieve_params.rbi b/rbi/lib/finch_api/models/payroll/pay_group_retrieve_params.rbi new file mode 100644 index 00000000..4aabef86 --- /dev/null +++ b/rbi/lib/finch_api/models/payroll/pay_group_retrieve_params.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + module Payroll + class PayGroupRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi b/rbi/lib/finch_api/models/payroll/pay_group_retrieve_response.rbi similarity index 91% rename from rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi rename to rbi/lib/finch_api/models/payroll/pay_group_retrieve_response.rbi index 8d529f59..582c68cd 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 @@ -3,7 +3,7 @@ module FinchAPI module Models module Payroll - class PayGroupRetrieveResponse < FinchAPI::BaseModel + class PayGroupRetrieveResponse < FinchAPI::Internal::Type::BaseModel # Finch id (uuidv4) for the pay group sig { returns(String) } attr_accessor :id @@ -46,12 +46,12 @@ module FinchAPI end module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) } ANNUALLY = T.let(:annually, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/provider.rbi b/rbi/lib/finch_api/models/provider.rbi similarity index 91% rename from rbi/lib/finch-api/models/provider.rbi rename to rbi/lib/finch_api/models/provider.rbi index 483d1529..76586590 100644 --- a/rbi/lib/finch-api/models/provider.rbi +++ b/rbi/lib/finch_api/models/provider.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class Provider < FinchAPI::BaseModel + class Provider < FinchAPI::Internal::Type::BaseModel # The id of the payroll provider used in Connect. sig { returns(T.nilable(String)) } attr_reader :id @@ -16,7 +16,7 @@ module FinchAPI sig do params( - authentication_methods: T::Array[T.any(FinchAPI::Models::Provider::AuthenticationMethod, FinchAPI::Util::AnyHash)] + authentication_methods: T::Array[T.any(FinchAPI::Models::Provider::AuthenticationMethod, FinchAPI::Internal::AnyHash)] ) .void end @@ -83,7 +83,7 @@ module FinchAPI sig do params( id: String, - authentication_methods: T::Array[T.any(FinchAPI::Models::Provider::AuthenticationMethod, FinchAPI::Util::AnyHash)], + authentication_methods: T::Array[T.any(FinchAPI::Models::Provider::AuthenticationMethod, FinchAPI::Internal::AnyHash)], beta: T::Boolean, display_name: String, icon: String, @@ -129,7 +129,7 @@ module FinchAPI def to_hash end - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::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)) } @@ -137,7 +137,7 @@ module FinchAPI sig do params( - benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)) + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Internal::AnyHash)) ) .void end @@ -150,7 +150,7 @@ module FinchAPI sig do params( supported_fields: T.nilable( - T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, FinchAPI::Internal::AnyHash) ) ) .void @@ -166,9 +166,9 @@ module FinchAPI sig do params( - benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)), + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Internal::AnyHash)), supported_fields: T.nilable( - T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, FinchAPI::Internal::AnyHash) ), type: FinchAPI::Models::Provider::AuthenticationMethod::Type::OrSymbol ) @@ -190,13 +190,16 @@ module FinchAPI def to_hash end - class SupportedFields < FinchAPI::BaseModel + class SupportedFields < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company)) } attr_reader :company sig do params( - company: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, FinchAPI::Util::AnyHash) + company: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, + FinchAPI::Internal::AnyHash + ) ) .void end @@ -209,7 +212,7 @@ module FinchAPI params( directory: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -223,7 +226,7 @@ module FinchAPI params( employment: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -237,7 +240,7 @@ module FinchAPI params( individual: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -251,7 +254,7 @@ module FinchAPI params( pay_group: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -265,7 +268,7 @@ module FinchAPI params( pay_statement: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -277,7 +280,10 @@ module FinchAPI sig do params( - payment: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, FinchAPI::Util::AnyHash) + payment: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, + FinchAPI::Internal::AnyHash + ) ) .void end @@ -286,28 +292,34 @@ module FinchAPI # The supported data fields returned by our HR and payroll endpoints sig do params( - company: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, FinchAPI::Util::AnyHash), + company: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, + FinchAPI::Internal::AnyHash + ), directory: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employment: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), individual: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), pay_group: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), pay_statement: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), - payment: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, FinchAPI::Util::AnyHash) + payment: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, + FinchAPI::Internal::AnyHash + ) ) .returns(T.attached_class) end @@ -339,7 +351,7 @@ module FinchAPI def to_hash end - class Company < FinchAPI::BaseModel + class Company < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -353,7 +365,7 @@ module FinchAPI params( accounts: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -371,7 +383,7 @@ module FinchAPI params( departments: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -391,7 +403,7 @@ module FinchAPI params( entity: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -411,7 +423,7 @@ module FinchAPI params( locations: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -435,21 +447,21 @@ module FinchAPI id: T::Boolean, accounts: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), departments: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), ein: T::Boolean, entity: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), legal_name: T::Boolean, locations: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), primary_email: T::Boolean, primary_phone_number: T::Boolean @@ -488,7 +500,7 @@ module FinchAPI def to_hash end - class Accounts < FinchAPI::BaseModel + class Accounts < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :account_name @@ -529,7 +541,13 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -548,7 +566,7 @@ module FinchAPI end end - class Departments < FinchAPI::BaseModel + class Departments < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :name @@ -566,7 +584,7 @@ module FinchAPI params( parent: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -578,7 +596,7 @@ module FinchAPI name: T::Boolean, parent: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -598,7 +616,7 @@ module FinchAPI def to_hash end - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :name @@ -615,7 +633,7 @@ module FinchAPI end end - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :subtype @@ -637,7 +655,7 @@ module FinchAPI end end - class Locations < FinchAPI::BaseModel + class Locations < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :city @@ -706,7 +724,7 @@ module FinchAPI end end - class Directory < FinchAPI::BaseModel + class Directory < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) @@ -718,7 +736,7 @@ module FinchAPI params( individuals: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -732,7 +750,7 @@ module FinchAPI params( paging: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -743,11 +761,11 @@ module FinchAPI params( individuals: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), paging: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -767,7 +785,7 @@ module FinchAPI def to_hash end - class Individuals < FinchAPI::BaseModel + class Individuals < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -811,7 +829,7 @@ module FinchAPI params( manager: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -833,13 +851,21 @@ module FinchAPI last_name: T::Boolean, manager: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), middle_name: T::Boolean ) .returns(T.attached_class) end - def self.new(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 @@ -859,7 +885,7 @@ module FinchAPI def to_hash end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -876,7 +902,7 @@ module FinchAPI end end - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :count @@ -899,7 +925,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -929,7 +955,7 @@ module FinchAPI params( department: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -947,7 +973,7 @@ module FinchAPI params( employment: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -979,7 +1005,7 @@ module FinchAPI params( income: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1015,7 +1041,7 @@ module FinchAPI params( location: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1029,7 +1055,7 @@ module FinchAPI params( manager: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1061,29 +1087,29 @@ module FinchAPI custom_fields: T::Boolean, department: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employment: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employment_status: T::Boolean, end_date: T::Boolean, first_name: T::Boolean, income: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), income_history: T::Boolean, is_active: T::Boolean, last_name: T::Boolean, location: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), manager: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), middle_name: T::Boolean, start_date: T::Boolean, @@ -1139,7 +1165,7 @@ module FinchAPI def to_hash end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :name @@ -1155,7 +1181,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :subtype @@ -1177,7 +1203,7 @@ module FinchAPI end end - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -1207,7 +1233,7 @@ module FinchAPI end end - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :city @@ -1275,7 +1301,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -1292,7 +1318,7 @@ module FinchAPI end end - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -1312,7 +1338,7 @@ module FinchAPI params( emails: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1366,7 +1392,7 @@ module FinchAPI params( phone_numbers: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1390,7 +1416,7 @@ module FinchAPI params( residence: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1409,7 +1435,7 @@ module FinchAPI dob: T::Boolean, emails: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), encrypted_ssn: T::Boolean, ethnicity: T::Boolean, @@ -1419,12 +1445,12 @@ module FinchAPI middle_name: T::Boolean, phone_numbers: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), preferred_name: T::Boolean, residence: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), ssn: T::Boolean ) @@ -1470,7 +1496,7 @@ module FinchAPI def to_hash end - class Emails < FinchAPI::BaseModel + class Emails < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :data @@ -1492,7 +1518,7 @@ module FinchAPI end end - class PhoneNumbers < FinchAPI::BaseModel + class PhoneNumbers < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :data @@ -1514,7 +1540,7 @@ module FinchAPI end end - class Residence < FinchAPI::BaseModel + class Residence < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :city @@ -1583,7 +1609,7 @@ module FinchAPI end end - class PayGroup < FinchAPI::BaseModel + class PayGroup < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -1633,7 +1659,7 @@ module FinchAPI end end - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) @@ -1645,7 +1671,7 @@ module FinchAPI params( paging: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1663,7 +1689,7 @@ module FinchAPI params( pay_statements: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1674,11 +1700,11 @@ module FinchAPI params( paging: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), pay_statements: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -1698,7 +1724,7 @@ module FinchAPI def to_hash end - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel sig { returns(T::Boolean) } attr_accessor :count @@ -1714,7 +1740,7 @@ module FinchAPI end end - class PayStatements < FinchAPI::BaseModel + class PayStatements < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable( @@ -1728,7 +1754,7 @@ module FinchAPI params( earnings: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1748,7 +1774,7 @@ module FinchAPI params( employee_deductions: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1768,7 +1794,7 @@ module FinchAPI params( employer_contributions: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1812,7 +1838,7 @@ module FinchAPI params( taxes: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -1835,15 +1861,15 @@ module FinchAPI params( earnings: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employee_deductions: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), employer_contributions: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), gross_pay: T::Boolean, individual_id: T::Boolean, @@ -1851,7 +1877,7 @@ module FinchAPI payment_method: T::Boolean, taxes: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ), total_hours: T::Boolean, type: T::Boolean @@ -1892,7 +1918,7 @@ module FinchAPI def to_hash end - class Earnings < FinchAPI::BaseModel + class Earnings < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -1938,7 +1964,7 @@ module FinchAPI end end - class EmployeeDeductions < FinchAPI::BaseModel + class EmployeeDeductions < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -1998,7 +2024,7 @@ module FinchAPI end end - class EmployerContributions < FinchAPI::BaseModel + class EmployerContributions < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -2028,7 +2054,7 @@ module FinchAPI end end - class Taxes < FinchAPI::BaseModel + class Taxes < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :amount @@ -2090,7 +2116,7 @@ module FinchAPI end end - class Payment < FinchAPI::BaseModel + class Payment < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :id @@ -2164,7 +2190,7 @@ module FinchAPI params( pay_period: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -2186,7 +2212,7 @@ module FinchAPI pay_group_ids: T::Boolean, pay_period: T.any( FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -2229,7 +2255,7 @@ module FinchAPI def to_hash end - class PayPeriod < FinchAPI::BaseModel + class PayPeriod < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(T::Boolean)) } attr_reader :end_date @@ -2255,11 +2281,11 @@ module FinchAPI # The type of authentication method. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) } ASSISTED = T.let(:assisted, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) CREDENTIAL = T.let(:credential, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) diff --git a/rbi/lib/finch_api/models/provider_list_params.rbi b/rbi/lib/finch_api/models/provider_list_params.rbi new file mode 100644 index 00000000..fa11410e --- /dev/null +++ b/rbi/lib/finch_api/models/provider_list_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module FinchAPI + module Models + class ProviderListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi b/rbi/lib/finch_api/models/request_forwarding_forward_params.rbi similarity index 89% rename from rbi/lib/finch-api/models/request_forwarding_forward_params.rbi rename to rbi/lib/finch_api/models/request_forwarding_forward_params.rbi index cbbe2b5f..70eae296 100644 --- a/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi +++ b/rbi/lib/finch_api/models/request_forwarding_forward_params.rbi @@ -2,9 +2,9 @@ module FinchAPI module Models - class RequestForwardingForwardParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class RequestForwardingForwardParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The HTTP method for the forwarded request. Valid values include: `GET` , `POST` # , `PUT` , `DELETE` , and `PATCH`. @@ -40,7 +40,7 @@ module FinchAPI data: T.nilable(String), headers: T.nilable(T.anything), params: T.nilable(T.anything), - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end diff --git a/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi b/rbi/lib/finch_api/models/request_forwarding_forward_response.rbi similarity index 94% rename from rbi/lib/finch-api/models/request_forwarding_forward_response.rbi rename to rbi/lib/finch_api/models/request_forwarding_forward_response.rbi index 75f52e1c..75e92abf 100644 --- a/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi +++ b/rbi/lib/finch_api/models/request_forwarding_forward_response.rbi @@ -2,7 +2,7 @@ module FinchAPI module Models - class RequestForwardingForwardResponse < FinchAPI::BaseModel + class RequestForwardingForwardResponse < FinchAPI::Internal::Type::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. @@ -21,7 +21,7 @@ module FinchAPI sig do params( - request: T.any(FinchAPI::Models::RequestForwardingForwardResponse::Request, FinchAPI::Util::AnyHash) + request: T.any(FinchAPI::Models::RequestForwardingForwardResponse::Request, FinchAPI::Internal::AnyHash) ) .void end @@ -36,7 +36,7 @@ module FinchAPI params( data: T.nilable(String), headers: T.nilable(T.anything), - request: T.any(FinchAPI::Models::RequestForwardingForwardResponse::Request, FinchAPI::Util::AnyHash), + request: T.any(FinchAPI::Models::RequestForwardingForwardResponse::Request, FinchAPI::Internal::AnyHash), status_code: Integer ) .returns(T.attached_class) @@ -58,7 +58,7 @@ module FinchAPI def to_hash end - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::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. diff --git a/rbi/lib/finch-api/models/sandbox/company_update_params.rbi b/rbi/lib/finch_api/models/sandbox/company_update_params.rbi similarity index 86% rename from rbi/lib/finch-api/models/sandbox/company_update_params.rbi rename to rbi/lib/finch_api/models/sandbox/company_update_params.rbi index 513de018..b1b51c14 100644 --- a/rbi/lib/finch-api/models/sandbox/company_update_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/company_update_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class CompanyUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class CompanyUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # An array of bank account objects associated with the payroll/HRIS system. sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account])) } @@ -25,7 +25,7 @@ module FinchAPI sig do params( - entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Util::AnyHash)) + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Internal::AnyHash)) ) .void end @@ -49,18 +49,18 @@ module FinchAPI sig do params( accounts: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account, FinchAPI::Internal::AnyHash)] ), departments: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, FinchAPI::Internal::AnyHash))] ), ein: T.nilable(String), - entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Util::AnyHash)), + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Internal::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -96,7 +96,7 @@ module FinchAPI def to_hash end - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel # The name of the bank associated in the payroll/HRIS system. sig { returns(T.nilable(String)) } attr_accessor :account_name @@ -128,7 +128,13 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -148,12 +154,12 @@ module FinchAPI # The type of bank account. module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::TaggedSymbol) } CHECKING = T.let(:checking, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::TaggedSymbol) @@ -169,7 +175,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The department name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -181,7 +187,7 @@ module FinchAPI sig do params( parent: T.nilable( - T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, FinchAPI::Internal::AnyHash) ) ) .void @@ -192,7 +198,7 @@ module FinchAPI params( name: T.nilable(String), parent: T.nilable( - T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, FinchAPI::Internal::AnyHash) ) ) .returns(T.attached_class) @@ -212,7 +218,7 @@ module FinchAPI def to_hash end - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel # The parent department's name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -228,7 +234,7 @@ module FinchAPI end end - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel # The tax payer subtype of the company. sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::OrSymbol)) } attr_accessor :subtype @@ -262,12 +268,12 @@ module FinchAPI # The tax payer subtype of the company. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol) } S_CORPORATION = T.let(:s_corporation, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol) @@ -283,12 +289,12 @@ module FinchAPI # The tax payer type of the company. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, 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) diff --git a/rbi/lib/finch-api/models/sandbox/company_update_response.rbi b/rbi/lib/finch_api/models/sandbox/company_update_response.rbi similarity index 84% rename from rbi/lib/finch-api/models/sandbox/company_update_response.rbi rename to rbi/lib/finch_api/models/sandbox/company_update_response.rbi index e5f7c40c..0ecae45b 100644 --- a/rbi/lib/finch-api/models/sandbox/company_update_response.rbi +++ b/rbi/lib/finch_api/models/sandbox/company_update_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - class CompanyUpdateResponse < FinchAPI::BaseModel + class CompanyUpdateResponse < FinchAPI::Internal::Type::BaseModel # An array of bank account objects associated with the payroll/HRIS system. sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account])) } attr_accessor :accounts @@ -22,7 +22,7 @@ module FinchAPI sig do params( - entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, FinchAPI::Util::AnyHash)) + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, FinchAPI::Internal::AnyHash)) ) .void end @@ -46,21 +46,34 @@ module FinchAPI sig do params( accounts: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account, FinchAPI::Internal::AnyHash)] ), departments: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, FinchAPI::Util::AnyHash))] + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, FinchAPI::Internal::AnyHash) + ) + ] ), ein: T.nilable(String), - entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, FinchAPI::Util::AnyHash)), + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, FinchAPI::Internal::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String) ) .returns(T.attached_class) end - def self.new(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 @@ -81,7 +94,7 @@ module FinchAPI def to_hash end - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel # The name of the bank associated in the payroll/HRIS system. sig { returns(T.nilable(String)) } attr_accessor :account_name @@ -113,7 +126,13 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -133,12 +152,18 @@ module FinchAPI # The type of bank account. module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol + ) + end CHECKING = T.let(:checking, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol) @@ -154,7 +179,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The department name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -166,7 +191,7 @@ module FinchAPI sig do params( parent: T.nilable( - T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, FinchAPI::Internal::AnyHash) ) ) .void @@ -177,7 +202,7 @@ module FinchAPI params( name: T.nilable(String), parent: T.nilable( - T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, FinchAPI::Internal::AnyHash) ) ) .returns(T.attached_class) @@ -197,7 +222,7 @@ module FinchAPI def to_hash end - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel # The parent department's name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -213,7 +238,7 @@ module FinchAPI end end - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel # The tax payer subtype of the company. sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol)) } attr_accessor :subtype @@ -247,12 +272,12 @@ module FinchAPI # The tax payer subtype of the company. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol) } S_CORPORATION = T.let(:s_corporation, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol) @@ -270,12 +295,12 @@ module FinchAPI # The tax payer type of the company. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, 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) diff --git a/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi b/rbi/lib/finch_api/models/sandbox/connection_create_params.rbi similarity index 83% rename from rbi/lib/finch-api/models/sandbox/connection_create_params.rbi rename to rbi/lib/finch_api/models/sandbox/connection_create_params.rbi index 59750e2b..644661d5 100644 --- a/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/connection_create_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class ConnectionCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class ConnectionCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The provider associated with the connection sig { returns(String) } @@ -43,11 +43,17 @@ module FinchAPI authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol, employee_size: Integer, products: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end - def self.new(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 @@ -66,12 +72,12 @@ module FinchAPI end module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) } CREDENTIAL = T.let(:credential, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi b/rbi/lib/finch_api/models/sandbox/connection_create_response.rbi similarity index 90% rename from rbi/lib/finch-api/models/sandbox/connection_create_response.rbi rename to rbi/lib/finch_api/models/sandbox/connection_create_response.rbi index a05ba85a..b15a38fb 100644 --- a/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi +++ b/rbi/lib/finch_api/models/sandbox/connection_create_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - class ConnectionCreateResponse < FinchAPI::BaseModel + class ConnectionCreateResponse < FinchAPI::Internal::Type::BaseModel sig { returns(String) } attr_accessor :access_token @@ -79,12 +79,18 @@ module FinchAPI end module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol + ) + end CREDENTIAL = T.let(:credential, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) 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 similarity index 87% rename from rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi rename to rbi/lib/finch_api/models/sandbox/connections/account_create_params.rbi index 78f521a4..4be45f51 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 @@ -4,9 +4,9 @@ module FinchAPI module Models module Sandbox module Connections - class AccountCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AccountCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(String) } attr_accessor :company_id @@ -44,11 +44,17 @@ module FinchAPI provider_id: String, authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol, products: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end - def self.new(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 @@ -67,7 +73,7 @@ module FinchAPI end module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType) } @@ -75,6 +81,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol ) 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 similarity index 90% rename from rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi rename to rbi/lib/finch_api/models/sandbox/connections/account_create_response.rbi index abd032b9..289d06dd 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 @@ -4,7 +4,7 @@ module FinchAPI module Models module Sandbox module Connections - class AccountCreateResponse < FinchAPI::BaseModel + class AccountCreateResponse < FinchAPI::Internal::Type::BaseModel sig { returns(String) } attr_accessor :access_token @@ -42,7 +42,15 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -63,7 +71,7 @@ module FinchAPI end module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType) } @@ -71,6 +79,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol ) 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 similarity index 81% rename from rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi rename to rbi/lib/finch_api/models/sandbox/connections/account_update_params.rbi index baf486c8..49752c17 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 @@ -4,9 +4,9 @@ module FinchAPI module Models module Sandbox module Connections - class AccountUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AccountUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(T.nilable(FinchAPI::Models::ConnectionStatusType::OrSymbol)) } attr_reader :connection_status @@ -17,7 +17,7 @@ module FinchAPI sig do params( connection_status: FinchAPI::Models::ConnectionStatusType::OrSymbol, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) 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 similarity index 90% rename from rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi rename to rbi/lib/finch_api/models/sandbox/connections/account_update_response.rbi index 541cdff4..1565f208 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 @@ -4,7 +4,7 @@ module FinchAPI module Models module Sandbox module Connections - class AccountUpdateResponse < FinchAPI::BaseModel + class AccountUpdateResponse < FinchAPI::Internal::Type::BaseModel # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } attr_accessor :account_id @@ -41,7 +41,14 @@ module FinchAPI ) .returns(T.attached_class) end - def self.new(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 @@ -61,7 +68,7 @@ module FinchAPI end module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType) } @@ -69,6 +76,7 @@ module FinchAPI T.type_alias do T.any( Symbol, + String, FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol ) 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 similarity index 87% rename from rbi/lib/finch-api/models/sandbox/directory_create_params.rbi rename to rbi/lib/finch_api/models/sandbox/directory_create_params.rbi index c5f5dc35..0852c1b2 100644 --- a/rbi/lib/finch-api/models/sandbox/directory_create_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/directory_create_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class DirectoryCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DirectoryCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Array of individuals to create. Takes all combined fields from `/individual` and # `/employment` endpoints. All fields are optional. @@ -14,7 +14,7 @@ module FinchAPI sig do params( - body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Util::AnyHash)] + body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Internal::AnyHash)] ) .void end @@ -22,8 +22,8 @@ module FinchAPI sig do params( - body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Util::AnyHash)], - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Internal::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -42,7 +42,7 @@ module FinchAPI def to_hash end - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } attr_accessor :class_code @@ -55,7 +55,7 @@ module FinchAPI sig do params( - custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField, FinchAPI::Util::AnyHash)] + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField, FinchAPI::Internal::AnyHash)] ) .void end @@ -68,7 +68,7 @@ module FinchAPI sig do params( department: T.nilable( - T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, FinchAPI::Internal::AnyHash) ) ) .void @@ -88,7 +88,7 @@ module FinchAPI sig do params( employment: T.nilable( - T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, FinchAPI::Internal::AnyHash) ) ) .void @@ -126,7 +126,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Income)) } attr_reader :income - sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))).void } attr_writer :income # The array of income history. @@ -147,7 +147,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :location - sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :location # The manager object representing the manager of the individual within the org. @@ -156,7 +156,9 @@ module FinchAPI sig do params( - manager: T.nilable(T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, FinchAPI::Util::AnyHash)) + manager: T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -180,7 +182,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :residence - sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :residence # The source system's unique employment identifier for this individual @@ -207,16 +209,16 @@ module FinchAPI sig do params( class_code: T.nilable(String), - custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField, FinchAPI::Util::AnyHash)], + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField, FinchAPI::Internal::AnyHash)], department: T.nilable( - T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, FinchAPI::Internal::AnyHash) ), dob: T.nilable(String), emails: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email, FinchAPI::Internal::AnyHash)] ), employment: T.nilable( - T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, FinchAPI::Internal::AnyHash) ), employment_status: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::OrSymbol), encrypted_ssn: T.nilable(String), @@ -224,23 +226,25 @@ module FinchAPI ethnicity: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::OrSymbol), first_name: T.nilable(String), 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))]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))]), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), - 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)), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), + manager: T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, FinchAPI::Internal::AnyHash) + ), middle_name: T.nilable(String), phone_numbers: T.nilable( T::Array[ T.nilable( - T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber, FinchAPI::Internal::AnyHash) ) ] ), preferred_name: T.nilable(String), - residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), source_id: String, ssn: T.nilable(String), start_date: T.nilable(String), @@ -316,7 +320,7 @@ module FinchAPI def to_hash end - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :name @@ -335,7 +339,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The name of the department associated with the individual. sig { returns(T.nilable(String)) } attr_accessor :name @@ -350,7 +354,7 @@ module FinchAPI end end - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :data @@ -380,12 +384,12 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::TaggedSymbol) } WORK = T.let(:work, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::TaggedSymbol) PERSONAL = @@ -400,7 +404,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel # 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)) } @@ -436,12 +440,18 @@ module FinchAPI # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol + ) + end FULL_TIME = T.let( @@ -480,12 +490,18 @@ module FinchAPI # The main employment type of the individual. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::TaggedSymbol + ) + end EMPLOYEE = T.let(:employee, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::TaggedSymbol) @@ -503,12 +519,18 @@ module FinchAPI # The detailed employment status of the individual. module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol + ) + end ACTIVE = T.let(:active, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) @@ -535,12 +557,12 @@ module FinchAPI # The EEOC-defined ethnicity of the individual. module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, 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) @@ -581,12 +603,12 @@ module FinchAPI # The gender of the individual. module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) } FEMALE = T.let(:female, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) MALE = T.let(:male, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) @@ -599,7 +621,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id @@ -617,7 +639,7 @@ module FinchAPI end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :data @@ -647,12 +669,18 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::TaggedSymbol + ) + end WORK = T.let(:work, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::TaggedSymbol) diff --git a/rbi/lib/finch_api/models/sandbox/directory_create_response.rbi b/rbi/lib/finch_api/models/sandbox/directory_create_response.rbi new file mode 100644 index 00000000..6d8b995a --- /dev/null +++ b/rbi/lib/finch_api/models/sandbox/directory_create_response.rbi @@ -0,0 +1,13 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + DirectoryCreateResponse = + T.let( + FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown], + FinchAPI::Internal::Type::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 similarity index 85% rename from rbi/lib/finch-api/models/sandbox/employment_update_params.rbi rename to rbi/lib/finch_api/models/sandbox/employment_update_params.rbi index a622d232..a6777886 100644 --- a/rbi/lib/finch-api/models/sandbox/employment_update_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/employment_update_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class EmploymentUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } @@ -19,7 +19,7 @@ module FinchAPI sig do params( - custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Util::AnyHash)] + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Internal::AnyHash)] ) .void end @@ -31,7 +31,9 @@ module FinchAPI sig do params( - department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Util::AnyHash)) + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -43,7 +45,9 @@ module FinchAPI sig do params( - employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Util::AnyHash)) + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -66,7 +70,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Income)) } attr_reader :income - sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))).void } attr_writer :income # The array of income history. @@ -87,7 +91,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :location - sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :location # The manager object representing the manager of the individual within the org. @@ -96,7 +100,7 @@ module FinchAPI sig do params( - manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Util::AnyHash)) + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Internal::AnyHash)) ) .void end @@ -123,24 +127,28 @@ module FinchAPI sig do params( class_code: T.nilable(String), - 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)), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Internal::AnyHash)], + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Internal::AnyHash) + ), + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Internal::AnyHash) + ), employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::OrSymbol), end_date: T.nilable(String), first_name: T.nilable(String), - 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))]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))]), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), - location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), - manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Util::AnyHash)), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Internal::AnyHash)), middle_name: T.nilable(String), source_id: String, start_date: T.nilable(String), title: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -196,7 +204,7 @@ module FinchAPI def to_hash end - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :name @@ -215,7 +223,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The name of the department associated with the individual. sig { returns(T.nilable(String)) } attr_accessor :name @@ -230,7 +238,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel # 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)) } @@ -266,12 +274,18 @@ module FinchAPI # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol + ) + end FULL_TIME = T.let(:full_time, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) @@ -298,12 +312,12 @@ module FinchAPI # The main employment type of the individual. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::TaggedSymbol) } EMPLOYEE = T.let(:employee, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::TaggedSymbol) @@ -321,12 +335,12 @@ module FinchAPI # The detailed employment status of the individual. module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) } ACTIVE = T.let(:active, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) @@ -350,7 +364,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id diff --git a/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi b/rbi/lib/finch_api/models/sandbox/employment_update_response.rbi similarity index 85% rename from rbi/lib/finch-api/models/sandbox/employment_update_response.rbi rename to rbi/lib/finch_api/models/sandbox/employment_update_response.rbi index 9e2859e2..009c76e7 100644 --- a/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi +++ b/rbi/lib/finch_api/models/sandbox/employment_update_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - class EmploymentUpdateResponse < FinchAPI::BaseModel + class EmploymentUpdateResponse < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id @@ -23,7 +23,7 @@ module FinchAPI sig do params( - custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField, FinchAPI::Util::AnyHash)] + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField, FinchAPI::Internal::AnyHash)] ) .void end @@ -35,7 +35,9 @@ module FinchAPI sig do params( - department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, FinchAPI::Util::AnyHash)) + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -47,7 +49,9 @@ module FinchAPI sig do params( - employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, FinchAPI::Util::AnyHash)) + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -70,7 +74,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Income)) } attr_reader :income - sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))).void } attr_writer :income # The array of income history. @@ -91,7 +95,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :location - sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :location # The manager object representing the manager of the individual within the org. @@ -100,7 +104,9 @@ module FinchAPI sig do params( - manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, FinchAPI::Util::AnyHash)) + manager: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, FinchAPI::Internal::AnyHash) + ) ) .void end @@ -128,19 +134,25 @@ module FinchAPI params( id: String, class_code: T.nilable(String), - 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)), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField, FinchAPI::Internal::AnyHash)], + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, FinchAPI::Internal::AnyHash) + ), + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, FinchAPI::Internal::AnyHash) + ), employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::OrSymbol), end_date: T.nilable(String), first_name: T.nilable(String), - 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))]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))]), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), - location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), - manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, FinchAPI::Util::AnyHash)), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), + manager: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, FinchAPI::Internal::AnyHash) + ), middle_name: T.nilable(String), source_id: String, start_date: T.nilable(String), @@ -200,7 +212,7 @@ module FinchAPI def to_hash end - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :name @@ -219,7 +231,7 @@ module FinchAPI end end - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel # The name of the department associated with the individual. sig { returns(T.nilable(String)) } attr_accessor :name @@ -234,7 +246,7 @@ module FinchAPI end end - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel # 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)) } @@ -270,12 +282,18 @@ module FinchAPI # The secondary employment type of the individual. Options: `full_time`, # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol + ) + end FULL_TIME = T.let(:full_time, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) @@ -303,12 +321,12 @@ module FinchAPI # The main employment type of the individual. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol) } EMPLOYEE = T.let(:employee, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol) @@ -326,12 +344,12 @@ module FinchAPI # The detailed employment status of the individual. module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) } ACTIVE = T.let(:active, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) @@ -356,7 +374,7 @@ module FinchAPI end end - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id diff --git a/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi b/rbi/lib/finch_api/models/sandbox/individual_update_params.rbi similarity index 87% rename from rbi/lib/finch-api/models/sandbox/individual_update_params.rbi rename to rbi/lib/finch_api/models/sandbox/individual_update_params.rbi index 83eaa937..3812a842 100644 --- a/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/individual_update_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class IndividualUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(T.nilable(String)) } attr_accessor :dob @@ -49,7 +49,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :residence - sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :residence # Social Security Number of the individual. This field is only available with the @@ -63,7 +63,7 @@ module FinchAPI params( dob: T.nilable(String), emails: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email, FinchAPI::Internal::AnyHash)] ), encrypted_ssn: T.nilable(String), ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::OrSymbol), @@ -72,12 +72,16 @@ module FinchAPI last_name: T.nilable(String), middle_name: T.nilable(String), phone_numbers: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, FinchAPI::Util::AnyHash))] + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, FinchAPI::Internal::AnyHash) + ) + ] ), preferred_name: T.nilable(String), - residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), ssn: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -121,7 +125,7 @@ module FinchAPI def to_hash end - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :data @@ -151,12 +155,12 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol) } WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol) PERSONAL = T.let(:personal, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol) @@ -169,12 +173,12 @@ module FinchAPI # The EEOC-defined ethnicity of the individual. module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) } ASIAN = T.let(:asian, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) WHITE = T.let(:white, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) @@ -207,11 +211,11 @@ module FinchAPI # The gender of the individual. module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) } FEMALE = T.let(:female, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) MALE = T.let(:male, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) @@ -224,7 +228,7 @@ module FinchAPI end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :data @@ -254,12 +258,12 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::TaggedSymbol) } WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::TaggedSymbol) PERSONAL = diff --git a/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi b/rbi/lib/finch_api/models/sandbox/individual_update_response.rbi similarity index 89% rename from rbi/lib/finch-api/models/sandbox/individual_update_response.rbi rename to rbi/lib/finch_api/models/sandbox/individual_update_response.rbi index a71677e8..4e77f901 100644 --- a/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi +++ b/rbi/lib/finch_api/models/sandbox/individual_update_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - class IndividualUpdateResponse < FinchAPI::BaseModel + class IndividualUpdateResponse < FinchAPI::Internal::Type::BaseModel # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } attr_reader :id @@ -53,7 +53,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Location)) } attr_reader :residence - sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))).void } attr_writer :residence # Social Security Number of the individual. This field is only available with the @@ -68,7 +68,7 @@ module FinchAPI id: String, dob: T.nilable(String), emails: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email, FinchAPI::Internal::AnyHash)] ), encrypted_ssn: T.nilable(String), ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::OrSymbol), @@ -79,12 +79,12 @@ module FinchAPI phone_numbers: T.nilable( T::Array[ T.nilable( - T.any(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, FinchAPI::Internal::AnyHash) ) ] ), preferred_name: T.nilable(String), - residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), ssn: T.nilable(String) ) .returns(T.attached_class) @@ -129,7 +129,7 @@ module FinchAPI def to_hash end - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_reader :data @@ -162,12 +162,12 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol) } WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol) PERSONAL = @@ -181,12 +181,12 @@ module FinchAPI # The EEOC-defined ethnicity of the individual. module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) } ASIAN = T.let(:asian, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) WHITE = T.let(:white, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) @@ -219,12 +219,12 @@ module FinchAPI # The gender of the individual. module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) } FEMALE = T.let(:female, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) MALE = T.let(:male, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) @@ -237,7 +237,7 @@ module FinchAPI end end - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel sig { returns(T.nilable(String)) } attr_accessor :data @@ -267,12 +267,18 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol + ) + end WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol) PERSONAL = diff --git a/rbi/lib/finch-api/models/sandbox/job_create_params.rbi b/rbi/lib/finch_api/models/sandbox/job_create_params.rbi similarity index 76% rename from rbi/lib/finch-api/models/sandbox/job_create_params.rbi rename to rbi/lib/finch_api/models/sandbox/job_create_params.rbi index 20a51fcb..32c2e2e5 100644 --- a/rbi/lib/finch-api/models/sandbox/job_create_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/job_create_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class JobCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class JobCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters # The type of job to start. Currently the only supported type is `data_sync_all` sig { returns(FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol) } @@ -14,7 +14,7 @@ module FinchAPI sig do params( type: FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -32,10 +32,11 @@ module FinchAPI # The type of job to start. Currently the only supported type is `data_sync_all` module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + OrSymbol = + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::JobCreateParams::Type::TaggedSymbol) } DATA_SYNC_ALL = T.let(:data_sync_all, FinchAPI::Models::Sandbox::JobCreateParams::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/sandbox/job_create_response.rbi b/rbi/lib/finch_api/models/sandbox/job_create_response.rbi similarity index 94% rename from rbi/lib/finch-api/models/sandbox/job_create_response.rbi rename to rbi/lib/finch_api/models/sandbox/job_create_response.rbi index a49b5e91..52a35cfa 100644 --- a/rbi/lib/finch-api/models/sandbox/job_create_response.rbi +++ b/rbi/lib/finch_api/models/sandbox/job_create_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - class JobCreateResponse < FinchAPI::BaseModel + class JobCreateResponse < FinchAPI::Internal::Type::BaseModel # The number of allowed refreshes per hour (per hour, fixed window) sig { returns(Integer) } attr_accessor :allowed_refreshes diff --git a/rbi/lib/finch_api/models/sandbox/jobs/configuration_retrieve_params.rbi b/rbi/lib/finch_api/models/sandbox/jobs/configuration_retrieve_params.rbi new file mode 100644 index 00000000..112474c3 --- /dev/null +++ b/rbi/lib/finch_api/models/sandbox/jobs/configuration_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Jobs + class ConfigurationRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + sig do + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi b/rbi/lib/finch_api/models/sandbox/jobs/configuration_retrieve_response.rbi similarity index 54% rename from rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi rename to rbi/lib/finch_api/models/sandbox/jobs/configuration_retrieve_response.rbi index 0058bfc8..cdca13c5 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 @@ -6,8 +6,8 @@ module FinchAPI module Jobs ConfigurationRetrieveResponse = T.let( - FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration], - FinchAPI::Type::Converter + FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration], + FinchAPI::Internal::Type::Converter ) 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 similarity index 58% rename from rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi rename to rbi/lib/finch_api/models/sandbox/jobs/configuration_update_params.rbi index aaa2d816..bd0b3f11 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 @@ -5,16 +5,12 @@ module FinchAPI module Sandbox module Jobs class ConfigurationUpdateParams < FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig do - params( - request_options: T.any( - FinchAPI::RequestOptions, - FinchAPI::Util::AnyHash - ) - ).returns(T.attached_class) + params(request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + .returns(T.attached_class) end def self.new(request_options: {}) end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi b/rbi/lib/finch_api/models/sandbox/jobs/sandbox_job_configuration.rbi similarity index 83% rename from rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi rename to rbi/lib/finch_api/models/sandbox/jobs/sandbox_job_configuration.rbi index 1a526172..3076fd8a 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 @@ -4,7 +4,7 @@ module FinchAPI module Models module Sandbox module Jobs - class SandboxJobConfiguration < FinchAPI::BaseModel + class SandboxJobConfiguration < FinchAPI::Internal::Type::BaseModel sig { returns(FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol) } attr_accessor :completion_status @@ -34,12 +34,18 @@ module FinchAPI end module CompletionStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol + ) + end COMPLETE = T.let(:complete, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol) @@ -67,12 +73,12 @@ module FinchAPI end module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol) } DATA_SYNC_ALL = T.let(:data_sync_all, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi b/rbi/lib/finch_api/models/sandbox/payment_create_params.rbi similarity index 89% rename from rbi/lib/finch-api/models/sandbox/payment_create_params.rbi rename to rbi/lib/finch_api/models/sandbox/payment_create_params.rbi index f41dee5d..b0015426 100644 --- a/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi +++ b/rbi/lib/finch_api/models/sandbox/payment_create_params.rbi @@ -3,9 +3,9 @@ module FinchAPI module Models module Sandbox - class PaymentCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PaymentCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters sig { returns(T.nilable(String)) } attr_reader :end_date @@ -18,7 +18,7 @@ module FinchAPI sig do params( - pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Util::AnyHash)] + pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Internal::AnyHash)] ) .void end @@ -33,9 +33,9 @@ module FinchAPI sig do params( end_date: String, - pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Util::AnyHash)], + pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Internal::AnyHash)], start_date: String, - request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash) ) .returns(T.attached_class) end @@ -56,7 +56,7 @@ module FinchAPI def to_hash end - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel # The array of earnings objects associated with this pay statement sig do returns( @@ -87,7 +87,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :gross_pay - sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :gross_pay # A stable Finch `id` (UUID v4) for an individual in the company @@ -100,7 +100,7 @@ module FinchAPI sig { returns(T.nilable(FinchAPI::Models::Money)) } attr_reader :net_pay - sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash))).void } attr_writer :net_pay # The payment method. @@ -124,7 +124,7 @@ module FinchAPI earnings: T.nilable( T::Array[ T.nilable( - T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning, FinchAPI::Util::AnyHash) + T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning, FinchAPI::Internal::AnyHash) ) ] ), @@ -133,7 +133,7 @@ module FinchAPI T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ] @@ -143,19 +143,19 @@ module FinchAPI T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ] ), - gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::AnyHash)), individual_id: String, - net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Internal::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) + T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax, FinchAPI::Internal::AnyHash) ) ] ), @@ -202,7 +202,7 @@ module FinchAPI def to_hash end - class Earning < FinchAPI::BaseModel + class Earning < FinchAPI::Internal::Type::BaseModel # The earnings amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -215,7 +215,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ) @@ -246,7 +246,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ), currency: T.nilable(String), @@ -275,7 +275,7 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) @@ -287,7 +287,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -298,7 +298,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -315,7 +315,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -337,12 +337,18 @@ module FinchAPI # The type of earning. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol + ) + end SALARY = T.let(:salary, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) @@ -381,7 +387,7 @@ module FinchAPI ) TIPS = T.let(:tips, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) - NUMBER_1099 = + TYPE_1099 = T.let(:"1099", FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) OTHER = T.let(:other, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) @@ -397,7 +403,7 @@ module FinchAPI end end - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # The deduction amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -414,7 +420,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ) @@ -444,7 +450,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ), currency: T.nilable(String), @@ -473,7 +479,7 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable( @@ -487,7 +493,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -498,7 +504,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -517,7 +523,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -538,7 +544,7 @@ module FinchAPI end end - class EmployerContribution < FinchAPI::BaseModel + class EmployerContribution < FinchAPI::Internal::Type::BaseModel # The contribution amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -555,7 +561,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ) @@ -581,7 +587,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ), currency: T.nilable(String), @@ -608,7 +614,7 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable( @@ -622,7 +628,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -633,7 +639,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -652,7 +658,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -675,12 +681,18 @@ module FinchAPI # The payment method. module PaymentMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::TaggedSymbol + ) + end CHECK = T.let(:check, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::TaggedSymbol) @@ -700,7 +712,7 @@ module FinchAPI end end - class Tax < FinchAPI::BaseModel + class Tax < FinchAPI::Internal::Type::BaseModel # The tax amount in cents. sig { returns(T.nilable(Integer)) } attr_accessor :amount @@ -713,7 +725,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) ) @@ -743,7 +755,7 @@ module FinchAPI attributes: T.nilable( T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ), currency: T.nilable(String), @@ -772,7 +784,7 @@ module FinchAPI def to_hash end - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel sig do returns( T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) @@ -784,7 +796,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .void @@ -795,7 +807,7 @@ module FinchAPI params( metadata: T.any( FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata, - FinchAPI::Util::AnyHash + FinchAPI::Internal::AnyHash ) ) .returns(T.attached_class) @@ -812,7 +824,7 @@ module FinchAPI def to_hash end - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::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.). @@ -834,12 +846,18 @@ module FinchAPI # The type of taxes. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias do + T.any( + Symbol, + String, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol + ) + end STATE = T.let(:state, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol) @@ -861,12 +879,12 @@ module FinchAPI # The type of the payment associated with the pay statement. module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum 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) } + T.type_alias { T.any(Symbol, String, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol) } REGULAR_PAYROLL = T.let(:regular_payroll, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol) diff --git a/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi b/rbi/lib/finch_api/models/sandbox/payment_create_response.rbi similarity index 88% rename from rbi/lib/finch-api/models/sandbox/payment_create_response.rbi rename to rbi/lib/finch_api/models/sandbox/payment_create_response.rbi index efc39ac5..08607189 100644 --- a/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi +++ b/rbi/lib/finch_api/models/sandbox/payment_create_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - class PaymentCreateResponse < FinchAPI::BaseModel + class PaymentCreateResponse < FinchAPI::Internal::Type::BaseModel # The date of the payment. sig { returns(String) } attr_accessor :pay_date diff --git a/rbi/lib/finch-api/models/webhook_event.rbi b/rbi/lib/finch_api/models/webhook_event.rbi similarity index 91% rename from rbi/lib/finch-api/models/webhook_event.rbi rename to rbi/lib/finch_api/models/webhook_event.rbi index 4a20469c..2d8a454f 100644 --- a/rbi/lib/finch-api/models/webhook_event.rbi +++ b/rbi/lib/finch_api/models/webhook_event.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module WebhookEvent - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union sig do override diff --git a/rbi/lib/finch-api/request_options.rbi b/rbi/lib/finch_api/request_options.rbi similarity index 92% rename from rbi/lib/finch-api/request_options.rbi rename to rbi/lib/finch_api/request_options.rbi index 259f90db..62adf0e3 100644 --- a/rbi/lib/finch-api/request_options.rbi +++ b/rbi/lib/finch_api/request_options.rbi @@ -6,7 +6,7 @@ module FinchAPI # # 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 + class RequestOptions < FinchAPI::Internal::Type::BaseModel # @api private sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void } def self.validate!(opts) @@ -41,7 +41,7 @@ module FinchAPI attr_accessor :timeout # Returns a new instance of RequestOptions. - sig { params(values: FinchAPI::Util::AnyHash).returns(T.attached_class) } + sig { params(values: FinchAPI::Internal::AnyHash).returns(T.attached_class) } def self.new(values = {}) end end diff --git a/rbi/lib/finch-api/resources/access_tokens.rbi b/rbi/lib/finch_api/resources/access_tokens.rbi similarity index 92% rename from rbi/lib/finch-api/resources/access_tokens.rbi rename to rbi/lib/finch_api/resources/access_tokens.rbi index 858bb967..8df776c8 100644 --- a/rbi/lib/finch-api/resources/access_tokens.rbi +++ b/rbi/lib/finch_api/resources/access_tokens.rbi @@ -10,13 +10,14 @@ module FinchAPI client_id: String, client_secret: String, redirect_uri: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::CreateAccessTokenResponse) end def create(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/account.rbi b/rbi/lib/finch_api/resources/account.rbi similarity index 87% rename from rbi/lib/finch-api/resources/account.rbi rename to rbi/lib/finch_api/resources/account.rbi index 273fc622..4585b73d 100644 --- a/rbi/lib/finch-api/resources/account.rbi +++ b/rbi/lib/finch_api/resources/account.rbi @@ -5,7 +5,7 @@ module FinchAPI class Account # Disconnect one or more `access_token`s from your application. sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) .returns(FinchAPI::Models::DisconnectResponse) end def disconnect(request_options: {}) @@ -13,12 +13,13 @@ module FinchAPI # Read account information associated with an `access_token` sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) .returns(FinchAPI::Models::Introspection) end def introspect(request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/connect.rbi b/rbi/lib/finch_api/resources/connect.rbi similarity index 93% rename from rbi/lib/finch-api/resources/connect.rbi rename to rbi/lib/finch_api/resources/connect.rbi index 9cf5a0bf..63c93029 100644 --- a/rbi/lib/finch-api/resources/connect.rbi +++ b/rbi/lib/finch_api/resources/connect.rbi @@ -6,6 +6,7 @@ module FinchAPI sig { returns(FinchAPI::Resources::Connect::Sessions) } attr_reader :sessions + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/connect/sessions.rbi b/rbi/lib/finch_api/resources/connect/sessions.rbi similarity index 93% rename from rbi/lib/finch-api/resources/connect/sessions.rbi rename to rbi/lib/finch_api/resources/connect/sessions.rbi index e52ad833..b403d322 100644 --- a/rbi/lib/finch-api/resources/connect/sessions.rbi +++ b/rbi/lib/finch_api/resources/connect/sessions.rbi @@ -11,12 +11,12 @@ module FinchAPI customer_name: String, products: T::Array[FinchAPI::Models::Connect::SessionNewParams::Product::OrSymbol], customer_email: T.nilable(String), - integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Util::AnyHash)), + integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Internal::AnyHash)), manual: T.nilable(T::Boolean), minutes_to_expire: T.nilable(Float), redirect_uri: T.nilable(String), sandbox: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Sandbox::OrSymbol), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Connect::SessionNewResponse) end @@ -43,7 +43,7 @@ module FinchAPI minutes_to_expire: T.nilable(Integer), products: T.nilable(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::OrSymbol]), redirect_uri: T.nilable(String), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Connect::SessionReauthenticateResponse) end @@ -61,6 +61,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris.rbi b/rbi/lib/finch_api/resources/hris.rbi similarity index 97% rename from rbi/lib/finch-api/resources/hris.rbi rename to rbi/lib/finch_api/resources/hris.rbi index 0273e083..460c720e 100644 --- a/rbi/lib/finch-api/resources/hris.rbi +++ b/rbi/lib/finch_api/resources/hris.rbi @@ -27,6 +27,7 @@ module FinchAPI sig { returns(FinchAPI::Resources::HRIS::Benefits) } attr_reader :benefits + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/benefits.rbi b/rbi/lib/finch_api/resources/hris/benefits.rbi similarity index 84% rename from rbi/lib/finch-api/resources/hris/benefits.rbi rename to rbi/lib/finch_api/resources/hris/benefits.rbi index 26b286c5..b3562454 100644 --- a/rbi/lib/finch-api/resources/hris/benefits.rbi +++ b/rbi/lib/finch_api/resources/hris/benefits.rbi @@ -14,7 +14,7 @@ module FinchAPI description: String, 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)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse) end @@ -23,6 +23,7 @@ module FinchAPI # limiting this to <30 characters due to limitations in specific providers (e.g. # Justworks). description: nil, + # The frequency of the benefit deduction/contribution. frequency: nil, # Type of benefit. type: nil, @@ -34,7 +35,7 @@ module FinchAPI sig do params( benefit_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::HRIS::CompanyBenefit) end @@ -46,7 +47,7 @@ module FinchAPI params( benefit_id: String, description: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse) end @@ -60,20 +61,21 @@ module FinchAPI # List all company-wide deductions and contributions. sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) - .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit]) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) + .returns(FinchAPI::Internal::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, FinchAPI::Util::AnyHash))) - .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit]) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit]) end def list_supported_benefits(request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi b/rbi/lib/finch_api/resources/hris/benefits/individuals.rbi similarity index 76% rename from rbi/lib/finch-api/resources/hris/benefits/individuals.rbi rename to rbi/lib/finch_api/resources/hris/benefits/individuals.rbi index cc51fa97..48103e1b 100644 --- a/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi +++ b/rbi/lib/finch_api/resources/hris/benefits/individuals.rbi @@ -12,10 +12,15 @@ module FinchAPI sig do params( benefit_id: String, - 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)) + individuals: T::Array[ + T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, + FinchAPI::Internal::AnyHash + ) + ], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual]) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual]) end def enroll_many( benefit_id, @@ -29,7 +34,7 @@ module FinchAPI sig do params( benefit_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse) end @@ -41,9 +46,9 @@ module FinchAPI params( benefit_id: String, individual_ids: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit]) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit]) end def retrieve_many_benefits( benefit_id, @@ -59,9 +64,9 @@ module FinchAPI params( benefit_id: String, individual_ids: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual]) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual]) end def unenroll_many( benefit_id, @@ -71,6 +76,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/company.rbi b/rbi/lib/finch_api/resources/hris/company.rbi similarity index 71% rename from rbi/lib/finch-api/resources/hris/company.rbi rename to rbi/lib/finch_api/resources/hris/company.rbi index 2a1d768a..ee1d7fec 100644 --- a/rbi/lib/finch-api/resources/hris/company.rbi +++ b/rbi/lib/finch_api/resources/hris/company.rbi @@ -4,14 +4,18 @@ module FinchAPI module Resources class HRIS class Company + sig { returns(FinchAPI::Resources::HRIS::Company::PayStatementItem) } + attr_reader :pay_statement_item + # Read basic company data sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) .returns(FinchAPI::Models::HRIS::HRISCompany) end def retrieve(request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch_api/resources/hris/company/pay_statement_item.rbi b/rbi/lib/finch_api/resources/hris/company/pay_statement_item.rbi new file mode 100644 index 00000000..8ee202c3 --- /dev/null +++ b/rbi/lib/finch_api/resources/hris/company/pay_statement_item.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Company + class PayStatementItem + sig { returns(FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules) } + attr_reader :rules + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Retrieve a list of detailed pay statement + # items for the access token's connection account. + sig do + params( + categories: T::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::Category::OrSymbol], + end_date: Date, + name: String, + start_date: Date, + type: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + ) + .returns(FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::Company::PayStatementItemListResponse]) + end + def list( + # Comma-delimited list of pay statement item categories to filter on. If empty, + # defaults to all categories. + categories: nil, + # The end date to retrieve pay statement items by via their last seen pay date in + # `YYYY-MM-DD` format. + end_date: nil, + # Case-insensitive partial match search by pay statement item name. + name: nil, + # The start date to retrieve pay statement items by via their last seen pay date + # (inclusive) in `YYYY-MM-DD` format. + start_date: nil, + # String search by pay statement item type. + type: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lib/finch_api/resources/hris/company/pay_statement_item/rules.rbi b/rbi/lib/finch_api/resources/hris/company/pay_statement_item/rules.rbi new file mode 100644 index 00000000..2d94add5 --- /dev/null +++ b/rbi/lib/finch_api/resources/hris/company/pay_statement_item/rules.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Company + class PayStatementItem + class Rules + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Custom rules can be created to associate + # specific attributes to pay statement items depending on the use case. For + # example, pay statement items that meet certain conditions can be labeled as a + # pre-tax 401k. This metadata can be retrieved where pay statement item + # information is available. + sig do + params( + attributes: T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + FinchAPI::Internal::AnyHash + ), + conditions: T::Array[ + T.any( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition, + FinchAPI::Internal::AnyHash + ) + ], + effective_end_date: T.nilable(String), + effective_start_date: T.nilable(String), + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::EntityType::OrSymbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + ) + .returns(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse) + end + def create( + # Specifies the fields to be applied when the condition is met. + attributes: nil, + conditions: nil, + # Specifies when the rules should stop applying rules based on the date. + effective_end_date: nil, + # Specifies when the rule should begin applying based on the date. + effective_start_date: nil, + # The entity type to which the rule is applied. + entity_type: nil, + request_options: {} + ) + end + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Update a rule for a pay statement item. + sig do + params( + rule_id: String, + optional_property: T.anything, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + ) + .returns(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse) + end + def update(rule_id, optional_property: nil, request_options: {}) + end + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon List all rules of a connection account. + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) + .returns( + FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse] + ) + end + def list(request_options: {}) + end + + # **Beta:** this endpoint currently serves employers onboarded after March 4th and + # historical support will be added soon Delete a rule for a pay statement item. + sig do + params( + rule_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) + ) + .returns(FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse) + end + def delete(rule_id, request_options: {}) + end + + # @api private + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/directory.rbi b/rbi/lib/finch_api/resources/hris/directory.rbi similarity index 80% rename from rbi/lib/finch-api/resources/hris/directory.rbi rename to rbi/lib/finch_api/resources/hris/directory.rbi index 484c94fc..39bac6c2 100644 --- a/rbi/lib/finch-api/resources/hris/directory.rbi +++ b/rbi/lib/finch_api/resources/hris/directory.rbi @@ -9,9 +9,9 @@ module FinchAPI params( limit: Integer, offset: Integer, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory]) + .returns(FinchAPI::Internal::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory]) end def list( # Number of employees to return (defaults to all) @@ -22,6 +22,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/documents.rbi b/rbi/lib/finch_api/resources/hris/documents.rbi similarity index 94% rename from rbi/lib/finch-api/resources/hris/documents.rbi rename to rbi/lib/finch_api/resources/hris/documents.rbi index 3dc10bc1..b9afbcac 100644 --- a/rbi/lib/finch-api/resources/hris/documents.rbi +++ b/rbi/lib/finch_api/resources/hris/documents.rbi @@ -12,7 +12,7 @@ module FinchAPI limit: Integer, offset: Integer, types: T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::HRIS::DocumentListResponse) end @@ -36,7 +36,7 @@ module FinchAPI sig do params( document_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(T.any(FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005)) end @@ -47,6 +47,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/employments.rbi b/rbi/lib/finch_api/resources/hris/employments.rbi similarity index 72% rename from rbi/lib/finch-api/resources/hris/employments.rbi rename to rbi/lib/finch_api/resources/hris/employments.rbi index 332e2560..63415bab 100644 --- a/rbi/lib/finch-api/resources/hris/employments.rbi +++ b/rbi/lib/finch_api/resources/hris/employments.rbi @@ -7,10 +7,10 @@ module FinchAPI # Read individual employment and income data sig do params( - requests: T::Array[T.any(FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + requests: T::Array[T.any(FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse]) + .returns(FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse]) end def retrieve_many( # The array of batch requests. @@ -19,6 +19,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/individuals.rbi b/rbi/lib/finch_api/resources/hris/individuals.rbi similarity index 60% rename from rbi/lib/finch-api/resources/hris/individuals.rbi rename to rbi/lib/finch_api/resources/hris/individuals.rbi index cc6e017c..45204dc7 100644 --- a/rbi/lib/finch-api/resources/hris/individuals.rbi +++ b/rbi/lib/finch_api/resources/hris/individuals.rbi @@ -7,15 +7,18 @@ module FinchAPI # Read individual data, excluding income and employment data sig do params( - 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)) + options: T.nilable( + T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Internal::AnyHash) + ), + requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::IndividualResponse]) + .returns(FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::IndividualResponse]) end def retrieve_many(options: nil, requests: nil, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/pay_statements.rbi b/rbi/lib/finch_api/resources/hris/pay_statements.rbi similarity index 76% rename from rbi/lib/finch-api/resources/hris/pay_statements.rbi rename to rbi/lib/finch_api/resources/hris/pay_statements.rbi index 0feb644d..348149a9 100644 --- a/rbi/lib/finch-api/resources/hris/pay_statements.rbi +++ b/rbi/lib/finch_api/resources/hris/pay_statements.rbi @@ -10,10 +10,10 @@ module FinchAPI # supports Benefits. sig do params( - requests: T::Array[T.any(FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + requests: T::Array[T.any(FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request, FinchAPI::Internal::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse]) + .returns(FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse]) end def retrieve_many( # The array of batch requests. @@ -22,6 +22,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/hris/payments.rbi b/rbi/lib/finch_api/resources/hris/payments.rbi similarity index 84% rename from rbi/lib/finch-api/resources/hris/payments.rbi rename to rbi/lib/finch_api/resources/hris/payments.rbi index 29559d86..5376a486 100644 --- a/rbi/lib/finch-api/resources/hris/payments.rbi +++ b/rbi/lib/finch_api/resources/hris/payments.rbi @@ -9,9 +9,9 @@ module FinchAPI params( end_date: Date, start_date: Date, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment]) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Payment]) end def list( # The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` @@ -24,6 +24,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/jobs.rbi b/rbi/lib/finch_api/resources/jobs.rbi similarity index 94% rename from rbi/lib/finch-api/resources/jobs.rbi rename to rbi/lib/finch_api/resources/jobs.rbi index 3bdb92d1..58bbffff 100644 --- a/rbi/lib/finch-api/resources/jobs.rbi +++ b/rbi/lib/finch_api/resources/jobs.rbi @@ -9,6 +9,7 @@ module FinchAPI sig { returns(FinchAPI::Resources::Jobs::Manual) } attr_reader :manual + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/jobs/automated.rbi b/rbi/lib/finch_api/resources/jobs/automated.rbi similarity index 93% rename from rbi/lib/finch-api/resources/jobs/automated.rbi rename to rbi/lib/finch_api/resources/jobs/automated.rbi index 5e90492a..b7c30bc8 100644 --- a/rbi/lib/finch-api/resources/jobs/automated.rbi +++ b/rbi/lib/finch_api/resources/jobs/automated.rbi @@ -21,8 +21,8 @@ module FinchAPI sig do params( 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)) + params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Internal::AnyHash), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Jobs::AutomatedCreateResponse) end @@ -38,7 +38,7 @@ module FinchAPI sig do params( job_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Jobs::AutomatedAsyncJob) end @@ -52,7 +52,7 @@ module FinchAPI params( limit: Integer, offset: Integer, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Jobs::AutomatedListResponse) end @@ -65,6 +65,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/jobs/manual.rbi b/rbi/lib/finch_api/resources/jobs/manual.rbi similarity index 91% rename from rbi/lib/finch-api/resources/jobs/manual.rbi rename to rbi/lib/finch_api/resources/jobs/manual.rbi index d297bc2a..28efce16 100644 --- a/rbi/lib/finch-api/resources/jobs/manual.rbi +++ b/rbi/lib/finch_api/resources/jobs/manual.rbi @@ -9,13 +9,14 @@ module FinchAPI sig do params( job_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Jobs::ManualAsyncJob) end def retrieve(job_id, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/payroll.rbi b/rbi/lib/finch_api/resources/payroll.rbi similarity index 93% rename from rbi/lib/finch-api/resources/payroll.rbi rename to rbi/lib/finch_api/resources/payroll.rbi index f2405820..922677a1 100644 --- a/rbi/lib/finch-api/resources/payroll.rbi +++ b/rbi/lib/finch_api/resources/payroll.rbi @@ -6,6 +6,7 @@ module FinchAPI sig { returns(FinchAPI::Resources::Payroll::PayGroups) } attr_reader :pay_groups + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/payroll/pay_groups.rbi b/rbi/lib/finch_api/resources/payroll/pay_groups.rbi similarity index 82% rename from rbi/lib/finch-api/resources/payroll/pay_groups.rbi rename to rbi/lib/finch_api/resources/payroll/pay_groups.rbi index ea721705..a296fbb2 100644 --- a/rbi/lib/finch-api/resources/payroll/pay_groups.rbi +++ b/rbi/lib/finch_api/resources/payroll/pay_groups.rbi @@ -8,7 +8,7 @@ module FinchAPI sig do params( pay_group_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Payroll::PayGroupRetrieveResponse) end @@ -20,13 +20,14 @@ module FinchAPI params( individual_id: String, pay_frequencies: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) - .returns(FinchAPI::SinglePage[FinchAPI::Models::Payroll::PayGroupListResponse]) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::Payroll::PayGroupListResponse]) end def list(individual_id: nil, pay_frequencies: nil, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/providers.rbi b/rbi/lib/finch_api/resources/providers.rbi similarity index 73% rename from rbi/lib/finch-api/resources/providers.rbi rename to rbi/lib/finch_api/resources/providers.rbi index f8e8922a..ca7c6572 100644 --- a/rbi/lib/finch-api/resources/providers.rbi +++ b/rbi/lib/finch_api/resources/providers.rbi @@ -5,12 +5,13 @@ module FinchAPI class Providers # Return details on all available payroll and HR systems. sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) - .returns(FinchAPI::SinglePage[FinchAPI::Models::Provider]) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) + .returns(FinchAPI::Internal::SinglePage[FinchAPI::Models::Provider]) end def list(request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/request_forwarding.rbi b/rbi/lib/finch_api/resources/request_forwarding.rbi similarity index 97% rename from rbi/lib/finch-api/resources/request_forwarding.rbi rename to rbi/lib/finch_api/resources/request_forwarding.rbi index 80e9893d..9d4c432d 100644 --- a/rbi/lib/finch-api/resources/request_forwarding.rbi +++ b/rbi/lib/finch_api/resources/request_forwarding.rbi @@ -14,7 +14,7 @@ module FinchAPI data: T.nilable(String), headers: T.nilable(T.anything), params: T.nilable(T.anything), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::RequestForwardingForwardResponse) end @@ -40,6 +40,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox.rbi b/rbi/lib/finch_api/resources/sandbox.rbi similarity index 97% rename from rbi/lib/finch-api/resources/sandbox.rbi rename to rbi/lib/finch_api/resources/sandbox.rbi index 794ac209..4d3407f7 100644 --- a/rbi/lib/finch-api/resources/sandbox.rbi +++ b/rbi/lib/finch_api/resources/sandbox.rbi @@ -24,6 +24,7 @@ module FinchAPI sig { returns(FinchAPI::Resources::Sandbox::Jobs) } attr_reader :jobs + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/company.rbi b/rbi/lib/finch_api/resources/sandbox/company.rbi similarity index 85% rename from rbi/lib/finch-api/resources/sandbox/company.rbi rename to rbi/lib/finch_api/resources/sandbox/company.rbi index 779911d1..2cf35f82 100644 --- a/rbi/lib/finch-api/resources/sandbox/company.rbi +++ b/rbi/lib/finch_api/resources/sandbox/company.rbi @@ -8,18 +8,18 @@ module FinchAPI sig do params( accounts: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account, FinchAPI::Internal::AnyHash)] ), departments: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, FinchAPI::Util::AnyHash))] + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, FinchAPI::Internal::AnyHash))] ), ein: T.nilable(String), - entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Util::AnyHash)), + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Internal::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::CompanyUpdateResponse) end @@ -43,6 +43,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/connections.rbi b/rbi/lib/finch_api/resources/sandbox/connections.rbi similarity index 95% rename from rbi/lib/finch-api/resources/sandbox/connections.rbi rename to rbi/lib/finch_api/resources/sandbox/connections.rbi index 0f6fcb32..ab0edade 100644 --- a/rbi/lib/finch-api/resources/sandbox/connections.rbi +++ b/rbi/lib/finch_api/resources/sandbox/connections.rbi @@ -14,7 +14,7 @@ module FinchAPI authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol, employee_size: Integer, products: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::ConnectionCreateResponse) end @@ -31,6 +31,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi b/rbi/lib/finch_api/resources/sandbox/connections/accounts.rbi similarity index 94% rename from rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi rename to rbi/lib/finch_api/resources/sandbox/connections/accounts.rbi index b9c04168..35047ebc 100644 --- a/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi +++ b/rbi/lib/finch_api/resources/sandbox/connections/accounts.rbi @@ -12,7 +12,7 @@ module FinchAPI provider_id: String, authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol, products: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::Connections::AccountCreateResponse) end @@ -33,13 +33,14 @@ module FinchAPI sig do params( connection_status: FinchAPI::Models::ConnectionStatusType::OrSymbol, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse) end def update(connection_status: nil, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/directory.rbi b/rbi/lib/finch_api/resources/sandbox/directory.rbi similarity index 86% rename from rbi/lib/finch-api/resources/sandbox/directory.rbi rename to rbi/lib/finch_api/resources/sandbox/directory.rbi index 03bae430..8c95414b 100644 --- a/rbi/lib/finch-api/resources/sandbox/directory.rbi +++ b/rbi/lib/finch_api/resources/sandbox/directory.rbi @@ -7,8 +7,8 @@ module FinchAPI # Add new individuals to a sandbox company sig do params( - body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Util::AnyHash)], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Internal::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(T::Array[T.anything]) end @@ -20,6 +20,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/employment.rbi b/rbi/lib/finch_api/resources/sandbox/employment.rbi similarity index 82% rename from rbi/lib/finch-api/resources/sandbox/employment.rbi rename to rbi/lib/finch_api/resources/sandbox/employment.rbi index 9c5dffb0..83e927b9 100644 --- a/rbi/lib/finch-api/resources/sandbox/employment.rbi +++ b/rbi/lib/finch_api/resources/sandbox/employment.rbi @@ -9,24 +9,28 @@ module FinchAPI params( individual_id: String, class_code: T.nilable(String), - 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)), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Internal::AnyHash)], + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Internal::AnyHash) + ), + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Internal::AnyHash) + ), employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::OrSymbol), end_date: T.nilable(String), first_name: T.nilable(String), - 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))]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Internal::AnyHash))]), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), - location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), - manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Util::AnyHash)), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Internal::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, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::EmploymentUpdateResponse) end @@ -72,6 +76,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/individual.rbi b/rbi/lib/finch_api/resources/sandbox/individual.rbi similarity index 87% rename from rbi/lib/finch-api/resources/sandbox/individual.rbi rename to rbi/lib/finch_api/resources/sandbox/individual.rbi index b5e76f3f..83c2ba4f 100644 --- a/rbi/lib/finch-api/resources/sandbox/individual.rbi +++ b/rbi/lib/finch_api/resources/sandbox/individual.rbi @@ -10,7 +10,7 @@ module FinchAPI individual_id: String, dob: T.nilable(String), emails: T.nilable( - T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email, FinchAPI::Util::AnyHash)] + T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email, FinchAPI::Internal::AnyHash)] ), encrypted_ssn: T.nilable(String), ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::OrSymbol), @@ -19,12 +19,16 @@ module FinchAPI last_name: T.nilable(String), middle_name: T.nilable(String), phone_numbers: T.nilable( - T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, FinchAPI::Util::AnyHash))] + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, FinchAPI::Internal::AnyHash) + ) + ] ), preferred_name: T.nilable(String), - residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Internal::AnyHash)), ssn: T.nilable(String), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::IndividualUpdateResponse) end @@ -59,6 +63,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/jobs.rbi b/rbi/lib/finch_api/resources/sandbox/jobs.rbi similarity index 93% rename from rbi/lib/finch-api/resources/sandbox/jobs.rbi rename to rbi/lib/finch_api/resources/sandbox/jobs.rbi index 063921b6..aecb8ea4 100644 --- a/rbi/lib/finch-api/resources/sandbox/jobs.rbi +++ b/rbi/lib/finch_api/resources/sandbox/jobs.rbi @@ -11,7 +11,7 @@ module FinchAPI sig do params( type: FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::JobCreateResponse) end @@ -22,6 +22,7 @@ module FinchAPI ) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi b/rbi/lib/finch_api/resources/sandbox/jobs/configuration.rbi similarity index 91% rename from rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi rename to rbi/lib/finch_api/resources/sandbox/jobs/configuration.rbi index 627d34aa..2f9c9e99 100644 --- a/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi +++ b/rbi/lib/finch_api/resources/sandbox/jobs/configuration.rbi @@ -7,7 +7,7 @@ module FinchAPI class Configuration # Get configurations for sandbox jobs sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash))) .returns(T::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration]) end def retrieve(request_options: {}) @@ -18,13 +18,14 @@ module FinchAPI params( 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)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration) end def update(completion_status:, type:, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/sandbox/payment.rbi b/rbi/lib/finch_api/resources/sandbox/payment.rbi similarity index 84% rename from rbi/lib/finch-api/resources/sandbox/payment.rbi rename to rbi/lib/finch_api/resources/sandbox/payment.rbi index e9f1e1be..d68baff2 100644 --- a/rbi/lib/finch-api/resources/sandbox/payment.rbi +++ b/rbi/lib/finch_api/resources/sandbox/payment.rbi @@ -8,15 +8,16 @@ module FinchAPI sig do params( end_date: String, - pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Util::AnyHash)], + pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Internal::AnyHash)], start_date: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Internal::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::PaymentCreateResponse) end def create(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}) end + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch-api/resources/webhooks.rbi b/rbi/lib/finch_api/resources/webhooks.rbi similarity index 90% rename from rbi/lib/finch-api/resources/webhooks.rbi rename to rbi/lib/finch_api/resources/webhooks.rbi index f2ba07c8..10670e8d 100644 --- a/rbi/lib/finch-api/resources/webhooks.rbi +++ b/rbi/lib/finch_api/resources/webhooks.rbi @@ -3,6 +3,7 @@ module FinchAPI module Resources class Webhooks + # @api private sig { params(client: FinchAPI::Client).returns(T.attached_class) } def self.new(client:) end diff --git a/rbi/lib/finch_api/version.rbi b/rbi/lib/finch_api/version.rbi new file mode 100644 index 00000000..483d025b --- /dev/null +++ b/rbi/lib/finch_api/version.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module FinchAPI + VERSION = T.let(T.unsafe(nil), String) +end diff --git a/release-please-config.json b/release-please-config.json index e8b8e8c3..0ce29b83 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -64,5 +64,5 @@ "minupalaniappan" ], "release-type": "ruby", - "version-file": "lib/finch-api/version.rb" + "version-file": "lib/finch_api/version.rb" } \ No newline at end of file diff --git a/sig/finch-api/errors.rbs b/sig/finch-api/errors.rbs deleted file mode 100644 index 41e363d8..00000000 --- a/sig/finch-api/errors.rbs +++ /dev/null @@ -1,99 +0,0 @@ -module FinchAPI - class Error < StandardError - attr_accessor cause: StandardError? - end - - class ConversionError < FinchAPI::Error - end - - class APIError < FinchAPI::Error - attr_accessor url: URI::Generic - - attr_accessor status: Integer? - - attr_accessor body: top? - - def initialize: ( - url: URI::Generic, - ?status: Integer?, - ?body: Object?, - ?request: nil, - ?response: nil, - ?message: String? - ) -> void - end - - class APIConnectionError < FinchAPI::APIError - def initialize: ( - url: URI::Generic, - ?status: nil, - ?body: nil, - ?request: nil, - ?response: nil, - ?message: String? - ) -> void - end - - class APITimeoutError < FinchAPI::APIConnectionError - def initialize: ( - url: URI::Generic, - ?status: nil, - ?body: nil, - ?request: nil, - ?response: nil, - ?message: String? - ) -> void - end - - class APIStatusError < FinchAPI::APIError - def self.for: ( - url: URI::Generic, - status: Integer, - body: Object?, - request: nil, - response: nil, - ?message: String? - ) -> instance - - def initialize: ( - url: URI::Generic, - status: Integer, - body: Object?, - request: nil, - response: nil, - ?message: String? - ) -> void - end - - class BadRequestError < FinchAPI::APIStatusError - HTTP_STATUS: 400 - end - - class AuthenticationError < FinchAPI::APIStatusError - HTTP_STATUS: 401 - end - - class PermissionDeniedError < FinchAPI::APIStatusError - HTTP_STATUS: 403 - end - - class NotFoundError < FinchAPI::APIStatusError - HTTP_STATUS: 404 - end - - class ConflictError < FinchAPI::APIStatusError - HTTP_STATUS: 409 - end - - class UnprocessableEntityError < FinchAPI::APIStatusError - HTTP_STATUS: 422 - end - - class RateLimitError < FinchAPI::APIStatusError - HTTP_STATUS: 429 - end - - class InternalServerError < FinchAPI::APIStatusError - HTTP_STATUS: Range[Integer] - end -end diff --git a/sig/finch-api/individuals_page.rbs b/sig/finch-api/individuals_page.rbs deleted file mode 100644 index d502c158..00000000 --- a/sig/finch-api/individuals_page.rbs +++ /dev/null @@ -1,11 +0,0 @@ -module FinchAPI - class IndividualsPage[Elem] - include FinchAPI::Type::BasePage[Elem] - - attr_accessor individuals: ::Array[Elem]? - - attr_accessor paging: FinchAPI::Models::Paging - - def inspect: -> String - end -end diff --git a/sig/finch-api/models/account_disconnect_params.rbs b/sig/finch-api/models/account_disconnect_params.rbs deleted file mode 100644 index cb31e96a..00000000 --- a/sig/finch-api/models/account_disconnect_params.rbs +++ /dev/null @@ -1,14 +0,0 @@ -module FinchAPI - module Models - type account_disconnect_params = { } & FinchAPI::request_parameters - - class AccountDisconnectParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::account_disconnect_params - end - end -end diff --git a/sig/finch-api/models/account_introspect_params.rbs b/sig/finch-api/models/account_introspect_params.rbs deleted file mode 100644 index c416ef48..00000000 --- a/sig/finch-api/models/account_introspect_params.rbs +++ /dev/null @@ -1,14 +0,0 @@ -module FinchAPI - module Models - type account_introspect_params = { } & FinchAPI::request_parameters - - class AccountIntrospectParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::account_introspect_params - 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 deleted file mode 100644 index fea74e89..00000000 --- a/sig/finch-api/models/hris/benefit_list_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module HRIS - type benefit_list_params = { } & FinchAPI::request_parameters - - class BenefitListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::HRIS::benefit_list_params - end - end - end -end diff --git a/sig/finch-api/models/hris/benefit_retrieve_params.rbs b/sig/finch-api/models/hris/benefit_retrieve_params.rbs deleted file mode 100644 index e272124d..00000000 --- a/sig/finch-api/models/hris/benefit_retrieve_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module HRIS - type benefit_retrieve_params = { } & FinchAPI::request_parameters - - class BenefitRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::HRIS::benefit_retrieve_params - end - end - end -end diff --git a/sig/finch-api/models/hris/company_retrieve_params.rbs b/sig/finch-api/models/hris/company_retrieve_params.rbs deleted file mode 100644 index a3e5e530..00000000 --- a/sig/finch-api/models/hris/company_retrieve_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module HRIS - type company_retrieve_params = { } & FinchAPI::request_parameters - - class CompanyRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::HRIS::company_retrieve_params - end - end - end -end diff --git a/sig/finch-api/models/hris/document_retreive_params.rbs b/sig/finch-api/models/hris/document_retreive_params.rbs deleted file mode 100644 index db25c975..00000000 --- a/sig/finch-api/models/hris/document_retreive_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module HRIS - type document_retreive_params = { } & FinchAPI::request_parameters - - class DocumentRetreiveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::HRIS::document_retreive_params - end - end - end -end diff --git a/sig/finch-api/models/jobs/automated_retrieve_params.rbs b/sig/finch-api/models/jobs/automated_retrieve_params.rbs deleted file mode 100644 index 7b77da80..00000000 --- a/sig/finch-api/models/jobs/automated_retrieve_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module Jobs - type automated_retrieve_params = { } & FinchAPI::request_parameters - - class AutomatedRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::Jobs::automated_retrieve_params - end - end - end -end diff --git a/sig/finch-api/models/jobs/manual_retrieve_params.rbs b/sig/finch-api/models/jobs/manual_retrieve_params.rbs deleted file mode 100644 index 7345a80e..00000000 --- a/sig/finch-api/models/jobs/manual_retrieve_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module Jobs - type manual_retrieve_params = { } & FinchAPI::request_parameters - - class ManualRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::Jobs::manual_retrieve_params - end - end - end -end diff --git a/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs b/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs deleted file mode 100644 index 83d5df24..00000000 --- a/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module FinchAPI - module Models - module Payroll - type pay_group_retrieve_params = { } & FinchAPI::request_parameters - - class PayGroupRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::Payroll::pay_group_retrieve_params - end - end - end -end diff --git a/sig/finch-api/models/provider_list_params.rbs b/sig/finch-api/models/provider_list_params.rbs deleted file mode 100644 index 6482e7b3..00000000 --- a/sig/finch-api/models/provider_list_params.rbs +++ /dev/null @@ -1,14 +0,0 @@ -module FinchAPI - module Models - type provider_list_params = { } & FinchAPI::request_parameters - - class ProviderListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::provider_list_params - end - end -end diff --git a/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs b/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs deleted file mode 100644 index 37202037..00000000 --- a/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs +++ /dev/null @@ -1,18 +0,0 @@ -module FinchAPI - module Models - module Sandbox - module Jobs - type configuration_retrieve_params = { } & FinchAPI::request_parameters - - class ConfigurationRetrieveParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters - - def initialize: (?request_options: FinchAPI::request_opts) -> void - - def to_hash: -> FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_params - end - end - end - end -end diff --git a/sig/finch-api/page.rbs b/sig/finch-api/page.rbs deleted file mode 100644 index f348aa7a..00000000 --- a/sig/finch-api/page.rbs +++ /dev/null @@ -1,11 +0,0 @@ -module FinchAPI - class Page[Elem] - include FinchAPI::Type::BasePage[Elem] - - attr_accessor data: ::Array[Elem]? - - attr_accessor paging: FinchAPI::Models::Paging - - def inspect: -> String - end -end diff --git a/sig/finch-api/responses_page.rbs b/sig/finch-api/responses_page.rbs deleted file mode 100644 index 795c5990..00000000 --- a/sig/finch-api/responses_page.rbs +++ /dev/null @@ -1,9 +0,0 @@ -module FinchAPI - class ResponsesPage[Elem] - include FinchAPI::Type::BasePage[Elem] - - attr_accessor responses: ::Array[Elem]? - - def inspect: -> String - end -end diff --git a/sig/finch-api/single_page.rbs b/sig/finch-api/single_page.rbs deleted file mode 100644 index 725f0f65..00000000 --- a/sig/finch-api/single_page.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module FinchAPI - class SinglePage[Elem] < ::Array[Elem] - include FinchAPI::Type::BasePage[Elem] - - 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/transport/base_client.rbs b/sig/finch-api/transport/base_client.rbs deleted file mode 100644 index e13de591..00000000 --- a/sig/finch-api/transport/base_client.rbs +++ /dev/null @@ -1,110 +0,0 @@ -module FinchAPI - module Transport - class BaseClient - type request_components = - { - method: Symbol, - path: String | ::Array[String], - query: ::Hash[String, (::Array[String] | String)?]?, - headers: ::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?]?, - body: top?, - unwrap: Symbol?, - page: Class?, - stream: Class?, - model: FinchAPI::Type::Converter::input?, - options: FinchAPI::request_opts? - } - - type request_input = - { - method: Symbol, - url: URI::Generic, - headers: ::Hash[String, String], - body: top, - max_retries: Integer, - timeout: Float - } - - MAX_REDIRECTS: 20 - - PLATFORM_HEADERS: ::Hash[String, String] - - def self.validate!: ( - FinchAPI::Transport::BaseClient::request_components req - ) -> void - - def self.should_retry?: ( - Integer status, - headers: ::Hash[String, String] - ) -> bool - - def self.follow_redirect: ( - FinchAPI::Transport::BaseClient::request_input request, - status: Integer, - response_headers: ::Hash[String, String] - ) -> FinchAPI::Transport::BaseClient::request_input - - def self.reap_connection!: ( - Integer | FinchAPI::APIConnectionError status, - stream: Enumerable[String]? - ) -> void - - # @api private - attr_accessor requester: FinchAPI::Transport::PooledNetRequester - - def initialize: ( - base_url: String, - ?timeout: Float, - ?max_retries: Integer, - ?initial_retry_delay: Float, - ?max_retry_delay: Float, - ?headers: ::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?], - ?idempotency_header: String? - ) -> void - - private def auth_headers: -> ::Hash[String, String] - - private def generate_idempotency_key: -> String - - private def build_request: ( - FinchAPI::Transport::BaseClient::request_components req, - FinchAPI::request_options opts - ) -> FinchAPI::Transport::BaseClient::request_input - - private def retry_delay: ( - ::Hash[String, String] headers, - retry_count: Integer - ) -> Float - - private def send_request: ( - FinchAPI::Transport::BaseClient::request_input request, - redirect_count: Integer, - retry_count: Integer, - send_retry_header: bool - ) -> [Integer, top, Enumerable[String]] - - def request: - ( - Symbol method, - String | ::Array[String] path, - ?query: ::Hash[String, (::Array[String] | String)?]?, - ?headers: ::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?]?, - ?body: top?, - ?unwrap: Symbol?, - ?page: Class?, - ?stream: Class?, - ?model: FinchAPI::Type::Converter::input?, - ?options: FinchAPI::request_opts? - ) -> top - | (FinchAPI::Transport::BaseClient::request_components req) -> top - - def inspect: -> String - end - end -end diff --git a/sig/finch-api/transport/pooled_net_requester.rbs b/sig/finch-api/transport/pooled_net_requester.rbs deleted file mode 100644 index 5e0d0f56..00000000 --- a/sig/finch-api/transport/pooled_net_requester.rbs +++ /dev/null @@ -1,39 +0,0 @@ -module FinchAPI - module Transport - class PooledNetRequester - type request = - { - method: Symbol, - url: URI::Generic, - headers: ::Hash[String, String], - body: top, - 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::Transport::PooledNetRequester::request request - ) { - (String arg0) -> void - } -> top - - private def with_pool: ( - URI::Generic url, - deadline: Float - ) { - (top arg0) -> void - } -> void - - def execute: ( - FinchAPI::Transport::PooledNetRequester::request request - ) -> [Integer, top, Enumerable[String]] - - def initialize: (?size: Integer) -> void - end - end -end diff --git a/sig/finch-api/type.rbs b/sig/finch-api/type.rbs deleted file mode 100644 index 6f2d3043..00000000 --- a/sig/finch-api/type.rbs +++ /dev/null @@ -1,22 +0,0 @@ -module FinchAPI - class Unknown = FinchAPI::Type::Unknown - - class BooleanModel = FinchAPI::Type::BooleanModel - - module Enum = FinchAPI::Type::Enum - - module Union = FinchAPI::Type::Union - - class ArrayOf = FinchAPI::Type::ArrayOf - - class HashOf = FinchAPI::Type::HashOf - - class BaseModel = FinchAPI::Type::BaseModel - - type request_parameters = FinchAPI::Type::request_parameters - - module RequestParameters = FinchAPI::Type::RequestParameters - - module Type - end -end diff --git a/sig/finch-api/type/array_of.rbs b/sig/finch-api/type/array_of.rbs deleted file mode 100644 index f6f7f49e..00000000 --- a/sig/finch-api/type/array_of.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module FinchAPI - module Type - class ArrayOf[Elem] - include FinchAPI::Type::Converter - - def self.[]: ( - ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> instance - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def coerce: ( - Enumerable[Elem] | top value, - state: FinchAPI::Type::Converter::state - ) -> (::Array[top] | top) - - def dump: (Enumerable[Elem] | top value) -> (::Array[top] | top) - - def item_type: -> Elem - - def nilable?: -> bool - - def initialize: ( - ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - end - end -end diff --git a/sig/finch-api/type/base_model.rbs b/sig/finch-api/type/base_model.rbs deleted file mode 100644 index 843c3a9e..00000000 --- a/sig/finch-api/type/base_model.rbs +++ /dev/null @@ -1,73 +0,0 @@ -module FinchAPI - module Type - class BaseModel - extend FinchAPI::Type::Converter - - type known_field = - { mode: (:coerce | :dump)?, required: bool, nilable: bool } - - def self.known_fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field - & { type_fn: (^-> FinchAPI::Type::Converter::input) })] - - def self.fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field - & { type: FinchAPI::Type::Converter::input })] - - private def self.add_field: ( - Symbol name_sym, - required: bool, - type_info: { - const: (nil | bool | Integer | Float | Symbol)?, - enum: ^-> FinchAPI::Type::Converter::input?, - union: ^-> FinchAPI::Type::Converter::input?, - api_name: Symbol - } - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input, - spec: ::Hash[Symbol, top] - ) -> void - - def self.required: ( - Symbol name_sym, - ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - - def self.optional: ( - Symbol name_sym, - ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - - private def self.request_only: { -> void } -> void - - private def self.response_only: { -> void } -> void - - def self.==: (top other) -> bool - - def ==: (top other) -> bool - - def self.coerce: ( - FinchAPI::BaseModel | ::Hash[top, top] | top value, - state: FinchAPI::Type::Converter::state - ) -> (instance | top) - - def self.dump: (instance | top value) -> (::Hash[top, top] | top) - - def []: (Symbol key) -> top? - - def to_h: -> ::Hash[Symbol, top] - - alias to_hash to_h - - def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] - - def initialize: (?::Hash[Symbol, top] | self data) -> void - - def inspect: -> String - end - end -end diff --git a/sig/finch-api/type/base_page.rbs b/sig/finch-api/type/base_page.rbs deleted file mode 100644 index b7255d76..00000000 --- a/sig/finch-api/type/base_page.rbs +++ /dev/null @@ -1,22 +0,0 @@ -module FinchAPI - module Type - module BasePage[Elem] - def next_page?: -> bool - - def next_page: -> self - - def auto_paging_each: { (Elem arg0) -> void } -> void - - def to_enum: -> Enumerable[Elem] - - alias enum_for to_enum - - def initialize: ( - client: FinchAPI::Transport::BaseClient, - req: FinchAPI::Transport::BaseClient::request_components, - headers: ::Hash[String, String], - page_data: top - ) -> void - end - end -end diff --git a/sig/finch-api/type/boolean_model.rbs b/sig/finch-api/type/boolean_model.rbs deleted file mode 100644 index 48a057ca..00000000 --- a/sig/finch-api/type/boolean_model.rbs +++ /dev/null @@ -1,18 +0,0 @@ -module FinchAPI - module Type - class BooleanModel - extend FinchAPI::Type::Converter - - def self.===: (top other) -> bool - - def self.==: (top other) -> bool - - def self.coerce: ( - bool | top value, - state: FinchAPI::Type::Converter::state - ) -> (bool | top) - - def self.dump: (bool | top value) -> (bool | top) - end - end -end diff --git a/sig/finch-api/type/converter.rbs b/sig/finch-api/type/converter.rbs deleted file mode 100644 index 3f38009e..00000000 --- a/sig/finch-api/type/converter.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module FinchAPI - module Type - module Converter - type input = FinchAPI::Type::Converter | Class - - type state = - { - strictness: bool | :strong, - exactness: { yes: Integer, no: Integer, maybe: Integer }, - branched: Integer - } - - def coerce: (top value, state: FinchAPI::Type::Converter::state) -> top - - def dump: (top value) -> top - - def self.type_info: ( - { - const: (nil | bool | Integer | Float | Symbol)?, - enum: ^-> FinchAPI::Type::Converter::input?, - union: ^-> FinchAPI::Type::Converter::input? - } - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input spec - ) -> (^-> top) - - def self.coerce: ( - FinchAPI::Type::Converter::input target, - top value, - ?state: FinchAPI::Type::Converter::state - ) -> top - - def self.dump: (FinchAPI::Type::Converter::input target, top value) -> top - end - end -end diff --git a/sig/finch-api/type/enum.rbs b/sig/finch-api/type/enum.rbs deleted file mode 100644 index 2a0ad02a..00000000 --- a/sig/finch-api/type/enum.rbs +++ /dev/null @@ -1,22 +0,0 @@ -module FinchAPI - module Type - module Enum - include FinchAPI::Type::Converter - - def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] - - private def self.finalize!: -> void - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def coerce: ( - String | Symbol | top value, - state: FinchAPI::Type::Converter::state - ) -> (Symbol | top) - - def dump: (Symbol | top value) -> (Symbol | top) - end - end -end diff --git a/sig/finch-api/type/hash_of.rbs b/sig/finch-api/type/hash_of.rbs deleted file mode 100644 index 8cc3ddf7..00000000 --- a/sig/finch-api/type/hash_of.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module FinchAPI - module Type - class HashOf[Elem] - include FinchAPI::Type::Converter - - def self.[]: ( - ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> instance - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def coerce: ( - ::Hash[top, top] | top value, - state: FinchAPI::Type::Converter::state - ) -> (::Hash[Symbol, top] | top) - - def dump: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top) - - def item_type: -> Elem - - def nilable?: -> bool - - def initialize: ( - ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - end - end -end diff --git a/sig/finch-api/type/request_parameters.rbs b/sig/finch-api/type/request_parameters.rbs deleted file mode 100644 index 7e31ff42..00000000 --- a/sig/finch-api/type/request_parameters.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module FinchAPI - module Type - type request_parameters = { request_options: FinchAPI::request_opts } - - module RequestParameters - attr_accessor request_options: FinchAPI::request_opts - - module Converter - def dump_request: (top params) -> [top, ::Hash[Symbol, top]] - end - end - end -end diff --git a/sig/finch-api/type/union.rbs b/sig/finch-api/type/union.rbs deleted file mode 100644 index d5068f93..00000000 --- a/sig/finch-api/type/union.rbs +++ /dev/null @@ -1,37 +0,0 @@ -module FinchAPI - module Type - module Union - include FinchAPI::Type::Converter - - private def self.known_variants: -> ::Array[[Symbol?, (^-> FinchAPI::Type::Converter::input)]] - - def self.derefed_variants: -> ::Array[[Symbol?, top]] - - def self.variants: -> ::Array[top] - - private def self.discriminator: (Symbol property) -> void - - private def self.variant: ( - Symbol - | ::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input key, - ?::Hash[Symbol, top] - | ^-> FinchAPI::Type::Converter::input - | FinchAPI::Type::Converter::input spec - ) -> void - - private def self.resolve_variant: ( - top value - ) -> FinchAPI::Type::Converter::input? - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def coerce: (top value, state: FinchAPI::Type::Converter::state) -> top - - def dump: (top value) -> top - end - end -end diff --git a/sig/finch-api/type/unknown.rbs b/sig/finch-api/type/unknown.rbs deleted file mode 100644 index ae98c008..00000000 --- a/sig/finch-api/type/unknown.rbs +++ /dev/null @@ -1,18 +0,0 @@ -module FinchAPI - module Type - class Unknown - extend FinchAPI::Type::Converter - - def self.===: (top other) -> bool - - def self.==: (top other) -> bool - - def self.coerce: ( - top value, - state: FinchAPI::Type::Converter::state - ) -> top - - def self.dump: (top value) -> top - end - end -end diff --git a/sig/finch-api/util.rbs b/sig/finch-api/util.rbs deleted file mode 100644 index 26b7fe56..00000000 --- a/sig/finch-api/util.rbs +++ /dev/null @@ -1,134 +0,0 @@ -module FinchAPI - module Util - def self?.monotonic_secs: -> Float - - def self?.arch: -> String - - def self?.os: -> String - - def self?.primitive?: (top input) -> bool - - def self?.coerce_boolean: (top input) -> (bool | top) - - def self?.coerce_boolean!: (top input) -> bool? - - def self?.coerce_integer: (top input) -> (Integer | top) - - def self?.coerce_float: (top input) -> (Float | top) - - def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) - - OMIT: top - - def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top - - def self?.deep_merge: ( - *::Array[top] values, - ?sentinel: top?, - ?concat: bool - ) -> top - - def self?.dig: ( - ::Hash[Symbol, top] | ::Array[top] | top data, - (Symbol | Integer | ::Array[(Symbol | Integer)])? pick, - ?top? sentinel - ) { - -> top? - } -> top? - - def self?.uri_origin: (URI::Generic uri) -> String - - def self?.interpolate_path: (String | ::Array[String] path) -> String - - def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] - - def self?.encode_query: ( - ::Hash[String, (::Array[String] | String)?]? query - ) -> String? - - type parsed_uri = - { - scheme: String?, - host: String?, - port: Integer?, - path: String?, - query: ::Hash[String, ::Array[String]] - } - - def self?.parse_uri: ( - URI::Generic | String url - ) -> FinchAPI::Util::parsed_uri - - def self?.unparse_uri: (FinchAPI::Util::parsed_uri parsed) -> URI::Generic - - def self?.join_parsed_uri: ( - FinchAPI::Util::parsed_uri lhs, - FinchAPI::Util::parsed_uri rhs - ) -> URI::Generic - - def self?.normalized_headers: ( - *::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?] headers - ) -> ::Hash[String, String] - - 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: ( - 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 - ) -> top - - def self?.fused_enum: ( - Enumerable[top] enum, - ?external: bool - ) { - -> void - } -> Enumerable[top] - - def self?.close_fused!: (Enumerable[top]? enum) -> void - - def self?.chain_fused: ( - Enumerable[top]? enum - ) { - (Enumerator::Yielder arg0) -> void - } -> Enumerable[top] - - type server_sent_event = - { event: String?, data: String?, id: String?, retry: Integer? } - - def self?.decode_lines: (Enumerable[String] enum) -> Enumerable[String] - - def self?.decode_sse: ( - Enumerable[String] lines - ) -> FinchAPI::Util::server_sent_event - end -end diff --git a/sig/finch-api/version.rbs b/sig/finch-api/version.rbs deleted file mode 100644 index d9d5fcd3..00000000 --- a/sig/finch-api/version.rbs +++ /dev/null @@ -1,3 +0,0 @@ -module FinchAPI - VERSION: "0.1.0-alpha.4" -end diff --git a/sig/finch-api/client.rbs b/sig/finch_api/client.rbs similarity index 95% rename from sig/finch-api/client.rbs rename to sig/finch_api/client.rbs index 113c7f68..f7350df8 100644 --- a/sig/finch-api/client.rbs +++ b/sig/finch_api/client.rbs @@ -1,5 +1,5 @@ module FinchAPI - class Client < FinchAPI::Transport::BaseClient + class Client < FinchAPI::Internal::Transport::BaseClient DEFAULT_MAX_RETRIES: 2 DEFAULT_TIMEOUT_IN_SECONDS: Float @@ -41,10 +41,10 @@ module FinchAPI private def basic_auth: -> ::Hash[String, String] def initialize: ( - ?base_url: String?, - ?access_token: String?, ?client_id: String?, ?client_secret: String?, + ?access_token: String?, + ?base_url: String?, ?max_retries: Integer, ?timeout: Float, ?initial_retry_delay: Float, diff --git a/sig/finch_api/errors.rbs b/sig/finch_api/errors.rbs new file mode 100644 index 00000000..c15a87cd --- /dev/null +++ b/sig/finch_api/errors.rbs @@ -0,0 +1,101 @@ +module FinchAPI + module Errors + class Error < StandardError + attr_accessor cause: StandardError? + end + + class ConversionError < FinchAPI::Errors::Error + end + + class APIError < FinchAPI::Errors::Error + attr_accessor url: URI::Generic + + attr_accessor status: Integer? + + attr_accessor body: top? + + def initialize: ( + url: URI::Generic, + ?status: Integer?, + ?body: Object?, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APIConnectionError < FinchAPI::Errors::APIError + def initialize: ( + url: URI::Generic, + ?status: nil, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APITimeoutError < FinchAPI::Errors::APIConnectionError + def initialize: ( + url: URI::Generic, + ?status: nil, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APIStatusError < FinchAPI::Errors::APIError + def self.for: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + ?message: String? + ) -> instance + + def initialize: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + ?message: String? + ) -> void + end + + class BadRequestError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 400 + end + + class AuthenticationError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 401 + end + + class PermissionDeniedError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 403 + end + + class NotFoundError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 404 + end + + class ConflictError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 409 + end + + class UnprocessableEntityError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 422 + end + + class RateLimitError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: 429 + end + + class InternalServerError < FinchAPI::Errors::APIStatusError + HTTP_STATUS: Range[Integer] + end + end +end diff --git a/sig/finch_api/internal.rbs b/sig/finch_api/internal.rbs new file mode 100644 index 00000000..65178856 --- /dev/null +++ b/sig/finch_api/internal.rbs @@ -0,0 +1,5 @@ +module FinchAPI + module Internal + OMIT: top + end +end diff --git a/sig/finch_api/internal/individuals_page.rbs b/sig/finch_api/internal/individuals_page.rbs new file mode 100644 index 00000000..77b6be1b --- /dev/null +++ b/sig/finch_api/internal/individuals_page.rbs @@ -0,0 +1,13 @@ +module FinchAPI + module Internal + class IndividualsPage[Elem] + include FinchAPI::Internal::Type::BasePage[Elem] + + attr_accessor individuals: ::Array[Elem]? + + attr_accessor paging: FinchAPI::Models::Paging + + def inspect: -> String + end + end +end diff --git a/sig/finch_api/internal/page.rbs b/sig/finch_api/internal/page.rbs new file mode 100644 index 00000000..0593bdf7 --- /dev/null +++ b/sig/finch_api/internal/page.rbs @@ -0,0 +1,13 @@ +module FinchAPI + module Internal + class Page[Elem] + include FinchAPI::Internal::Type::BasePage[Elem] + + attr_accessor data: ::Array[Elem]? + + attr_accessor paging: FinchAPI::Models::Paging + + def inspect: -> String + end + end +end diff --git a/sig/finch_api/internal/responses_page.rbs b/sig/finch_api/internal/responses_page.rbs new file mode 100644 index 00000000..48db1130 --- /dev/null +++ b/sig/finch_api/internal/responses_page.rbs @@ -0,0 +1,11 @@ +module FinchAPI + module Internal + class ResponsesPage[Elem] + include FinchAPI::Internal::Type::BasePage[Elem] + + attr_accessor responses: ::Array[Elem]? + + def inspect: -> String + end + end +end diff --git a/sig/finch_api/internal/single_page.rbs b/sig/finch_api/internal/single_page.rbs new file mode 100644 index 00000000..d3a79153 --- /dev/null +++ b/sig/finch_api/internal/single_page.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Internal + class SinglePage[Elem] < ::Array[Elem] + include FinchAPI::Internal::Type::BasePage[Elem] + + def next_page?: -> bool + + def next_page: -> self + + def auto_paging_each: { (Elem arg0) -> void } -> void + + def inspect: -> String + end + end +end diff --git a/sig/finch_api/internal/transport/base_client.rbs b/sig/finch_api/internal/transport/base_client.rbs new file mode 100644 index 00000000..78f5718c --- /dev/null +++ b/sig/finch_api/internal/transport/base_client.rbs @@ -0,0 +1,110 @@ +module FinchAPI + module Internal + module Transport + class BaseClient + type request_components = + { + method: Symbol, + path: String | ::Array[String], + query: ::Hash[String, (::Array[String] | String)?]?, + headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + body: top?, + unwrap: Symbol?, + page: Class?, + stream: Class?, + model: FinchAPI::Internal::Type::Converter::input?, + options: FinchAPI::request_opts? + } + + type request_input = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + max_retries: Integer, + timeout: Float + } + + MAX_REDIRECTS: 20 + + PLATFORM_HEADERS: ::Hash[String, String] + + def self.validate!: ( + FinchAPI::Internal::Transport::BaseClient::request_components req + ) -> void + + def self.should_retry?: ( + Integer status, + headers: ::Hash[String, String] + ) -> bool + + def self.follow_redirect: ( + FinchAPI::Internal::Transport::BaseClient::request_input request, + status: Integer, + response_headers: ::Hash[String, String] + ) -> FinchAPI::Internal::Transport::BaseClient::request_input + + def self.reap_connection!: ( + Integer | FinchAPI::Errors::APIConnectionError status, + stream: Enumerable[String]? + ) -> void + + # @api private + attr_accessor requester: FinchAPI::Internal::Transport::PooledNetRequester + + def initialize: ( + base_url: String, + ?timeout: Float, + ?max_retries: Integer, + ?initial_retry_delay: Float, + ?max_retry_delay: Float, + ?headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?], + ?idempotency_header: String? + ) -> void + + private def auth_headers: -> ::Hash[String, String] + + private def generate_idempotency_key: -> String + + private def build_request: ( + FinchAPI::Internal::Transport::BaseClient::request_components req, + FinchAPI::request_options opts + ) -> FinchAPI::Internal::Transport::BaseClient::request_input + + private def retry_delay: ( + ::Hash[String, String] headers, + retry_count: Integer + ) -> Float + + private def send_request: ( + FinchAPI::Internal::Transport::BaseClient::request_input request, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: bool + ) -> [Integer, top, Enumerable[String]] + + def request: ( + Symbol method, + String | ::Array[String] path, + ?query: ::Hash[String, (::Array[String] | String)?]?, + ?headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + ?body: top?, + ?unwrap: Symbol?, + ?page: Class?, + ?stream: Class?, + ?model: FinchAPI::Internal::Type::Converter::input?, + ?options: FinchAPI::request_opts? + ) -> top + + def inspect: -> String + end + end + end +end diff --git a/sig/finch_api/internal/transport/pooled_net_requester.rbs b/sig/finch_api/internal/transport/pooled_net_requester.rbs new file mode 100644 index 00000000..ac8b0512 --- /dev/null +++ b/sig/finch_api/internal/transport/pooled_net_requester.rbs @@ -0,0 +1,41 @@ +module FinchAPI + module Internal + module Transport + class PooledNetRequester + type request = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + 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::Internal::Transport::PooledNetRequester::request request + ) { + (String arg0) -> void + } -> top + + private def with_pool: ( + URI::Generic url, + deadline: Float + ) { + (top arg0) -> void + } -> void + + def execute: ( + FinchAPI::Internal::Transport::PooledNetRequester::request request + ) -> [Integer, top, Enumerable[String]] + + def initialize: (?size: Integer) -> void + end + end + end +end diff --git a/sig/finch_api/internal/type/array_of.rbs b/sig/finch_api/internal/type/array_of.rbs new file mode 100644 index 00000000..9e62e811 --- /dev/null +++ b/sig/finch_api/internal/type/array_of.rbs @@ -0,0 +1,38 @@ +module FinchAPI + module Internal + module Type + class ArrayOf[Elem] + include FinchAPI::Internal::Type::Converter + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: ( + ::Array[top] | top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> (::Array[top] | top) + + def dump: (::Array[top] | top value) -> (::Array[top] | top) + + def item_type: -> Elem + + def nilable?: -> bool + + def initialize: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + end + end + end +end diff --git a/sig/finch_api/internal/type/base_model.rbs b/sig/finch_api/internal/type/base_model.rbs new file mode 100644 index 00000000..b3782d4b --- /dev/null +++ b/sig/finch_api/internal/type/base_model.rbs @@ -0,0 +1,79 @@ +module FinchAPI + module Internal + module Type + class BaseModel + extend FinchAPI::Internal::Type::Converter + + type known_field = + { mode: (:coerce | :dump)?, required: bool, nilable: bool } + + def self.known_fields: -> ::Hash[Symbol, (FinchAPI::Internal::Type::BaseModel::known_field + & { type_fn: (^-> FinchAPI::Internal::Type::Converter::input) })] + + def self.fields: -> ::Hash[Symbol, (FinchAPI::Internal::Type::BaseModel::known_field + & { type: FinchAPI::Internal::Type::Converter::input })] + + private def self.add_field: ( + Symbol name_sym, + required: bool, + type_info: { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> FinchAPI::Internal::Type::Converter::input?, + union: ^-> FinchAPI::Internal::Type::Converter::input?, + api_name: Symbol + } + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input, + spec: ::Hash[Symbol, top] + ) -> void + + def self.required: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def self.optional: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + private def self.request_only: { -> void } -> void + + private def self.response_only: { -> void } -> void + + def self.==: (top other) -> bool + + def ==: (top other) -> bool + + def self.coerce: ( + FinchAPI::Internal::Type::BaseModel | ::Hash[top, top] | top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> (instance | top) + + def self.dump: (instance | top value) -> (::Hash[top, top] | top) + + def []: (Symbol key) -> top? + + def to_h: -> ::Hash[Symbol, top] + + alias to_hash to_h + + def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] + + def to_json: (*top a) -> String + + def to_yaml: (*top a) -> String + + def initialize: (?::Hash[Symbol, top] | self data) -> void + + def inspect: -> String + end + end + end +end diff --git a/sig/finch_api/internal/type/base_page.rbs b/sig/finch_api/internal/type/base_page.rbs new file mode 100644 index 00000000..8ac650c6 --- /dev/null +++ b/sig/finch_api/internal/type/base_page.rbs @@ -0,0 +1,24 @@ +module FinchAPI + module Internal + module Type + module BasePage[Elem] + def next_page?: -> bool + + def next_page: -> self + + def auto_paging_each: { (Elem arg0) -> void } -> void + + def to_enum: -> Enumerable[Elem] + + alias enum_for to_enum + + def initialize: ( + client: FinchAPI::Internal::Transport::BaseClient, + req: FinchAPI::Internal::Transport::BaseClient::request_components, + headers: ::Hash[String, String], + page_data: top + ) -> void + end + end + end +end diff --git a/sig/finch_api/internal/type/boolean_model.rbs b/sig/finch_api/internal/type/boolean_model.rbs new file mode 100644 index 00000000..85f7e863 --- /dev/null +++ b/sig/finch_api/internal/type/boolean_model.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Internal + module Type + class BooleanModel + extend FinchAPI::Internal::Type::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + bool | top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> (bool | top) + + def self.dump: (bool | top value) -> (bool | top) + end + end + end +end diff --git a/sig/finch_api/internal/type/converter.rbs b/sig/finch_api/internal/type/converter.rbs new file mode 100644 index 00000000..6ef60cff --- /dev/null +++ b/sig/finch_api/internal/type/converter.rbs @@ -0,0 +1,44 @@ +module FinchAPI + module Internal + module Type + module Converter + type input = FinchAPI::Internal::Type::Converter | Class + + type state = + { + strictness: bool | :strong, + exactness: { yes: Integer, no: Integer, maybe: Integer }, + branched: Integer + } + + def coerce: ( + top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> top + + def dump: (top value) -> top + + def self.type_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> FinchAPI::Internal::Type::Converter::input?, + union: ^-> FinchAPI::Internal::Type::Converter::input? + } + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input spec + ) -> (^-> top) + + def self.coerce: ( + FinchAPI::Internal::Type::Converter::input target, + top value, + ?state: FinchAPI::Internal::Type::Converter::state + ) -> top + + def self.dump: ( + FinchAPI::Internal::Type::Converter::input target, + top value + ) -> top + end + end + end +end diff --git a/sig/finch_api/internal/type/enum.rbs b/sig/finch_api/internal/type/enum.rbs new file mode 100644 index 00000000..2205191c --- /dev/null +++ b/sig/finch_api/internal/type/enum.rbs @@ -0,0 +1,24 @@ +module FinchAPI + module Internal + module Type + module Enum + include FinchAPI::Internal::Type::Converter + + def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] + + private def self.finalize!: -> void + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: ( + String | Symbol | top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> (Symbol | top) + + def dump: (Symbol | top value) -> (Symbol | top) + end + end + end +end diff --git a/sig/finch_api/internal/type/hash_of.rbs b/sig/finch_api/internal/type/hash_of.rbs new file mode 100644 index 00000000..e8aa8e84 --- /dev/null +++ b/sig/finch_api/internal/type/hash_of.rbs @@ -0,0 +1,38 @@ +module FinchAPI + module Internal + module Type + class HashOf[Elem] + include FinchAPI::Internal::Type::Converter + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: ( + ::Hash[top, top] | top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> (::Hash[Symbol, top] | top) + + def dump: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top) + + def item_type: -> Elem + + def nilable?: -> bool + + def initialize: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + end + end + end +end diff --git a/sig/finch_api/internal/type/request_parameters.rbs b/sig/finch_api/internal/type/request_parameters.rbs new file mode 100644 index 00000000..8319dcd2 --- /dev/null +++ b/sig/finch_api/internal/type/request_parameters.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Internal + module Type + type request_parameters = { request_options: FinchAPI::request_opts } + + module RequestParameters + attr_accessor request_options: FinchAPI::request_opts + + module Converter + def dump_request: (top params) -> [top, ::Hash[Symbol, top]] + end + end + end + end +end diff --git a/sig/finch_api/internal/type/union.rbs b/sig/finch_api/internal/type/union.rbs new file mode 100644 index 00000000..7797043d --- /dev/null +++ b/sig/finch_api/internal/type/union.rbs @@ -0,0 +1,42 @@ +module FinchAPI + module Internal + module Type + module Union + include FinchAPI::Internal::Type::Converter + + private def self.known_variants: -> ::Array[[Symbol?, (^-> FinchAPI::Internal::Type::Converter::input)]] + + def self.derefed_variants: -> ::Array[[Symbol?, top]] + + def self.variants: -> ::Array[top] + + private def self.discriminator: (Symbol property) -> void + + private def self.variant: ( + Symbol + | ::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input key, + ?::Hash[Symbol, top] + | ^-> FinchAPI::Internal::Type::Converter::input + | FinchAPI::Internal::Type::Converter::input spec + ) -> void + + private def self.resolve_variant: ( + top value + ) -> FinchAPI::Internal::Type::Converter::input? + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: ( + top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> top + + def dump: (top value) -> top + end + end + end +end diff --git a/sig/finch_api/internal/type/unknown.rbs b/sig/finch_api/internal/type/unknown.rbs new file mode 100644 index 00000000..29a8a0de --- /dev/null +++ b/sig/finch_api/internal/type/unknown.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Internal + module Type + class Unknown + extend FinchAPI::Internal::Type::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + top value, + state: FinchAPI::Internal::Type::Converter::state + ) -> top + + def self.dump: (top value) -> top + end + end + end +end diff --git a/sig/finch_api/internal/util.rbs b/sig/finch_api/internal/util.rbs new file mode 100644 index 00000000..1bd60fa1 --- /dev/null +++ b/sig/finch_api/internal/util.rbs @@ -0,0 +1,139 @@ +module FinchAPI + module Internal + module Util + def self?.monotonic_secs: -> Float + + def self?.arch: -> String + + def self?.os: -> String + + def self?.primitive?: (top input) -> bool + + def self?.coerce_boolean: (top input) -> (bool | top) + + def self?.coerce_boolean!: (top input) -> bool? + + def self?.coerce_integer: (top input) -> (Integer | top) + + def self?.coerce_float: (top input) -> (Float | top) + + def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) + + def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top + + def self?.deep_merge: ( + *::Array[top] values, + ?sentinel: top?, + ?concat: bool + ) -> top + + def self?.dig: ( + ::Hash[Symbol, top] | ::Array[top] | top data, + (Symbol | Integer | ::Array[(Symbol | Integer)])? pick, + ?top? sentinel + ) { + -> top? + } -> top? + + def self?.uri_origin: (URI::Generic uri) -> String + + def self?.interpolate_path: (String | ::Array[String] path) -> String + + def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] + + def self?.encode_query: ( + ::Hash[String, (::Array[String] | String)?]? query + ) -> String? + + type parsed_uri = + { + scheme: String?, + host: String?, + port: Integer?, + path: String?, + query: ::Hash[String, ::Array[String]] + } + + def self?.parse_uri: ( + URI::Generic | String url + ) -> FinchAPI::Internal::Util::parsed_uri + + def self?.unparse_uri: ( + FinchAPI::Internal::Util::parsed_uri parsed + ) -> URI::Generic + + def self?.join_parsed_uri: ( + FinchAPI::Internal::Util::parsed_uri lhs, + FinchAPI::Internal::Util::parsed_uri rhs + ) -> URI::Generic + + def self?.normalized_headers: ( + *::Hash[String, (String + | Integer + | ::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?.writable_enum: { + (Enumerator::Yielder y) -> void + } -> Enumerable[String] + + def self?.write_multipart_chunk: ( + 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 + ) -> top + + def self?.fused_enum: ( + Enumerable[top] enum, + ?external: bool + ) { + -> void + } -> Enumerable[top] + + def self?.close_fused!: (Enumerable[top]? enum) -> void + + def self?.chain_fused: ( + Enumerable[top]? enum + ) { + (Enumerator::Yielder arg0) -> void + } -> Enumerable[top] + + type server_sent_event = + { event: String?, data: String?, id: String?, retry: Integer? } + + def self?.decode_lines: (Enumerable[String] enum) -> Enumerable[String] + + def self?.decode_sse: ( + Enumerable[String] lines + ) -> FinchAPI::Internal::Util::server_sent_event + end + end +end diff --git a/sig/finch-api/models/access_token_create_params.rbs b/sig/finch_api/models/access_token_create_params.rbs similarity index 75% rename from sig/finch-api/models/access_token_create_params.rbs rename to sig/finch_api/models/access_token_create_params.rbs index 54ab1667..59104771 100644 --- a/sig/finch-api/models/access_token_create_params.rbs +++ b/sig/finch_api/models/access_token_create_params.rbs @@ -7,11 +7,11 @@ module FinchAPI client_secret: String, redirect_uri: String } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class AccessTokenCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AccessTokenCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor code: String diff --git a/sig/finch_api/models/account_disconnect_params.rbs b/sig/finch_api/models/account_disconnect_params.rbs new file mode 100644 index 00000000..e67ae70f --- /dev/null +++ b/sig/finch_api/models/account_disconnect_params.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Models + type account_disconnect_params = + { } & FinchAPI::Internal::Type::request_parameters + + class AccountDisconnectParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::account_disconnect_params + end + end +end diff --git a/sig/finch_api/models/account_introspect_params.rbs b/sig/finch_api/models/account_introspect_params.rbs new file mode 100644 index 00000000..bc1901ff --- /dev/null +++ b/sig/finch_api/models/account_introspect_params.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Models + type account_introspect_params = + { } & FinchAPI::Internal::Type::request_parameters + + class AccountIntrospectParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::account_introspect_params + end + end +end diff --git a/sig/finch-api/models/account_update_event.rbs b/sig/finch_api/models/account_update_event.rbs similarity index 95% rename from sig/finch-api/models/account_update_event.rbs rename to sig/finch_api/models/account_update_event.rbs index 383bffef..7117b51f 100644 --- a/sig/finch-api/models/account_update_event.rbs +++ b/sig/finch_api/models/account_update_event.rbs @@ -32,7 +32,7 @@ module FinchAPI status: FinchAPI::Models::connection_status_type } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_accessor authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod attr_accessor status: FinchAPI::Models::connection_status_type @@ -51,7 +51,7 @@ module FinchAPI type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_ } - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel attr_accessor benefits_support: FinchAPI::Models::HRIS::BenefitsSupport? attr_accessor supported_fields: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields? @@ -81,7 +81,7 @@ module FinchAPI payment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment } - class SupportedFields < FinchAPI::BaseModel + class SupportedFields < FinchAPI::Internal::Type::BaseModel attr_reader company: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company? def company=: ( @@ -149,7 +149,7 @@ module FinchAPI primary_phone_number: bool } - class Company < FinchAPI::BaseModel + class Company < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -217,7 +217,7 @@ module FinchAPI routing_number: bool } - class Accounts < FinchAPI::BaseModel + class Accounts < FinchAPI::Internal::Type::BaseModel attr_reader account_name: bool? def account_name=: (bool) -> bool @@ -255,7 +255,7 @@ module FinchAPI parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent } - class Departments < FinchAPI::BaseModel + class Departments < FinchAPI::Internal::Type::BaseModel attr_reader name: bool? def name=: (bool) -> bool @@ -275,7 +275,7 @@ module FinchAPI type parent = { name: bool } - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel attr_reader name: bool? def name=: (bool) -> bool @@ -288,7 +288,7 @@ module FinchAPI type entity = { subtype: bool, type: bool } - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel attr_reader subtype: bool? def subtype=: (bool) -> bool @@ -312,7 +312,7 @@ module FinchAPI state: bool } - class Locations < FinchAPI::BaseModel + class Locations < FinchAPI::Internal::Type::BaseModel attr_reader city: bool? def city=: (bool) -> bool @@ -356,7 +356,7 @@ module FinchAPI paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging } - class Directory < FinchAPI::BaseModel + class Directory < FinchAPI::Internal::Type::BaseModel attr_reader individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals? def individuals=: ( @@ -387,7 +387,7 @@ module FinchAPI middle_name: bool } - class Individuals < FinchAPI::BaseModel + class Individuals < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -432,7 +432,7 @@ module FinchAPI type manager = { id: bool } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -445,7 +445,7 @@ module FinchAPI type paging = { count: bool, offset: bool } - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel attr_reader count: bool? def count=: (bool) -> bool @@ -481,7 +481,7 @@ module FinchAPI title: bool } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -584,7 +584,7 @@ module FinchAPI type department = { name: bool } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_reader name: bool? def name=: (bool) -> bool @@ -596,7 +596,7 @@ module FinchAPI type employment = { subtype: bool, type: bool } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_reader subtype: bool? def subtype=: (bool) -> bool @@ -612,7 +612,7 @@ module FinchAPI type income = { amount: bool, currency: bool, unit: bool } - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -644,7 +644,7 @@ module FinchAPI state: bool } - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel attr_reader city: bool? def city=: (bool) -> bool @@ -683,7 +683,7 @@ module FinchAPI type manager = { id: bool } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -711,7 +711,7 @@ module FinchAPI ssn: bool } - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -790,7 +790,7 @@ module FinchAPI type emails = { data: bool, type: bool } - class Emails < FinchAPI::BaseModel + class Emails < FinchAPI::Internal::Type::BaseModel attr_reader data: bool? def data=: (bool) -> bool @@ -806,7 +806,7 @@ module FinchAPI type phone_numbers = { data: bool, type: bool } - class PhoneNumbers < FinchAPI::BaseModel + class PhoneNumbers < FinchAPI::Internal::Type::BaseModel attr_reader data: bool? def data=: (bool) -> bool @@ -830,7 +830,7 @@ module FinchAPI state: bool } - class Residence < FinchAPI::BaseModel + class Residence < FinchAPI::Internal::Type::BaseModel attr_reader city: bool? def city=: (bool) -> bool @@ -876,7 +876,7 @@ module FinchAPI pay_frequencies: bool } - class PayGroup < FinchAPI::BaseModel + class PayGroup < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -909,7 +909,7 @@ module FinchAPI pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements } - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel attr_reader paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging? def paging=: ( @@ -931,7 +931,7 @@ module FinchAPI type paging = { count: bool, offset: bool } - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel attr_accessor count: bool attr_accessor offset: bool @@ -955,7 +955,7 @@ module FinchAPI type: bool } - class PayStatements < FinchAPI::BaseModel + class PayStatements < FinchAPI::Internal::Type::BaseModel attr_reader earnings: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings? def earnings=: ( @@ -1022,7 +1022,7 @@ module FinchAPI type earnings = { amount: bool, currency: bool, name: bool, type: bool } - class Earnings < FinchAPI::BaseModel + class Earnings < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1058,7 +1058,7 @@ module FinchAPI type: bool } - class EmployeeDeductions < FinchAPI::BaseModel + class EmployeeDeductions < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1093,7 +1093,7 @@ module FinchAPI type employer_contributions = { amount: bool, currency: bool, name: bool } - class EmployerContributions < FinchAPI::BaseModel + class EmployerContributions < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1124,7 +1124,7 @@ module FinchAPI type: bool } - class Taxes < FinchAPI::BaseModel + class Taxes < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1174,7 +1174,7 @@ module FinchAPI pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod } - class Payment < FinchAPI::BaseModel + class Payment < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -1244,7 +1244,7 @@ module FinchAPI type pay_period = { end_date: bool, start_date: bool } - class PayPeriod < FinchAPI::BaseModel + class PayPeriod < FinchAPI::Internal::Type::BaseModel attr_reader end_date: bool? def end_date=: (bool) -> bool @@ -1264,7 +1264,7 @@ module FinchAPI :assisted | :credential | :api_token | :api_credential | :oauth module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED: :assisted CREDENTIAL: :credential @@ -1280,7 +1280,7 @@ module FinchAPI type event_type = :"account.updated" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACCOUNT_UPDATED: :"account.updated" diff --git a/sig/finch-api/models/base_webhook_event.rbs b/sig/finch_api/models/base_webhook_event.rbs similarity index 88% rename from sig/finch-api/models/base_webhook_event.rbs rename to sig/finch_api/models/base_webhook_event.rbs index 1645bf72..9ddc8d53 100644 --- a/sig/finch-api/models/base_webhook_event.rbs +++ b/sig/finch_api/models/base_webhook_event.rbs @@ -3,7 +3,7 @@ module FinchAPI type base_webhook_event = { account_id: String, company_id: String, connection_id: String } - class BaseWebhookEvent < FinchAPI::BaseModel + class BaseWebhookEvent < FinchAPI::Internal::Type::BaseModel attr_accessor account_id: String attr_accessor company_id: String diff --git a/sig/finch-api/models/company_event.rbs b/sig/finch_api/models/company_event.rbs similarity index 95% rename from sig/finch-api/models/company_event.rbs rename to sig/finch_api/models/company_event.rbs index 21e92e2d..1670296f 100644 --- a/sig/finch-api/models/company_event.rbs +++ b/sig/finch_api/models/company_event.rbs @@ -27,7 +27,7 @@ module FinchAPI type event_type = :"company.updated" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPANY_UPDATED: :"company.updated" diff --git a/sig/finch-api/models/connect/session_new_params.rbs b/sig/finch_api/models/connect/session_new_params.rbs similarity index 88% rename from sig/finch-api/models/connect/session_new_params.rbs rename to sig/finch_api/models/connect/session_new_params.rbs index 72d134a0..60d4ecac 100644 --- a/sig/finch-api/models/connect/session_new_params.rbs +++ b/sig/finch_api/models/connect/session_new_params.rbs @@ -13,11 +13,11 @@ module FinchAPI redirect_uri: String?, sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class SessionNewParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class SessionNewParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor customer_id: String @@ -63,7 +63,7 @@ module FinchAPI | :ssn module Product - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPANY: :company DIRECTORY: :directory @@ -83,7 +83,7 @@ module FinchAPI provider: String? } - class Integration < FinchAPI::BaseModel + class Integration < FinchAPI::Internal::Type::BaseModel attr_accessor auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? attr_accessor provider: String? @@ -98,7 +98,7 @@ module FinchAPI type auth_method = :assisted | :credential | :oauth | :api_token module AuthMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED: :assisted CREDENTIAL: :credential @@ -112,7 +112,7 @@ module FinchAPI type sandbox = :finch | :provider module Sandbox - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FINCH: :finch PROVIDER: :provider diff --git a/sig/finch-api/models/connect/session_new_response.rbs b/sig/finch_api/models/connect/session_new_response.rbs similarity index 84% rename from sig/finch-api/models/connect/session_new_response.rbs rename to sig/finch_api/models/connect/session_new_response.rbs index cf174be8..52641a3e 100644 --- a/sig/finch-api/models/connect/session_new_response.rbs +++ b/sig/finch_api/models/connect/session_new_response.rbs @@ -3,7 +3,7 @@ module FinchAPI module Connect type session_new_response = { connect_url: String, session_id: String } - class SessionNewResponse < FinchAPI::BaseModel + class SessionNewResponse < FinchAPI::Internal::Type::BaseModel attr_accessor connect_url: String attr_accessor session_id: String diff --git a/sig/finch-api/models/connect/session_reauthenticate_params.rbs b/sig/finch_api/models/connect/session_reauthenticate_params.rbs similarity index 83% rename from sig/finch-api/models/connect/session_reauthenticate_params.rbs rename to sig/finch_api/models/connect/session_reauthenticate_params.rbs index e161c491..e5698732 100644 --- a/sig/finch-api/models/connect/session_reauthenticate_params.rbs +++ b/sig/finch_api/models/connect/session_reauthenticate_params.rbs @@ -8,11 +8,11 @@ module FinchAPI products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, redirect_uri: String? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class SessionReauthenticateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class SessionReauthenticateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor connection_id: String @@ -43,7 +43,7 @@ module FinchAPI | :ssn module Product - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPANY: :company DIRECTORY: :directory diff --git a/sig/finch-api/models/connect/session_reauthenticate_response.rbs b/sig/finch_api/models/connect/session_reauthenticate_response.rbs similarity index 84% rename from sig/finch-api/models/connect/session_reauthenticate_response.rbs rename to sig/finch_api/models/connect/session_reauthenticate_response.rbs index 2c9ccee7..10db85b7 100644 --- a/sig/finch-api/models/connect/session_reauthenticate_response.rbs +++ b/sig/finch_api/models/connect/session_reauthenticate_response.rbs @@ -4,7 +4,7 @@ module FinchAPI type session_reauthenticate_response = { connect_url: String, session_id: String } - class SessionReauthenticateResponse < FinchAPI::BaseModel + class SessionReauthenticateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor connect_url: String attr_accessor session_id: String diff --git a/sig/finch-api/models/connection_status_type.rbs b/sig/finch_api/models/connection_status_type.rbs similarity index 92% rename from sig/finch-api/models/connection_status_type.rbs rename to sig/finch_api/models/connection_status_type.rbs index 3116a419..625b02b7 100644 --- a/sig/finch-api/models/connection_status_type.rbs +++ b/sig/finch_api/models/connection_status_type.rbs @@ -9,7 +9,7 @@ module FinchAPI | :reauth module ConnectionStatusType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PENDING: :pending PROCESSING: :processing diff --git a/sig/finch-api/models/create_access_token_response.rbs b/sig/finch_api/models/create_access_token_response.rbs similarity index 92% rename from sig/finch-api/models/create_access_token_response.rbs rename to sig/finch_api/models/create_access_token_response.rbs index affd7a36..7517f2f7 100644 --- a/sig/finch-api/models/create_access_token_response.rbs +++ b/sig/finch_api/models/create_access_token_response.rbs @@ -14,7 +14,7 @@ module FinchAPI token_type: String } - class CreateAccessTokenResponse < FinchAPI::BaseModel + class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel attr_accessor access_token: String attr_accessor account_id: String @@ -55,7 +55,7 @@ module FinchAPI type client_type = :production | :development | :sandbox module ClientType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PRODUCTION: :production DEVELOPMENT: :development @@ -67,7 +67,7 @@ module FinchAPI type connection_type = :provider | :finch module ConnectionType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PROVIDER: :provider FINCH: :finch diff --git a/sig/finch-api/models/directory_event.rbs b/sig/finch_api/models/directory_event.rbs similarity index 93% rename from sig/finch-api/models/directory_event.rbs rename to sig/finch_api/models/directory_event.rbs index 8abf30fc..67d58d67 100644 --- a/sig/finch-api/models/directory_event.rbs +++ b/sig/finch_api/models/directory_event.rbs @@ -28,7 +28,7 @@ module FinchAPI type data = { individual_id: String } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_reader individual_id: String? def individual_id=: (String) -> String @@ -42,7 +42,7 @@ module FinchAPI :"directory.created" | :"directory.updated" | :"directory.deleted" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DIRECTORY_CREATED: :"directory.created" DIRECTORY_UPDATED: :"directory.updated" diff --git a/sig/finch-api/models/disconnect_response.rbs b/sig/finch_api/models/disconnect_response.rbs similarity index 78% rename from sig/finch-api/models/disconnect_response.rbs rename to sig/finch_api/models/disconnect_response.rbs index 41ded8a0..b857221b 100644 --- a/sig/finch-api/models/disconnect_response.rbs +++ b/sig/finch_api/models/disconnect_response.rbs @@ -2,7 +2,7 @@ module FinchAPI module Models type disconnect_response = { status: String } - class DisconnectResponse < FinchAPI::BaseModel + class DisconnectResponse < FinchAPI::Internal::Type::BaseModel attr_accessor status: String def initialize: (status: String) -> void diff --git a/sig/finch-api/models/employment_event.rbs b/sig/finch_api/models/employment_event.rbs similarity index 93% rename from sig/finch-api/models/employment_event.rbs rename to sig/finch_api/models/employment_event.rbs index 70ac8f5d..041923b8 100644 --- a/sig/finch-api/models/employment_event.rbs +++ b/sig/finch_api/models/employment_event.rbs @@ -28,7 +28,7 @@ module FinchAPI type data = { individual_id: String } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_reader individual_id: String? def individual_id=: (String) -> String @@ -42,7 +42,7 @@ module FinchAPI :"employment.created" | :"employment.updated" | :"employment.deleted" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYMENT_CREATED: :"employment.created" EMPLOYMENT_UPDATED: :"employment.updated" diff --git a/sig/finch-api/models/hris/benefit_contribution.rbs b/sig/finch_api/models/hris/benefit_contribution.rbs similarity index 86% rename from sig/finch-api/models/hris/benefit_contribution.rbs rename to sig/finch_api/models/hris/benefit_contribution.rbs index 2ef78933..54d31b42 100644 --- a/sig/finch-api/models/hris/benefit_contribution.rbs +++ b/sig/finch_api/models/hris/benefit_contribution.rbs @@ -7,7 +7,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::BenefitContribution::type_? } - class BenefitContribution < FinchAPI::BaseModel + class BenefitContribution < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor type: FinchAPI::Models::HRIS::BenefitContribution::type_? @@ -22,7 +22,7 @@ module FinchAPI type type_ = :fixed | :percent module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent diff --git a/sig/finch-api/models/hris/benefit_create_params.rbs b/sig/finch_api/models/hris/benefit_create_params.rbs similarity index 76% rename from sig/finch-api/models/hris/benefit_create_params.rbs rename to sig/finch_api/models/hris/benefit_create_params.rbs index 0df19218..5d2904cf 100644 --- a/sig/finch-api/models/hris/benefit_create_params.rbs +++ b/sig/finch_api/models/hris/benefit_create_params.rbs @@ -7,11 +7,11 @@ module FinchAPI frequency: FinchAPI::Models::HRIS::benefit_frequency?, type: FinchAPI::Models::HRIS::benefit_type? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class BenefitCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader description: String? diff --git a/sig/finch-api/models/hris/benefit_features_and_operations.rbs b/sig/finch_api/models/hris/benefit_features_and_operations.rbs similarity index 93% rename from sig/finch-api/models/hris/benefit_features_and_operations.rbs rename to sig/finch_api/models/hris/benefit_features_and_operations.rbs index 4173cfde..09c51c11 100644 --- a/sig/finch-api/models/hris/benefit_features_and_operations.rbs +++ b/sig/finch_api/models/hris/benefit_features_and_operations.rbs @@ -7,7 +7,7 @@ module FinchAPI supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType } - class BenefitFeaturesAndOperations < FinchAPI::BaseModel + class BenefitFeaturesAndOperations < FinchAPI::Internal::Type::BaseModel attr_reader supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures? def supported_features=: ( @@ -38,7 +38,7 @@ module FinchAPI hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit?]? } - class SupportedFeatures < FinchAPI::BaseModel + class SupportedFeatures < FinchAPI::Internal::Type::BaseModel attr_accessor annual_maximum: bool? attr_accessor catch_up: bool? @@ -72,7 +72,7 @@ module FinchAPI type company_contribution = :fixed | :percent module CompanyContribution - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent @@ -83,7 +83,7 @@ module FinchAPI type employee_deduction = :fixed | :percent module EmployeeDeduction - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent @@ -94,7 +94,7 @@ module FinchAPI type hsa_contribution_limit = :individual | :family module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL: :individual FAMILY: :family diff --git a/sig/finch-api/models/hris/benefit_frequency.rbs b/sig/finch_api/models/hris/benefit_frequency.rbs similarity index 88% rename from sig/finch-api/models/hris/benefit_frequency.rbs rename to sig/finch_api/models/hris/benefit_frequency.rbs index 849ad28c..5cef4f7a 100644 --- a/sig/finch-api/models/hris/benefit_frequency.rbs +++ b/sig/finch_api/models/hris/benefit_frequency.rbs @@ -4,7 +4,7 @@ module FinchAPI type benefit_frequency = :one_time | :every_paycheck | :monthly module BenefitFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ONE_TIME: :one_time EVERY_PAYCHECK: :every_paycheck diff --git a/sig/finch_api/models/hris/benefit_list_params.rbs b/sig/finch_api/models/hris/benefit_list_params.rbs new file mode 100644 index 00000000..271bcfdb --- /dev/null +++ b/sig/finch_api/models/hris/benefit_list_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module HRIS + type benefit_list_params = + { } & FinchAPI::Internal::Type::request_parameters + + class BenefitListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_list_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs b/sig/finch_api/models/hris/benefit_list_supported_benefits_params.rbs similarity index 51% rename from sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs rename to sig/finch_api/models/hris/benefit_list_supported_benefits_params.rbs index d1de2c0b..2046c620 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 @@ -2,11 +2,11 @@ module FinchAPI module Models module HRIS type benefit_list_supported_benefits_params = - { } & FinchAPI::request_parameters + { } & FinchAPI::Internal::Type::request_parameters - class BenefitListSupportedBenefitsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class BenefitListSupportedBenefitsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters def initialize: (?request_options: FinchAPI::request_opts) -> void diff --git a/sig/finch_api/models/hris/benefit_retrieve_params.rbs b/sig/finch_api/models/hris/benefit_retrieve_params.rbs new file mode 100644 index 00000000..dfa0110a --- /dev/null +++ b/sig/finch_api/models/hris/benefit_retrieve_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module HRIS + type benefit_retrieve_params = + { } & FinchAPI::Internal::Type::request_parameters + + class BenefitRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_type.rbs b/sig/finch_api/models/hris/benefit_type.rbs similarity index 75% rename from sig/finch-api/models/hris/benefit_type.rbs rename to sig/finch_api/models/hris/benefit_type.rbs index d3c1d48b..e8ee3636 100644 --- a/sig/finch-api/models/hris/benefit_type.rbs +++ b/sig/finch_api/models/hris/benefit_type.rbs @@ -23,15 +23,15 @@ module FinchAPI | :custom_pre_tax module BenefitType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum - NUMBER_401K: :"401k" - NUMBER_401K_ROTH: :"401k_roth" - NUMBER_401K_LOAN: :"401k_loan" - NUMBER_403B: :"403b" - NUMBER_403B_ROTH: :"403b_roth" - NUMBER_457: :"457" - NUMBER_457_ROTH: :"457_roth" + BENEFIT_TYPE_401K: :"401k" + BENEFIT_TYPE_401K_ROTH: :"401k_roth" + BENEFIT_TYPE_401K_LOAN: :"401k_loan" + BENEFIT_TYPE_403B: :"403b" + BENEFIT_TYPE_403B_ROTH: :"403b_roth" + BENEFIT_TYPE_457: :"457" + BENEFIT_TYPE_457_ROTH: :"457_roth" S125_MEDICAL: :s125_medical S125_DENTAL: :s125_dental S125_VISION: :s125_vision diff --git a/sig/finch-api/models/hris/benefit_update_params.rbs b/sig/finch_api/models/hris/benefit_update_params.rbs similarity index 58% rename from sig/finch-api/models/hris/benefit_update_params.rbs rename to sig/finch_api/models/hris/benefit_update_params.rbs index 9f92a228..16132043 100644 --- a/sig/finch-api/models/hris/benefit_update_params.rbs +++ b/sig/finch_api/models/hris/benefit_update_params.rbs @@ -2,11 +2,11 @@ module FinchAPI module Models module HRIS type benefit_update_params = - { description: String } & FinchAPI::request_parameters + { description: String } & FinchAPI::Internal::Type::request_parameters - class BenefitUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class BenefitUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader description: String? diff --git a/sig/finch-api/models/hris/benefits/enrolled_individual.rbs b/sig/finch_api/models/hris/benefits/enrolled_individual.rbs similarity index 91% rename from sig/finch-api/models/hris/benefits/enrolled_individual.rbs rename to sig/finch_api/models/hris/benefits/enrolled_individual.rbs index d1656d6c..3f7da903 100644 --- a/sig/finch-api/models/hris/benefits/enrolled_individual.rbs +++ b/sig/finch_api/models/hris/benefits/enrolled_individual.rbs @@ -9,7 +9,7 @@ module FinchAPI individual_id: String } - class EnrolledIndividual < FinchAPI::BaseModel + class EnrolledIndividual < FinchAPI::Internal::Type::BaseModel attr_reader body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body? def body=: ( @@ -36,7 +36,7 @@ module FinchAPI type body = { finch_code: String?, message: String?, name: String? } - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel attr_accessor finch_code: String? attr_accessor message: String? @@ -55,7 +55,7 @@ module FinchAPI type code = 200 | 201 | 404 | 403 module Code - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum OK: 200 CREATED: 201 diff --git a/sig/finch-api/models/hris/benefits/individual_benefit.rbs b/sig/finch_api/models/hris/benefits/individual_benefit.rbs similarity index 93% rename from sig/finch-api/models/hris/benefits/individual_benefit.rbs rename to sig/finch_api/models/hris/benefits/individual_benefit.rbs index 598e1822..875552d1 100644 --- a/sig/finch-api/models/hris/benefits/individual_benefit.rbs +++ b/sig/finch_api/models/hris/benefits/individual_benefit.rbs @@ -11,7 +11,7 @@ module FinchAPI individual_id: String } - class IndividualBenefit < FinchAPI::BaseModel + class IndividualBenefit < FinchAPI::Internal::Type::BaseModel attr_reader body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body? def body=: ( @@ -43,7 +43,7 @@ module FinchAPI hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? } - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel attr_accessor annual_maximum: Integer? attr_accessor catch_up: bool? @@ -67,7 +67,7 @@ module FinchAPI type hsa_contribution_limit = :individual | :family module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL: :individual FAMILY: :family 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 similarity index 90% rename from sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs rename to sig/finch_api/models/hris/benefits/individual_enroll_many_params.rbs index 1aa006f8..d0840aaa 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 @@ -6,11 +6,11 @@ module FinchAPI { individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class IndividualEnrollManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualEnrollManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual]? @@ -31,7 +31,7 @@ module FinchAPI individual_id: String } - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel attr_reader configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration? def configuration=: ( @@ -55,10 +55,11 @@ module FinchAPI annual_maximum: Integer?, catch_up: bool, company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + effective_date: Date, employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction } - class Configuration < FinchAPI::BaseModel + class Configuration < FinchAPI::Internal::Type::BaseModel attr_reader annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit? def annual_contribution_limit=: ( @@ -77,6 +78,10 @@ module FinchAPI FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + attr_reader effective_date: Date? + + def effective_date=: (Date) -> Date + attr_reader employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction? def employee_deduction=: ( @@ -88,6 +93,7 @@ module FinchAPI ?annual_maximum: Integer?, ?catch_up: bool, ?company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + ?effective_date: Date, ?employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction ) -> void @@ -96,7 +102,7 @@ module FinchAPI type annual_contribution_limit = :individual | :family module AnnualContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL: :individual FAMILY: :family @@ -110,7 +116,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_ } - class CompanyContribution < FinchAPI::BaseModel + class CompanyContribution < FinchAPI::Internal::Type::BaseModel attr_reader amount: Integer? def amount=: (Integer) -> Integer @@ -131,7 +137,7 @@ module FinchAPI type type_ = :fixed | :percent module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent @@ -146,7 +152,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_ } - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel attr_reader amount: Integer? def amount=: (Integer) -> Integer @@ -167,7 +173,7 @@ module FinchAPI type type_ = :fixed | :percent module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent 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 similarity index 54% rename from sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs rename to sig/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbs index 223ede3f..070780e0 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 @@ -3,11 +3,11 @@ module FinchAPI module HRIS module Benefits type individual_enrolled_ids_params = - { } & FinchAPI::request_parameters + { } & FinchAPI::Internal::Type::request_parameters - class IndividualEnrolledIDsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualEnrolledIDsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters def initialize: (?request_options: FinchAPI::request_opts) -> void 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 similarity index 86% rename from sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs rename to sig/finch_api/models/hris/benefits/individual_enrolled_ids_response.rbs index 7e6fd361..ee785e4b 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 @@ -5,7 +5,7 @@ module FinchAPI type individual_enrolled_ids_response = { benefit_id: String, individual_ids: ::Array[String] } - class IndividualEnrolledIDsResponse < FinchAPI::BaseModel + class IndividualEnrolledIDsResponse < FinchAPI::Internal::Type::BaseModel attr_accessor benefit_id: String attr_accessor individual_ids: ::Array[String] 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 similarity index 61% rename from sig/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs rename to sig/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs index bb46cd6a..5ad243f0 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 @@ -3,11 +3,12 @@ module FinchAPI module HRIS module Benefits type individual_retrieve_many_benefits_params = - { individual_ids: String } & FinchAPI::request_parameters + { individual_ids: String } + & FinchAPI::Internal::Type::request_parameters - class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualRetrieveManyBenefitsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader individual_ids: String? 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 similarity index 62% rename from sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs rename to sig/finch_api/models/hris/benefits/individual_unenroll_many_params.rbs index f06582f5..9e5cd958 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 @@ -3,11 +3,12 @@ module FinchAPI module HRIS module Benefits type individual_unenroll_many_params = - { individual_ids: ::Array[String] } & FinchAPI::request_parameters + { individual_ids: ::Array[String] } + & FinchAPI::Internal::Type::request_parameters - class IndividualUnenrollManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualUnenrollManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader individual_ids: ::Array[String]? diff --git a/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs b/sig/finch_api/models/hris/benefits/unenrolled_individual.rbs similarity index 91% rename from sig/finch-api/models/hris/benefits/unenrolled_individual.rbs rename to sig/finch_api/models/hris/benefits/unenrolled_individual.rbs index 3d5aed66..e5691a13 100644 --- a/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs +++ b/sig/finch_api/models/hris/benefits/unenrolled_individual.rbs @@ -9,7 +9,7 @@ module FinchAPI individual_id: String } - class UnenrolledIndividual < FinchAPI::BaseModel + class UnenrolledIndividual < FinchAPI::Internal::Type::BaseModel attr_reader body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body? def body=: ( @@ -34,7 +34,7 @@ module FinchAPI type body = { finch_code: String?, message: String?, name: String? } - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel attr_accessor finch_code: String? attr_accessor message: String? diff --git a/sig/finch-api/models/hris/benefits_support.rbs b/sig/finch_api/models/hris/benefits_support.rbs similarity index 97% rename from sig/finch-api/models/hris/benefits_support.rbs rename to sig/finch_api/models/hris/benefits_support.rbs index 3715523e..9aa48257 100644 --- a/sig/finch-api/models/hris/benefits_support.rbs +++ b/sig/finch_api/models/hris/benefits_support.rbs @@ -17,7 +17,7 @@ module FinchAPI simple_ira: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? } - class BenefitsSupport < FinchAPI::BaseModel + class BenefitsSupport < FinchAPI::Internal::Type::BaseModel attr_accessor commuter: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? attr_accessor custom_post_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? diff --git a/sig/finch-api/models/hris/benfit_contribution.rbs b/sig/finch_api/models/hris/benfit_contribution.rbs similarity index 100% rename from sig/finch-api/models/hris/benfit_contribution.rbs rename to sig/finch_api/models/hris/benfit_contribution.rbs diff --git a/sig/finch-api/models/hris/company.rbs b/sig/finch_api/models/hris/company.rbs similarity index 91% rename from sig/finch-api/models/hris/company.rbs rename to sig/finch_api/models/hris/company.rbs index 79f8aa6b..18841ee6 100644 --- a/sig/finch-api/models/hris/company.rbs +++ b/sig/finch_api/models/hris/company.rbs @@ -14,7 +14,7 @@ module FinchAPI primary_phone_number: String? } - class HRISCompany < FinchAPI::BaseModel + class HRISCompany < FinchAPI::Internal::Type::BaseModel attr_accessor id: String attr_accessor accounts: ::Array[FinchAPI::Models::HRIS::HRISCompany::Account]? @@ -56,7 +56,7 @@ module FinchAPI routing_number: String? } - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel attr_accessor account_name: String? attr_accessor account_number: String? @@ -80,7 +80,7 @@ module FinchAPI type account_type = :checking | :savings module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECKING: :checking SAVINGS: :savings @@ -95,7 +95,7 @@ module FinchAPI parent: FinchAPI::Models::HRIS::HRISCompany::Department::Parent? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? attr_accessor parent: FinchAPI::Models::HRIS::HRISCompany::Department::Parent? @@ -109,7 +109,7 @@ module FinchAPI type parent = { name: String? } - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -124,7 +124,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::HRISCompany::Entity::type_? } - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::HRIS::HRISCompany::Entity::subtype? attr_accessor type: FinchAPI::Models::HRIS::HRISCompany::Entity::type_? @@ -139,7 +139,7 @@ module FinchAPI type subtype = :s_corporation | :c_corporation | :b_corporation module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum S_CORPORATION: :s_corporation C_CORPORATION: :c_corporation @@ -158,7 +158,7 @@ module FinchAPI | :cooperative module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum LLC: :llc LP: :lp diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_create_params.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_create_params.rbs new file mode 100644 index 00000000..b025729e --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_create_params.rbs @@ -0,0 +1,120 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_create_params = + { + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition], + effective_end_date: String?, + effective_start_date: String?, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type + } + & FinchAPI::Internal::Type::request_parameters + + class RuleCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + attr_reader attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes? + + def attributes=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes + + attr_reader conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition]? + + def conditions=: ( + ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition] + ) -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition] + + attr_accessor effective_end_date: String? + + attr_accessor effective_start_date: String? + + attr_reader entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type? + + def entity_type=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type + + def initialize: ( + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + ?conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition], + ?effective_end_date: String?, + ?effective_start_date: String?, + ?entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type, + ?request_options: FinchAPI::request_opts + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_create_params + + type attributes = { metadata: ::Hash[Symbol, top] } + + class Attributes < FinchAPI::Internal::Type::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: (?metadata: ::Hash[Symbol, top]) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::attributes + end + + type condition = + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::operator, + value: String + } + + class Condition < FinchAPI::Internal::Type::BaseModel + attr_reader field: String? + + def field=: (String) -> String + + attr_reader operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::operator? + + def operator=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::operator + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::operator + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?field: String, + ?operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::operator, + ?value: String + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::condition + + type operator = :equals + + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS: :equals + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition::operator] + end + end + + type entity_type = :pay_statement_item + + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM: :pay_statement_item + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type] + end + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_create_response.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_create_response.rbs new file mode 100644 index 00000000..a0922d82 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_create_response.rbs @@ -0,0 +1,139 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_create_response = + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes, + conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition], + created_at: Time, + effective_end_date: String?, + effective_start_date: String?, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::entity_type, + priority: Integer, + updated_at: Time + } + + class RuleCreateResponse < FinchAPI::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes? + + def attributes=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes + + attr_reader conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition]? + + def conditions=: ( + ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition] + ) -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition] + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_accessor effective_end_date: String? + + attr_accessor effective_start_date: String? + + attr_reader entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::entity_type? + + def entity_type=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::entity_type + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::entity_type + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + ?id: String, + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes, + ?conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition], + ?created_at: Time, + ?effective_end_date: String?, + ?effective_start_date: String?, + ?entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::entity_type, + ?priority: Integer, + ?updated_at: Time + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_create_response + + type attributes = { metadata: ::Hash[Symbol, top] } + + class Attributes < FinchAPI::Internal::Type::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: (?metadata: ::Hash[Symbol, top]) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::attributes + end + + type condition = + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::operator, + value: String + } + + class Condition < FinchAPI::Internal::Type::BaseModel + attr_reader field: String? + + def field=: (String) -> String + + attr_reader operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::operator? + + def operator=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::operator + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::operator + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?field: String, + ?operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::operator, + ?value: String + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::condition + + type operator = :equals + + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS: :equals + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition::operator] + end + end + + type entity_type = :pay_statement_item + + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM: :pay_statement_item + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::entity_type] + end + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbs new file mode 100644 index 00000000..105d66d0 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_delete_params = + { } & FinchAPI::Internal::Type::request_parameters + + class RuleDeleteParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_delete_params + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rbs new file mode 100644 index 00000000..842079b4 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_delete_response.rbs @@ -0,0 +1,145 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_delete_response = + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes, + conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition], + created_at: Time, + deleted_at: Time, + effective_end_date: String?, + effective_start_date: String?, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::entity_type, + priority: Integer, + updated_at: Time + } + + class RuleDeleteResponse < FinchAPI::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes? + + def attributes=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes + + attr_reader conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition]? + + def conditions=: ( + ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition] + ) -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition] + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader deleted_at: Time? + + def deleted_at=: (Time) -> Time + + attr_accessor effective_end_date: String? + + attr_accessor effective_start_date: String? + + attr_reader entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::entity_type? + + def entity_type=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::entity_type + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::entity_type + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + ?id: String, + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes, + ?conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition], + ?created_at: Time, + ?deleted_at: Time, + ?effective_end_date: String?, + ?effective_start_date: String?, + ?entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::entity_type, + ?priority: Integer, + ?updated_at: Time + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_delete_response + + type attributes = { metadata: ::Hash[Symbol, top] } + + class Attributes < FinchAPI::Internal::Type::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: (?metadata: ::Hash[Symbol, top]) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::attributes + end + + type condition = + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::operator, + value: String + } + + class Condition < FinchAPI::Internal::Type::BaseModel + attr_reader field: String? + + def field=: (String) -> String + + attr_reader operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::operator? + + def operator=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::operator + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::operator + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?field: String, + ?operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::operator, + ?value: String + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::condition + + type operator = :equals + + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS: :equals + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition::operator] + end + end + + type entity_type = :pay_statement_item + + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM: :pay_statement_item + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::entity_type] + end + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_list_params.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_list_params.rbs new file mode 100644 index 00000000..aa17bf9c --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_list_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_list_params = + { } & FinchAPI::Internal::Type::request_parameters + + class RuleListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_list_params + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_list_response.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_list_response.rbs new file mode 100644 index 00000000..453140f7 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_list_response.rbs @@ -0,0 +1,139 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_list_response = + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes, + conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition], + created_at: Time, + effective_end_date: String?, + effective_start_date: String?, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::entity_type, + priority: Integer, + updated_at: Time + } + + class RuleListResponse < FinchAPI::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes? + + def attributes=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes + + attr_reader conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition]? + + def conditions=: ( + ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition] + ) -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition] + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_accessor effective_end_date: String? + + attr_accessor effective_start_date: String? + + attr_reader entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::entity_type? + + def entity_type=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::entity_type + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::entity_type + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + ?id: String, + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes, + ?conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition], + ?created_at: Time, + ?effective_end_date: String?, + ?effective_start_date: String?, + ?entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::entity_type, + ?priority: Integer, + ?updated_at: Time + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_list_response + + type attributes = { metadata: ::Hash[Symbol, top] } + + class Attributes < FinchAPI::Internal::Type::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: (?metadata: ::Hash[Symbol, top]) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::attributes + end + + type condition = + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::operator, + value: String + } + + class Condition < FinchAPI::Internal::Type::BaseModel + attr_reader field: String? + + def field=: (String) -> String + + attr_reader operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::operator? + + def operator=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::operator + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::operator + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?field: String, + ?operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::operator, + ?value: String + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::condition + + type operator = :equals + + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS: :equals + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition::operator] + end + end + + type entity_type = :pay_statement_item + + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM: :pay_statement_item + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::entity_type] + end + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbs new file mode 100644 index 00000000..9398f059 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbs @@ -0,0 +1,29 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_update_params = + { optional_property: top } + & FinchAPI::Internal::Type::request_parameters + + class RuleUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + attr_reader optional_property: top? + + def optional_property=: (top) -> top + + def initialize: ( + ?optional_property: top, + ?request_options: FinchAPI::request_opts + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_update_params + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item/rule_update_response.rbs b/sig/finch_api/models/hris/company/pay_statement_item/rule_update_response.rbs new file mode 100644 index 00000000..c2a65bfa --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item/rule_update_response.rbs @@ -0,0 +1,139 @@ +module FinchAPI + module Models + module HRIS + module Company + module PayStatementItem + type rule_update_response = + { + id: String, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes, + conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition], + created_at: Time, + effective_end_date: String?, + effective_start_date: String?, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::entity_type, + priority: Integer, + updated_at: Time + } + + class RuleUpdateResponse < FinchAPI::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes? + + def attributes=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes + + attr_reader conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition]? + + def conditions=: ( + ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition] + ) -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition] + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_accessor effective_end_date: String? + + attr_accessor effective_start_date: String? + + attr_reader entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::entity_type? + + def entity_type=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::entity_type + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::entity_type + + attr_reader priority: Integer? + + def priority=: (Integer) -> Integer + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + ?id: String, + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes, + ?conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition], + ?created_at: Time, + ?effective_end_date: String?, + ?effective_start_date: String?, + ?entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::entity_type, + ?priority: Integer, + ?updated_at: Time + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::rule_update_response + + type attributes = { metadata: ::Hash[Symbol, top] } + + class Attributes < FinchAPI::Internal::Type::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: (?metadata: ::Hash[Symbol, top]) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::attributes + end + + type condition = + { + field: String, + operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::operator, + value: String + } + + class Condition < FinchAPI::Internal::Type::BaseModel + attr_reader field: String? + + def field=: (String) -> String + + attr_reader operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::operator? + + def operator=: ( + FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::operator + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::operator + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?field: String, + ?operator: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::operator, + ?value: String + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::condition + + type operator = :equals + + module Operator + extend FinchAPI::Internal::Type::Enum + + EQUALS: :equals + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition::operator] + end + end + + type entity_type = :pay_statement_item + + module EntityType + extend FinchAPI::Internal::Type::Enum + + PAY_STATEMENT_ITEM: :pay_statement_item + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::entity_type] + end + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item_list_params.rbs b/sig/finch_api/models/hris/company/pay_statement_item_list_params.rbs new file mode 100644 index 00000000..d558e1a9 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item_list_params.rbs @@ -0,0 +1,69 @@ +module FinchAPI + module Models + module HRIS + module Company + type pay_statement_item_list_params = + { + categories: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category], + end_date: Date, + name: String, + start_date: Date, + type: String + } + & FinchAPI::Internal::Type::request_parameters + + class PayStatementItemListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + attr_reader categories: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category]? + + def categories=: ( + ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category] + ) -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category] + + attr_reader end_date: Date? + + def end_date=: (Date) -> Date + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader start_date: Date? + + def start_date=: (Date) -> Date + + attr_reader type: String? + + def type=: (String) -> String + + def initialize: ( + ?categories: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category], + ?end_date: Date, + ?name: String, + ?start_date: Date, + ?type: String, + ?request_options: FinchAPI::request_opts + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::pay_statement_item_list_params + + type category = + :earnings | :taxes | :employee_deductions | :employer_contributions + + module Category + extend FinchAPI::Internal::Type::Enum + + EARNINGS: :earnings + TAXES: :taxes + EMPLOYEE_DEDUCTIONS: :employee_deductions + EMPLOYER_CONTRIBUTIONS: :employer_contributions + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category] + end + end + end + end + end +end diff --git a/sig/finch_api/models/hris/company/pay_statement_item_list_response.rbs b/sig/finch_api/models/hris/company/pay_statement_item_list_response.rbs new file mode 100644 index 00000000..d0851b80 --- /dev/null +++ b/sig/finch_api/models/hris/company/pay_statement_item_list_response.rbs @@ -0,0 +1,76 @@ +module FinchAPI + module Models + module HRIS + module Company + type pay_statement_item_list_response = + { + attributes: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes, + category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::category, + name: String + } + + class PayStatementItemListResponse < FinchAPI::Internal::Type::BaseModel + attr_reader attributes: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes? + + def attributes=: ( + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes + ) -> FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes + + attr_reader category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::category? + + def category=: ( + FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::category + ) -> FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::category + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes, + ?category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::category, + ?name: String + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::pay_statement_item_list_response + + type attributes = + { employer: bool?, metadata: top?, pre_tax: bool?, type: String? } + + class Attributes < FinchAPI::Internal::Type::BaseModel + attr_accessor employer: bool? + + attr_accessor metadata: top? + + attr_accessor pre_tax: bool? + + attr_accessor type: String? + + def initialize: ( + ?employer: bool?, + ?metadata: top?, + ?pre_tax: bool?, + ?type: String? + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::attributes + end + + type category = + :earnings | :taxes | :employee_deductions | :employer_contributions + + module Category + extend FinchAPI::Internal::Type::Enum + + EARNINGS: :earnings + TAXES: :taxes + EMPLOYEE_DEDUCTIONS: :employee_deductions + EMPLOYER_CONTRIBUTIONS: :employer_contributions + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::category] + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/company_benefit.rbs b/sig/finch_api/models/hris/company_benefit.rbs similarity index 92% rename from sig/finch-api/models/hris/company_benefit.rbs rename to sig/finch_api/models/hris/company_benefit.rbs index 5315f436..2dc49a0f 100644 --- a/sig/finch-api/models/hris/company_benefit.rbs +++ b/sig/finch_api/models/hris/company_benefit.rbs @@ -9,7 +9,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::benefit_type? } - class CompanyBenefit < FinchAPI::BaseModel + class CompanyBenefit < FinchAPI::Internal::Type::BaseModel attr_accessor benefit_id: String attr_accessor description: String? diff --git a/sig/finch_api/models/hris/company_retrieve_params.rbs b/sig/finch_api/models/hris/company_retrieve_params.rbs new file mode 100644 index 00000000..a6ebf242 --- /dev/null +++ b/sig/finch_api/models/hris/company_retrieve_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module HRIS + type company_retrieve_params = + { } & FinchAPI::Internal::Type::request_parameters + + class CompanyRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::HRIS::company_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/hris/create_company_benefits_response.rbs b/sig/finch_api/models/hris/create_company_benefits_response.rbs similarity index 80% rename from sig/finch-api/models/hris/create_company_benefits_response.rbs rename to sig/finch_api/models/hris/create_company_benefits_response.rbs index 5d28b37f..656d4063 100644 --- a/sig/finch-api/models/hris/create_company_benefits_response.rbs +++ b/sig/finch_api/models/hris/create_company_benefits_response.rbs @@ -3,7 +3,7 @@ module FinchAPI module HRIS type create_company_benefits_response = { benefit_id: String } - class CreateCompanyBenefitsResponse < FinchAPI::BaseModel + class CreateCompanyBenefitsResponse < FinchAPI::Internal::Type::BaseModel attr_accessor benefit_id: String def initialize: (benefit_id: String) -> void diff --git a/sig/finch-api/models/hris/directory_list_individuals_params.rbs b/sig/finch_api/models/hris/directory_list_individuals_params.rbs similarity index 62% rename from sig/finch-api/models/hris/directory_list_individuals_params.rbs rename to sig/finch_api/models/hris/directory_list_individuals_params.rbs index b5c41c85..a8570d2c 100644 --- a/sig/finch-api/models/hris/directory_list_individuals_params.rbs +++ b/sig/finch_api/models/hris/directory_list_individuals_params.rbs @@ -2,11 +2,12 @@ module FinchAPI module Models module HRIS type directory_list_individuals_params = - { limit: Integer, offset: Integer } & FinchAPI::request_parameters + { limit: Integer, offset: Integer } + & FinchAPI::Internal::Type::request_parameters - class DirectoryListIndividualsParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DirectoryListIndividualsParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader limit: Integer? diff --git a/sig/finch-api/models/hris/directory_list_params.rbs b/sig/finch_api/models/hris/directory_list_params.rbs similarity index 62% rename from sig/finch-api/models/hris/directory_list_params.rbs rename to sig/finch_api/models/hris/directory_list_params.rbs index a7ca45d0..86120246 100644 --- a/sig/finch-api/models/hris/directory_list_params.rbs +++ b/sig/finch_api/models/hris/directory_list_params.rbs @@ -2,11 +2,12 @@ module FinchAPI module Models module HRIS type directory_list_params = - { limit: Integer, offset: Integer } & FinchAPI::request_parameters + { limit: Integer, offset: Integer } + & FinchAPI::Internal::Type::request_parameters - class DirectoryListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DirectoryListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader limit: Integer? diff --git a/sig/finch-api/models/hris/document_list_params.rbs b/sig/finch_api/models/hris/document_list_params.rbs similarity index 82% rename from sig/finch-api/models/hris/document_list_params.rbs rename to sig/finch_api/models/hris/document_list_params.rbs index be825109..09e0b123 100644 --- a/sig/finch-api/models/hris/document_list_params.rbs +++ b/sig/finch_api/models/hris/document_list_params.rbs @@ -8,11 +8,11 @@ module FinchAPI offset: Integer, types: ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class DocumentListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DocumentListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader individual_ids: ::Array[String]? @@ -45,7 +45,7 @@ module FinchAPI type type_ = :w4_2020 | :w4_2005 module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2020: :w4_2020 W4_2005: :w4_2005 diff --git a/sig/finch-api/models/hris/document_list_response.rbs b/sig/finch_api/models/hris/document_list_response.rbs similarity index 89% rename from sig/finch-api/models/hris/document_list_response.rbs rename to sig/finch_api/models/hris/document_list_response.rbs index d8acfc87..6af33f08 100644 --- a/sig/finch-api/models/hris/document_list_response.rbs +++ b/sig/finch_api/models/hris/document_list_response.rbs @@ -7,7 +7,7 @@ module FinchAPI paging: FinchAPI::Models::Paging } - class DocumentListResponse < FinchAPI::BaseModel + class DocumentListResponse < FinchAPI::Internal::Type::BaseModel attr_accessor documents: ::Array[FinchAPI::Models::HRIS::DocumentResponse] attr_accessor paging: FinchAPI::Models::Paging diff --git a/sig/finch-api/models/hris/document_response.rbs b/sig/finch_api/models/hris/document_response.rbs similarity index 91% rename from sig/finch-api/models/hris/document_response.rbs rename to sig/finch_api/models/hris/document_response.rbs index e2506e98..00f02a14 100644 --- a/sig/finch-api/models/hris/document_response.rbs +++ b/sig/finch_api/models/hris/document_response.rbs @@ -10,7 +10,7 @@ module FinchAPI year: Float? } - class DocumentResponse < FinchAPI::BaseModel + class DocumentResponse < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -42,7 +42,7 @@ module FinchAPI type type_ = :w4_2020 | :w4_2005 module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2020: :w4_2020 W4_2005: :w4_2005 diff --git a/sig/finch_api/models/hris/document_retreive_params.rbs b/sig/finch_api/models/hris/document_retreive_params.rbs new file mode 100644 index 00000000..e9e5344e --- /dev/null +++ b/sig/finch_api/models/hris/document_retreive_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module HRIS + type document_retreive_params = + { } & FinchAPI::Internal::Type::request_parameters + + class DocumentRetreiveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::HRIS::document_retreive_params + end + end + end +end diff --git a/sig/finch-api/models/hris/document_retreive_response.rbs b/sig/finch_api/models/hris/document_retreive_response.rbs similarity index 87% rename from sig/finch-api/models/hris/document_retreive_response.rbs rename to sig/finch_api/models/hris/document_retreive_response.rbs index e0e55858..1b3952c8 100644 --- a/sig/finch-api/models/hris/document_retreive_response.rbs +++ b/sig/finch_api/models/hris/document_retreive_response.rbs @@ -5,7 +5,7 @@ module FinchAPI FinchAPI::Models::HRIS::W42020 | FinchAPI::Models::HRIS::W42005 module DocumentRetreiveResponse - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union def self?.variants: -> [FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005] end diff --git a/sig/finch-api/models/hris/employment_data.rbs b/sig/finch_api/models/hris/employment_data.rbs similarity index 92% rename from sig/finch-api/models/hris/employment_data.rbs rename to sig/finch_api/models/hris/employment_data.rbs index 88bafd33..f62b967f 100644 --- a/sig/finch-api/models/hris/employment_data.rbs +++ b/sig/finch_api/models/hris/employment_data.rbs @@ -25,7 +25,7 @@ module FinchAPI work_id: String? } - class EmploymentData < FinchAPI::BaseModel + class EmploymentData < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -95,7 +95,7 @@ module FinchAPI type custom_field = { name: String, value: top } - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel attr_reader name: String? def name=: (String) -> String @@ -111,7 +111,7 @@ module FinchAPI type department = { name: String? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -125,7 +125,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::EmploymentData::Employment::type_? } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::HRIS::EmploymentData::Employment::subtype? attr_accessor type: FinchAPI::Models::HRIS::EmploymentData::Employment::type_? @@ -146,7 +146,7 @@ module FinchAPI | :individual_contractor module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME: :full_time INTERN: :intern @@ -161,7 +161,7 @@ module FinchAPI type type_ = :employee | :contractor module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE: :employee CONTRACTOR: :contractor @@ -180,7 +180,7 @@ module FinchAPI | :terminated module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE: :active DECEASED: :deceased @@ -195,7 +195,7 @@ module FinchAPI type manager = { id: String } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String diff --git a/sig/finch-api/models/hris/employment_data_response.rbs b/sig/finch_api/models/hris/employment_data_response.rbs similarity index 92% rename from sig/finch-api/models/hris/employment_data_response.rbs rename to sig/finch_api/models/hris/employment_data_response.rbs index b543ac26..1c9c58b3 100644 --- a/sig/finch-api/models/hris/employment_data_response.rbs +++ b/sig/finch_api/models/hris/employment_data_response.rbs @@ -8,7 +8,7 @@ module FinchAPI individual_id: String } - class EmploymentDataResponse < FinchAPI::BaseModel + class EmploymentDataResponse < FinchAPI::Internal::Type::BaseModel attr_reader body: FinchAPI::Models::HRIS::EmploymentData? def body=: ( diff --git a/sig/finch-api/models/hris/employment_retrieve_many_params.rbs b/sig/finch_api/models/hris/employment_retrieve_many_params.rbs similarity index 72% rename from sig/finch-api/models/hris/employment_retrieve_many_params.rbs rename to sig/finch_api/models/hris/employment_retrieve_many_params.rbs index 954fc1e1..86582926 100644 --- a/sig/finch-api/models/hris/employment_retrieve_many_params.rbs +++ b/sig/finch_api/models/hris/employment_retrieve_many_params.rbs @@ -5,11 +5,11 @@ module FinchAPI { requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class EmploymentRetrieveManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class EmploymentRetrieveManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] @@ -22,7 +22,7 @@ module FinchAPI type request = { individual_id: String } - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel attr_accessor individual_id: String def initialize: (individual_id: String) -> void diff --git a/sig/finch-api/models/hris/individual.rbs b/sig/finch_api/models/hris/individual.rbs similarity index 92% rename from sig/finch-api/models/hris/individual.rbs rename to sig/finch_api/models/hris/individual.rbs index cb5aa9f4..e6121ae4 100644 --- a/sig/finch-api/models/hris/individual.rbs +++ b/sig/finch_api/models/hris/individual.rbs @@ -18,7 +18,7 @@ module FinchAPI ssn: String? } - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -71,7 +71,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::Individual::Email::type_? } - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel attr_reader data: String? def data=: (String) -> String @@ -88,7 +88,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal @@ -108,7 +108,7 @@ module FinchAPI | :decline_to_specify module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN: :asian WHITE: :white @@ -125,7 +125,7 @@ module FinchAPI type gender = :female | :male | :other | :decline_to_specify module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE: :female MALE: :male @@ -141,7 +141,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::Individual::PhoneNumber::type_? } - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel attr_accessor data: String? attr_accessor type: FinchAPI::Models::HRIS::Individual::PhoneNumber::type_? @@ -156,7 +156,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal diff --git a/sig/finch-api/models/hris/individual_in_directory.rbs b/sig/finch_api/models/hris/individual_in_directory.rbs similarity index 90% rename from sig/finch-api/models/hris/individual_in_directory.rbs rename to sig/finch_api/models/hris/individual_in_directory.rbs index 9557dba9..b031c4c1 100644 --- a/sig/finch-api/models/hris/individual_in_directory.rbs +++ b/sig/finch_api/models/hris/individual_in_directory.rbs @@ -12,7 +12,7 @@ module FinchAPI middle_name: String? } - class IndividualInDirectory < FinchAPI::BaseModel + class IndividualInDirectory < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -43,7 +43,7 @@ module FinchAPI type department = { name: String? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -53,7 +53,7 @@ module FinchAPI type manager = { id: String } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String diff --git a/sig/finch-api/models/hris/individual_response.rbs b/sig/finch_api/models/hris/individual_response.rbs similarity index 92% rename from sig/finch-api/models/hris/individual_response.rbs rename to sig/finch_api/models/hris/individual_response.rbs index fd03877f..9cc359fe 100644 --- a/sig/finch-api/models/hris/individual_response.rbs +++ b/sig/finch_api/models/hris/individual_response.rbs @@ -8,7 +8,7 @@ module FinchAPI individual_id: String } - class IndividualResponse < FinchAPI::BaseModel + class IndividualResponse < FinchAPI::Internal::Type::BaseModel attr_reader body: FinchAPI::Models::HRIS::Individual? def body=: ( diff --git a/sig/finch-api/models/hris/individual_retrieve_many_params.rbs b/sig/finch_api/models/hris/individual_retrieve_many_params.rbs similarity index 81% rename from sig/finch-api/models/hris/individual_retrieve_many_params.rbs rename to sig/finch_api/models/hris/individual_retrieve_many_params.rbs index ca12404a..81333d0d 100644 --- a/sig/finch-api/models/hris/individual_retrieve_many_params.rbs +++ b/sig/finch_api/models/hris/individual_retrieve_many_params.rbs @@ -6,11 +6,11 @@ module FinchAPI options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options?, requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class IndividualRetrieveManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualRetrieveManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options? @@ -30,7 +30,7 @@ module FinchAPI type options = { include: ::Array[String] } - class Options < FinchAPI::BaseModel + class Options < FinchAPI::Internal::Type::BaseModel attr_reader include: ::Array[String]? def include=: (::Array[String]) -> ::Array[String] @@ -42,7 +42,7 @@ module FinchAPI type request = { individual_id: String } - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel attr_reader individual_id: String? def individual_id=: (String) -> String diff --git a/sig/finch-api/models/hris/pay_statement.rbs b/sig/finch_api/models/hris/pay_statement.rbs similarity index 92% rename from sig/finch-api/models/hris/pay_statement.rbs rename to sig/finch_api/models/hris/pay_statement.rbs index f11db80e..3eece4f7 100644 --- a/sig/finch-api/models/hris/pay_statement.rbs +++ b/sig/finch_api/models/hris/pay_statement.rbs @@ -15,7 +15,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::PayStatement::type_? } - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel attr_accessor earnings: ::Array[FinchAPI::Models::HRIS::PayStatement::Earning?]? attr_accessor employee_deductions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction?]? @@ -63,7 +63,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::PayStatement::Earning::type_? } - class Earning < FinchAPI::BaseModel + class Earning < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes? @@ -92,7 +92,7 @@ module FinchAPI metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata? def metadata=: ( @@ -107,7 +107,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -134,7 +134,7 @@ module FinchAPI | :other module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum SALARY: :salary WAGE: :wage @@ -147,7 +147,7 @@ module FinchAPI BONUS: :bonus COMMISSION: :commission TIPS: :tips - NUMBER_1099: :"1099" + TYPE_1099: :"1099" OTHER: :other def self?.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Earning::type_] @@ -164,7 +164,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::benefit_type? } - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes? @@ -193,7 +193,7 @@ module FinchAPI metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata? def metadata=: ( @@ -208,7 +208,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -229,7 +229,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::benefit_type? } - class EmployerContribution < FinchAPI::BaseModel + class EmployerContribution < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes? @@ -255,7 +255,7 @@ module FinchAPI metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata? def metadata=: ( @@ -270,7 +270,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -285,7 +285,7 @@ module FinchAPI type payment_method = :check | :direct_deposit module PaymentMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECK: :check DIRECT_DEPOSIT: :direct_deposit @@ -303,7 +303,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::PayStatement::Tax::type_? } - class Tax < FinchAPI::BaseModel + class Tax < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes? @@ -332,7 +332,7 @@ module FinchAPI metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata? def metadata=: ( @@ -347,7 +347,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -361,7 +361,7 @@ module FinchAPI type type_ = :state | :federal | :local | :fica module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum STATE: :state FEDERAL: :federal @@ -375,7 +375,7 @@ module FinchAPI type type_ = :regular_payroll | :off_cycle_payroll | :one_time_payment module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum REGULAR_PAYROLL: :regular_payroll OFF_CYCLE_PAYROLL: :off_cycle_payroll diff --git a/sig/finch-api/models/hris/pay_statement_response.rbs b/sig/finch_api/models/hris/pay_statement_response.rbs similarity index 92% rename from sig/finch-api/models/hris/pay_statement_response.rbs rename to sig/finch_api/models/hris/pay_statement_response.rbs index 7896ecb1..c16b749e 100644 --- a/sig/finch-api/models/hris/pay_statement_response.rbs +++ b/sig/finch_api/models/hris/pay_statement_response.rbs @@ -8,7 +8,7 @@ module FinchAPI payment_id: String } - class PayStatementResponse < FinchAPI::BaseModel + class PayStatementResponse < FinchAPI::Internal::Type::BaseModel attr_reader body: FinchAPI::Models::HRIS::PayStatementResponseBody? def body=: ( diff --git a/sig/finch-api/models/hris/pay_statement_response_body.rbs b/sig/finch_api/models/hris/pay_statement_response_body.rbs similarity index 91% rename from sig/finch-api/models/hris/pay_statement_response_body.rbs rename to sig/finch_api/models/hris/pay_statement_response_body.rbs index 6fecade4..b23d660b 100644 --- a/sig/finch-api/models/hris/pay_statement_response_body.rbs +++ b/sig/finch_api/models/hris/pay_statement_response_body.rbs @@ -7,7 +7,7 @@ module FinchAPI pay_statements: ::Array[FinchAPI::Models::HRIS::PayStatement] } - class PayStatementResponseBody < FinchAPI::BaseModel + class PayStatementResponseBody < FinchAPI::Internal::Type::BaseModel attr_reader paging: FinchAPI::Models::Paging? def paging=: (FinchAPI::Models::Paging) -> FinchAPI::Models::Paging 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 similarity index 77% rename from sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs rename to sig/finch_api/models/hris/pay_statement_retrieve_many_params.rbs index 204eb1cf..a8ed77de 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 @@ -5,11 +5,11 @@ module FinchAPI { requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class PayStatementRetrieveManyParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PayStatementRetrieveManyParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] @@ -22,7 +22,7 @@ module FinchAPI type request = { payment_id: String, limit: Integer, offset: Integer } - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel attr_accessor payment_id: String attr_reader limit: Integer? diff --git a/sig/finch-api/models/hris/payment.rbs b/sig/finch_api/models/hris/payment.rbs similarity index 94% rename from sig/finch-api/models/hris/payment.rbs rename to sig/finch_api/models/hris/payment.rbs index 385ece1c..b8f3daab 100644 --- a/sig/finch-api/models/hris/payment.rbs +++ b/sig/finch_api/models/hris/payment.rbs @@ -17,7 +17,7 @@ module FinchAPI pay_period: FinchAPI::Models::HRIS::Payment::PayPeriod? } - class Payment < FinchAPI::BaseModel + class Payment < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -73,7 +73,7 @@ module FinchAPI | :other module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ANNUALLY: :annually SEMI_ANNUALLY: :semi_annually @@ -90,7 +90,7 @@ module FinchAPI type pay_period = { end_date: String?, start_date: String? } - class PayPeriod < FinchAPI::BaseModel + class PayPeriod < FinchAPI::Internal::Type::BaseModel attr_accessor end_date: String? attr_accessor start_date: String? diff --git a/sig/finch-api/models/hris/payment_list_params.rbs b/sig/finch_api/models/hris/payment_list_params.rbs similarity index 57% rename from sig/finch-api/models/hris/payment_list_params.rbs rename to sig/finch_api/models/hris/payment_list_params.rbs index a9f505df..40d40f40 100644 --- a/sig/finch-api/models/hris/payment_list_params.rbs +++ b/sig/finch_api/models/hris/payment_list_params.rbs @@ -2,11 +2,12 @@ module FinchAPI module Models module HRIS type payment_list_params = - { end_date: Date, start_date: Date } & FinchAPI::request_parameters + { end_date: Date, start_date: Date } + & FinchAPI::Internal::Type::request_parameters - class PaymentListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PaymentListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor end_date: Date diff --git a/sig/finch-api/models/hris/support_per_benefit_type.rbs b/sig/finch_api/models/hris/support_per_benefit_type.rbs similarity index 93% rename from sig/finch-api/models/hris/support_per_benefit_type.rbs rename to sig/finch_api/models/hris/support_per_benefit_type.rbs index 02c28d56..b37cd45a 100644 --- a/sig/finch-api/models/hris/support_per_benefit_type.rbs +++ b/sig/finch_api/models/hris/support_per_benefit_type.rbs @@ -7,7 +7,7 @@ module FinchAPI individual_benefits: FinchAPI::Models::OperationSupportMatrix } - class SupportPerBenefitType < FinchAPI::BaseModel + class SupportPerBenefitType < FinchAPI::Internal::Type::BaseModel attr_reader company_benefits: FinchAPI::Models::OperationSupportMatrix? def company_benefits=: ( diff --git a/sig/finch-api/models/hris/supported_benefit.rbs b/sig/finch_api/models/hris/supported_benefit.rbs similarity index 93% rename from sig/finch-api/models/hris/supported_benefit.rbs rename to sig/finch_api/models/hris/supported_benefit.rbs index 8aab6ca1..4af7317c 100644 --- a/sig/finch-api/models/hris/supported_benefit.rbs +++ b/sig/finch_api/models/hris/supported_benefit.rbs @@ -13,7 +13,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::benefit_type? } - class SupportedBenefit < FinchAPI::BaseModel + class SupportedBenefit < FinchAPI::Internal::Type::BaseModel attr_accessor annual_maximum: bool? attr_accessor catch_up: bool? @@ -50,7 +50,7 @@ module FinchAPI type company_contribution = :fixed | :percent module CompanyContribution - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent @@ -61,7 +61,7 @@ module FinchAPI type employee_deduction = :fixed | :percent module EmployeeDeduction - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FIXED: :fixed PERCENT: :percent @@ -72,7 +72,7 @@ module FinchAPI type hsa_contribution_limit = :individual | :family module HsaContributionLimit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL: :individual FAMILY: :family diff --git a/sig/finch-api/models/hris/update_company_benefit_response.rbs b/sig/finch_api/models/hris/update_company_benefit_response.rbs similarity index 80% rename from sig/finch-api/models/hris/update_company_benefit_response.rbs rename to sig/finch_api/models/hris/update_company_benefit_response.rbs index 7eb00d42..1874403e 100644 --- a/sig/finch-api/models/hris/update_company_benefit_response.rbs +++ b/sig/finch_api/models/hris/update_company_benefit_response.rbs @@ -3,7 +3,7 @@ module FinchAPI module HRIS type update_company_benefit_response = { benefit_id: String } - class UpdateCompanyBenefitResponse < FinchAPI::BaseModel + class UpdateCompanyBenefitResponse < FinchAPI::Internal::Type::BaseModel attr_accessor benefit_id: String def initialize: (benefit_id: String) -> void diff --git a/sig/finch-api/models/hris/w42005.rbs b/sig/finch_api/models/hris/w42005.rbs similarity index 91% rename from sig/finch-api/models/hris/w42005.rbs rename to sig/finch_api/models/hris/w42005.rbs index 4b60d8eb..5986b82e 100644 --- a/sig/finch-api/models/hris/w42005.rbs +++ b/sig/finch_api/models/hris/w42005.rbs @@ -8,7 +8,7 @@ module FinchAPI year: Float? } - class W42005 < FinchAPI::BaseModel + class W42005 < FinchAPI::Internal::Type::BaseModel attr_reader data: FinchAPI::Models::HRIS::W42005::Data? def data=: ( @@ -40,7 +40,7 @@ module FinchAPI total_number_of_allowances: Integer? } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_accessor additional_withholding: Integer? attr_reader exemption: FinchAPI::Models::HRIS::W42005::Data::exemption? @@ -70,7 +70,7 @@ module FinchAPI type exemption = :exempt | :non_exempt module Exemption - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EXEMPT: :exempt NON_EXEMPT: :non_exempt @@ -82,7 +82,7 @@ module FinchAPI :married | :married_but_withhold_at_higher_single_rate | :single module FilingStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum MARRIED: :married MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE: :married_but_withhold_at_higher_single_rate @@ -95,7 +95,7 @@ module FinchAPI type type_ = :w4_2005 module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2005: :w4_2005 diff --git a/sig/finch-api/models/hris/w42020.rbs b/sig/finch_api/models/hris/w42020.rbs similarity index 93% rename from sig/finch-api/models/hris/w42020.rbs rename to sig/finch_api/models/hris/w42020.rbs index 93732b3f..fdee4527 100644 --- a/sig/finch-api/models/hris/w42020.rbs +++ b/sig/finch_api/models/hris/w42020.rbs @@ -8,7 +8,7 @@ module FinchAPI year: Float? } - class W42020 < FinchAPI::BaseModel + class W42020 < FinchAPI::Internal::Type::BaseModel attr_reader data: FinchAPI::Models::HRIS::W42020::Data? def data=: ( @@ -43,7 +43,7 @@ module FinchAPI total_claim_dependent_and_other_credits: Integer? } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_accessor amount_for_other_dependents: Integer? attr_accessor amount_for_qualifying_children_under_17: Integer? @@ -81,7 +81,7 @@ module FinchAPI | :single_or_married_filing_separately module FilingStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum HEAD_OF_HOUSEHOLD: :head_of_household MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE: :married_filing_jointly_or_qualifying_surviving_spouse @@ -94,7 +94,7 @@ module FinchAPI type type_ = :w4_2020 module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_2020: :w4_2020 diff --git a/sig/finch-api/models/income.rbs b/sig/finch_api/models/income.rbs similarity index 91% rename from sig/finch-api/models/income.rbs rename to sig/finch_api/models/income.rbs index 47357e64..4a37673e 100644 --- a/sig/finch-api/models/income.rbs +++ b/sig/finch_api/models/income.rbs @@ -8,7 +8,7 @@ module FinchAPI unit: FinchAPI::Models::Income::unit? } - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor currency: String? @@ -38,7 +38,7 @@ module FinchAPI | :fixed module Unit - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum YEARLY: :yearly QUARTERLY: :quarterly diff --git a/sig/finch-api/models/individual_event.rbs b/sig/finch_api/models/individual_event.rbs similarity index 93% rename from sig/finch-api/models/individual_event.rbs rename to sig/finch_api/models/individual_event.rbs index 4f8e6783..960fa5e7 100644 --- a/sig/finch-api/models/individual_event.rbs +++ b/sig/finch_api/models/individual_event.rbs @@ -28,7 +28,7 @@ module FinchAPI type data = { individual_id: String } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_reader individual_id: String? def individual_id=: (String) -> String @@ -42,7 +42,7 @@ module FinchAPI :"individual.created" | :"individual.updated" | :"individual.deleted" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum INDIVIDUAL_CREATED: :"individual.created" INDIVIDUAL_UPDATED: :"individual.updated" diff --git a/sig/finch-api/models/introspection.rbs b/sig/finch_api/models/introspection.rbs similarity index 93% rename from sig/finch-api/models/introspection.rbs rename to sig/finch_api/models/introspection.rbs index c79ea354..11c0ad50 100644 --- a/sig/finch-api/models/introspection.rbs +++ b/sig/finch_api/models/introspection.rbs @@ -20,7 +20,7 @@ module FinchAPI username: String } - class Introspection < FinchAPI::BaseModel + class Introspection < FinchAPI::Internal::Type::BaseModel attr_accessor account_id: String attr_accessor authentication_methods: ::Array[FinchAPI::Models::Introspection::AuthenticationMethod] @@ -81,7 +81,7 @@ module FinchAPI type: FinchAPI::Models::Introspection::AuthenticationMethod::type_ } - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel attr_reader connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus? def connection_status=: ( @@ -109,7 +109,7 @@ module FinchAPI type connection_status = { message: String, status: FinchAPI::Models::connection_status_type } - class ConnectionStatus < FinchAPI::BaseModel + class ConnectionStatus < FinchAPI::Internal::Type::BaseModel attr_reader message: String? def message=: (String) -> String @@ -132,7 +132,7 @@ module FinchAPI :assisted | :credential | :api_token | :api_credential | :oauth module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED: :assisted CREDENTIAL: :credential @@ -147,7 +147,7 @@ module FinchAPI type client_type = :production | :development | :sandbox module ClientType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PRODUCTION: :production DEVELOPMENT: :development @@ -163,7 +163,7 @@ module FinchAPI status: FinchAPI::Models::connection_status_type } - class ConnectionStatus < FinchAPI::BaseModel + class ConnectionStatus < FinchAPI::Internal::Type::BaseModel attr_reader last_successful_sync: Time? def last_successful_sync=: (Time) -> Time @@ -190,7 +190,7 @@ module FinchAPI type connection_type = :provider | :finch module ConnectionType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PROVIDER: :provider FINCH: :finch diff --git a/sig/finch-api/models/job_completion_event.rbs b/sig/finch_api/models/job_completion_event.rbs similarity index 95% rename from sig/finch-api/models/job_completion_event.rbs rename to sig/finch_api/models/job_completion_event.rbs index e45bbf89..a2c11d87 100644 --- a/sig/finch-api/models/job_completion_event.rbs +++ b/sig/finch_api/models/job_completion_event.rbs @@ -28,7 +28,7 @@ module FinchAPI type data = { job_id: String, job_url: String } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_accessor job_id: String attr_accessor job_url: String @@ -47,7 +47,7 @@ module FinchAPI | :"job.data_sync_all.completed" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum JOB_BENEFIT_CREATE_COMPLETED: :"job.benefit_create.completed" JOB_BENEFIT_ENROLL_COMPLETED: :"job.benefit_enroll.completed" diff --git a/sig/finch-api/models/jobs/automated_async_job.rbs b/sig/finch_api/models/jobs/automated_async_job.rbs similarity index 91% rename from sig/finch-api/models/jobs/automated_async_job.rbs rename to sig/finch_api/models/jobs/automated_async_job.rbs index 78d7ee27..712380da 100644 --- a/sig/finch-api/models/jobs/automated_async_job.rbs +++ b/sig/finch_api/models/jobs/automated_async_job.rbs @@ -14,7 +14,7 @@ module FinchAPI type: FinchAPI::Models::Jobs::AutomatedAsyncJob::type_ } - class AutomatedAsyncJob < FinchAPI::BaseModel + class AutomatedAsyncJob < FinchAPI::Internal::Type::BaseModel attr_accessor completed_at: Time? attr_accessor created_at: Time @@ -49,7 +49,7 @@ module FinchAPI type params = { individual_id: String } - class Params < FinchAPI::BaseModel + class Params < FinchAPI::Internal::Type::BaseModel attr_reader individual_id: String? def individual_id=: (String) -> String @@ -68,7 +68,7 @@ module FinchAPI | :permissions_error module Status - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PENDING: :pending IN_PROGRESS: :in_progress @@ -83,7 +83,7 @@ module FinchAPI type type_ = :data_sync_all | :w4_form_employee_sync module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DATA_SYNC_ALL: :data_sync_all W4_FORM_EMPLOYEE_SYNC: :w4_form_employee_sync diff --git a/sig/finch-api/models/jobs/automated_create_params.rbs b/sig/finch_api/models/jobs/automated_create_params.rbs similarity index 77% rename from sig/finch-api/models/jobs/automated_create_params.rbs rename to sig/finch_api/models/jobs/automated_create_params.rbs index a367a41f..632d3379 100644 --- a/sig/finch-api/models/jobs/automated_create_params.rbs +++ b/sig/finch_api/models/jobs/automated_create_params.rbs @@ -6,11 +6,11 @@ module FinchAPI type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class AutomatedCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AutomatedCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_ @@ -27,7 +27,7 @@ module FinchAPI type type_ = :w4_form_employee_sync module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum W4_FORM_EMPLOYEE_SYNC: :w4_form_employee_sync @@ -36,7 +36,7 @@ module FinchAPI type params = { individual_id: String } - class Params < FinchAPI::BaseModel + class Params < FinchAPI::Internal::Type::BaseModel attr_accessor individual_id: String def initialize: (individual_id: String) -> void diff --git a/sig/finch-api/models/jobs/automated_create_response.rbs b/sig/finch_api/models/jobs/automated_create_response.rbs similarity index 90% rename from sig/finch-api/models/jobs/automated_create_response.rbs rename to sig/finch_api/models/jobs/automated_create_response.rbs index 9fc44570..41e05bac 100644 --- a/sig/finch-api/models/jobs/automated_create_response.rbs +++ b/sig/finch_api/models/jobs/automated_create_response.rbs @@ -9,7 +9,7 @@ module FinchAPI remaining_refreshes: Integer } - class AutomatedCreateResponse < FinchAPI::BaseModel + class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor allowed_refreshes: Integer attr_accessor job_id: String diff --git a/sig/finch-api/models/jobs/automated_list_params.rbs b/sig/finch_api/models/jobs/automated_list_params.rbs similarity index 62% rename from sig/finch-api/models/jobs/automated_list_params.rbs rename to sig/finch_api/models/jobs/automated_list_params.rbs index e414d532..0fa571c1 100644 --- a/sig/finch-api/models/jobs/automated_list_params.rbs +++ b/sig/finch_api/models/jobs/automated_list_params.rbs @@ -2,11 +2,12 @@ module FinchAPI module Models module Jobs type automated_list_params = - { limit: Integer, offset: Integer } & FinchAPI::request_parameters + { limit: Integer, offset: Integer } + & FinchAPI::Internal::Type::request_parameters - class AutomatedListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AutomatedListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader limit: Integer? diff --git a/sig/finch-api/models/jobs/automated_list_response.rbs b/sig/finch_api/models/jobs/automated_list_response.rbs similarity index 91% rename from sig/finch-api/models/jobs/automated_list_response.rbs rename to sig/finch_api/models/jobs/automated_list_response.rbs index db32886c..aadd8fea 100644 --- a/sig/finch-api/models/jobs/automated_list_response.rbs +++ b/sig/finch_api/models/jobs/automated_list_response.rbs @@ -7,7 +7,7 @@ module FinchAPI meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta } - class AutomatedListResponse < FinchAPI::BaseModel + class AutomatedListResponse < FinchAPI::Internal::Type::BaseModel attr_accessor data: ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob] attr_accessor meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta @@ -24,7 +24,7 @@ module FinchAPI quotas: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas } - class Meta < FinchAPI::BaseModel + class Meta < FinchAPI::Internal::Type::BaseModel attr_reader quotas: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas? def quotas=: ( @@ -42,7 +42,7 @@ module FinchAPI data_sync_all: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll } - class Quotas < FinchAPI::BaseModel + class Quotas < FinchAPI::Internal::Type::BaseModel attr_reader data_sync_all: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll? def data_sync_all=: ( @@ -58,7 +58,7 @@ module FinchAPI type data_sync_all = { allowed_refreshes: Integer, remaining_refreshes: Integer } - class DataSyncAll < FinchAPI::BaseModel + class DataSyncAll < FinchAPI::Internal::Type::BaseModel attr_reader allowed_refreshes: Integer? def allowed_refreshes=: (Integer) -> Integer diff --git a/sig/finch_api/models/jobs/automated_retrieve_params.rbs b/sig/finch_api/models/jobs/automated_retrieve_params.rbs new file mode 100644 index 00000000..6b3ffe2f --- /dev/null +++ b/sig/finch_api/models/jobs/automated_retrieve_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module Jobs + type automated_retrieve_params = + { } & FinchAPI::Internal::Type::request_parameters + + class AutomatedRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/jobs/manual_async_job.rbs b/sig/finch_api/models/jobs/manual_async_job.rbs similarity index 89% rename from sig/finch-api/models/jobs/manual_async_job.rbs rename to sig/finch_api/models/jobs/manual_async_job.rbs index aadf6f21..af87acbb 100644 --- a/sig/finch-api/models/jobs/manual_async_job.rbs +++ b/sig/finch_api/models/jobs/manual_async_job.rbs @@ -8,7 +8,7 @@ module FinchAPI status: FinchAPI::Models::Jobs::ManualAsyncJob::status } - class ManualAsyncJob < FinchAPI::BaseModel + class ManualAsyncJob < FinchAPI::Internal::Type::BaseModel attr_accessor body: ::Array[top]? attr_accessor job_id: String @@ -26,7 +26,7 @@ module FinchAPI type status = :pending | :in_progress | :error | :complete module Status - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PENDING: :pending IN_PROGRESS: :in_progress diff --git a/sig/finch_api/models/jobs/manual_retrieve_params.rbs b/sig/finch_api/models/jobs/manual_retrieve_params.rbs new file mode 100644 index 00000000..1b6b6c08 --- /dev/null +++ b/sig/finch_api/models/jobs/manual_retrieve_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module Jobs + type manual_retrieve_params = + { } & FinchAPI::Internal::Type::request_parameters + + class ManualRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::Jobs::manual_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/location.rbs b/sig/finch_api/models/location.rbs similarity index 93% rename from sig/finch-api/models/location.rbs rename to sig/finch_api/models/location.rbs index a77a748a..ab01e614 100644 --- a/sig/finch-api/models/location.rbs +++ b/sig/finch_api/models/location.rbs @@ -12,7 +12,7 @@ module FinchAPI state: String? } - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel attr_accessor city: String? attr_accessor country: String? diff --git a/sig/finch-api/models/money.rbs b/sig/finch_api/models/money.rbs similarity index 86% rename from sig/finch-api/models/money.rbs rename to sig/finch_api/models/money.rbs index bc163b02..0a741e41 100644 --- a/sig/finch-api/models/money.rbs +++ b/sig/finch_api/models/money.rbs @@ -2,7 +2,7 @@ module FinchAPI module Models type money = { amount: Integer?, currency: String } - class Money < FinchAPI::BaseModel + class Money < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_reader currency: String? diff --git a/sig/finch-api/models/operation_support.rbs b/sig/finch_api/models/operation_support.rbs similarity index 91% rename from sig/finch-api/models/operation_support.rbs rename to sig/finch_api/models/operation_support.rbs index 55fd1aab..a6b35779 100644 --- a/sig/finch-api/models/operation_support.rbs +++ b/sig/finch_api/models/operation_support.rbs @@ -7,7 +7,7 @@ module FinchAPI | :client_access_only module OperationSupport - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum SUPPORTED: :supported NOT_SUPPORTED_BY_FINCH: :not_supported_by_finch diff --git a/sig/finch-api/models/operation_support_matrix.rbs b/sig/finch_api/models/operation_support_matrix.rbs similarity index 94% rename from sig/finch-api/models/operation_support_matrix.rbs rename to sig/finch_api/models/operation_support_matrix.rbs index d75af6e9..0f81de44 100644 --- a/sig/finch-api/models/operation_support_matrix.rbs +++ b/sig/finch_api/models/operation_support_matrix.rbs @@ -8,7 +8,7 @@ module FinchAPI update: FinchAPI::Models::operation_support } - class OperationSupportMatrix < FinchAPI::BaseModel + class OperationSupportMatrix < FinchAPI::Internal::Type::BaseModel attr_reader create: FinchAPI::Models::operation_support? def create=: ( diff --git a/sig/finch-api/models/paging.rbs b/sig/finch_api/models/paging.rbs similarity index 87% rename from sig/finch-api/models/paging.rbs rename to sig/finch_api/models/paging.rbs index 5c2ec264..c5b3918c 100644 --- a/sig/finch-api/models/paging.rbs +++ b/sig/finch_api/models/paging.rbs @@ -2,7 +2,7 @@ module FinchAPI module Models type paging = { count: Integer, offset: Integer } - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel attr_reader count: Integer? def count=: (Integer) -> Integer diff --git a/sig/finch-api/models/pay_statement_event.rbs b/sig/finch_api/models/pay_statement_event.rbs similarity index 94% rename from sig/finch-api/models/pay_statement_event.rbs rename to sig/finch_api/models/pay_statement_event.rbs index 8ecfbf4a..3216a869 100644 --- a/sig/finch-api/models/pay_statement_event.rbs +++ b/sig/finch_api/models/pay_statement_event.rbs @@ -28,7 +28,7 @@ module FinchAPI type data = { individual_id: String, payment_id: String } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_reader individual_id: String? def individual_id=: (String) -> String @@ -48,7 +48,7 @@ module FinchAPI | :"pay_statement.deleted" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PAY_STATEMENT_CREATED: :"pay_statement.created" PAY_STATEMENT_UPDATED: :"pay_statement.updated" diff --git a/sig/finch-api/models/payment_event.rbs b/sig/finch_api/models/payment_event.rbs similarity index 93% rename from sig/finch-api/models/payment_event.rbs rename to sig/finch_api/models/payment_event.rbs index 252c7d00..999abc8b 100644 --- a/sig/finch-api/models/payment_event.rbs +++ b/sig/finch_api/models/payment_event.rbs @@ -28,7 +28,7 @@ module FinchAPI type data = { pay_date: String, payment_id: String } - class Data < FinchAPI::BaseModel + class Data < FinchAPI::Internal::Type::BaseModel attr_accessor pay_date: String attr_accessor payment_id: String @@ -42,7 +42,7 @@ module FinchAPI :"payment.created" | :"payment.updated" | :"payment.deleted" module EventType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum PAYMENT_CREATED: :"payment.created" PAYMENT_UPDATED: :"payment.updated" diff --git a/sig/finch-api/models/payroll/pay_group_list_params.rbs b/sig/finch_api/models/payroll/pay_group_list_params.rbs similarity index 71% rename from sig/finch-api/models/payroll/pay_group_list_params.rbs rename to sig/finch_api/models/payroll/pay_group_list_params.rbs index f8680b17..3d0c94e4 100644 --- a/sig/finch-api/models/payroll/pay_group_list_params.rbs +++ b/sig/finch_api/models/payroll/pay_group_list_params.rbs @@ -3,11 +3,11 @@ module FinchAPI module Payroll type pay_group_list_params = { individual_id: String, pay_frequencies: ::Array[String] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class PayGroupListParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PayGroupListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader individual_id: String? diff --git a/sig/finch-api/models/payroll/pay_group_list_response.rbs b/sig/finch_api/models/payroll/pay_group_list_response.rbs similarity index 93% rename from sig/finch-api/models/payroll/pay_group_list_response.rbs rename to sig/finch_api/models/payroll/pay_group_list_response.rbs index 4604e029..df9378e7 100644 --- a/sig/finch-api/models/payroll/pay_group_list_response.rbs +++ b/sig/finch_api/models/payroll/pay_group_list_response.rbs @@ -8,7 +8,7 @@ module FinchAPI pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] } - class PayGroupListResponse < FinchAPI::BaseModel + class PayGroupListResponse < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -43,7 +43,7 @@ module FinchAPI | :other module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ANNUALLY: :annually SEMI_ANNUALLY: :semi_annually diff --git a/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs b/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs new file mode 100644 index 00000000..915ce055 --- /dev/null +++ b/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + module Payroll + type pay_group_retrieve_params = + { } & FinchAPI::Internal::Type::request_parameters + + class PayGroupRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::Payroll::pay_group_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs b/sig/finch_api/models/payroll/pay_group_retrieve_response.rbs similarity index 92% rename from sig/finch-api/models/payroll/pay_group_retrieve_response.rbs rename to sig/finch_api/models/payroll/pay_group_retrieve_response.rbs index 25ef7ffd..c4544a3d 100644 --- a/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs +++ b/sig/finch_api/models/payroll/pay_group_retrieve_response.rbs @@ -9,7 +9,7 @@ module FinchAPI pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] } - class PayGroupRetrieveResponse < FinchAPI::BaseModel + class PayGroupRetrieveResponse < FinchAPI::Internal::Type::BaseModel attr_accessor id: String attr_accessor individual_ids: ::Array[String] @@ -39,7 +39,7 @@ module FinchAPI | :other module PayFrequency - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ANNUALLY: :annually SEMI_ANNUALLY: :semi_annually diff --git a/sig/finch-api/models/provider.rbs b/sig/finch_api/models/provider.rbs similarity index 95% rename from sig/finch-api/models/provider.rbs rename to sig/finch_api/models/provider.rbs index 10f6b411..026e696a 100644 --- a/sig/finch-api/models/provider.rbs +++ b/sig/finch_api/models/provider.rbs @@ -14,7 +14,7 @@ module FinchAPI products: ::Array[String] } - class Provider < FinchAPI::BaseModel + class Provider < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -79,7 +79,7 @@ module FinchAPI type: FinchAPI::Models::Provider::AuthenticationMethod::type_ } - class AuthenticationMethod < FinchAPI::BaseModel + class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel attr_accessor benefits_support: FinchAPI::Models::HRIS::BenefitsSupport? attr_accessor supported_fields: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields? @@ -109,7 +109,7 @@ module FinchAPI payment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment } - class SupportedFields < FinchAPI::BaseModel + class SupportedFields < FinchAPI::Internal::Type::BaseModel attr_reader company: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company? def company=: ( @@ -177,7 +177,7 @@ module FinchAPI primary_phone_number: bool } - class Company < FinchAPI::BaseModel + class Company < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -245,7 +245,7 @@ module FinchAPI routing_number: bool } - class Accounts < FinchAPI::BaseModel + class Accounts < FinchAPI::Internal::Type::BaseModel attr_reader account_name: bool? def account_name=: (bool) -> bool @@ -283,7 +283,7 @@ module FinchAPI parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent } - class Departments < FinchAPI::BaseModel + class Departments < FinchAPI::Internal::Type::BaseModel attr_reader name: bool? def name=: (bool) -> bool @@ -303,7 +303,7 @@ module FinchAPI type parent = { name: bool } - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel attr_reader name: bool? def name=: (bool) -> bool @@ -316,7 +316,7 @@ module FinchAPI type entity = { subtype: bool, type: bool } - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel attr_reader subtype: bool? def subtype=: (bool) -> bool @@ -340,7 +340,7 @@ module FinchAPI state: bool } - class Locations < FinchAPI::BaseModel + class Locations < FinchAPI::Internal::Type::BaseModel attr_reader city: bool? def city=: (bool) -> bool @@ -384,7 +384,7 @@ module FinchAPI paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging } - class Directory < FinchAPI::BaseModel + class Directory < FinchAPI::Internal::Type::BaseModel attr_reader individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals? def individuals=: ( @@ -415,7 +415,7 @@ module FinchAPI middle_name: bool } - class Individuals < FinchAPI::BaseModel + class Individuals < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -460,7 +460,7 @@ module FinchAPI type manager = { id: bool } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -473,7 +473,7 @@ module FinchAPI type paging = { count: bool, offset: bool } - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel attr_reader count: bool? def count=: (bool) -> bool @@ -509,7 +509,7 @@ module FinchAPI title: bool } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -612,7 +612,7 @@ module FinchAPI type department = { name: bool } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_reader name: bool? def name=: (bool) -> bool @@ -624,7 +624,7 @@ module FinchAPI type employment = { subtype: bool, type: bool } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_reader subtype: bool? def subtype=: (bool) -> bool @@ -640,7 +640,7 @@ module FinchAPI type income = { amount: bool, currency: bool, unit: bool } - class Income < FinchAPI::BaseModel + class Income < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -672,7 +672,7 @@ module FinchAPI state: bool } - class Location < FinchAPI::BaseModel + class Location < FinchAPI::Internal::Type::BaseModel attr_reader city: bool? def city=: (bool) -> bool @@ -711,7 +711,7 @@ module FinchAPI type manager = { id: bool } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -739,7 +739,7 @@ module FinchAPI ssn: bool } - class Individual < FinchAPI::BaseModel + class Individual < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -818,7 +818,7 @@ module FinchAPI type emails = { data: bool, type: bool } - class Emails < FinchAPI::BaseModel + class Emails < FinchAPI::Internal::Type::BaseModel attr_reader data: bool? def data=: (bool) -> bool @@ -834,7 +834,7 @@ module FinchAPI type phone_numbers = { data: bool, type: bool } - class PhoneNumbers < FinchAPI::BaseModel + class PhoneNumbers < FinchAPI::Internal::Type::BaseModel attr_reader data: bool? def data=: (bool) -> bool @@ -858,7 +858,7 @@ module FinchAPI state: bool } - class Residence < FinchAPI::BaseModel + class Residence < FinchAPI::Internal::Type::BaseModel attr_reader city: bool? def city=: (bool) -> bool @@ -904,7 +904,7 @@ module FinchAPI pay_frequencies: bool } - class PayGroup < FinchAPI::BaseModel + class PayGroup < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -937,7 +937,7 @@ module FinchAPI pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements } - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel attr_reader paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging? def paging=: ( @@ -959,7 +959,7 @@ module FinchAPI type paging = { count: bool, offset: bool } - class Paging < FinchAPI::BaseModel + class Paging < FinchAPI::Internal::Type::BaseModel attr_accessor count: bool attr_accessor offset: bool @@ -983,7 +983,7 @@ module FinchAPI type: bool } - class PayStatements < FinchAPI::BaseModel + class PayStatements < FinchAPI::Internal::Type::BaseModel attr_reader earnings: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings? def earnings=: ( @@ -1050,7 +1050,7 @@ module FinchAPI type earnings = { amount: bool, currency: bool, name: bool, type: bool } - class Earnings < FinchAPI::BaseModel + class Earnings < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1086,7 +1086,7 @@ module FinchAPI type: bool } - class EmployeeDeductions < FinchAPI::BaseModel + class EmployeeDeductions < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1121,7 +1121,7 @@ module FinchAPI type employer_contributions = { amount: bool, currency: bool, name: bool } - class EmployerContributions < FinchAPI::BaseModel + class EmployerContributions < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1152,7 +1152,7 @@ module FinchAPI type: bool } - class Taxes < FinchAPI::BaseModel + class Taxes < FinchAPI::Internal::Type::BaseModel attr_reader amount: bool? def amount=: (bool) -> bool @@ -1202,7 +1202,7 @@ module FinchAPI pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod } - class Payment < FinchAPI::BaseModel + class Payment < FinchAPI::Internal::Type::BaseModel attr_reader id: bool? def id=: (bool) -> bool @@ -1272,7 +1272,7 @@ module FinchAPI type pay_period = { end_date: bool, start_date: bool } - class PayPeriod < FinchAPI::BaseModel + class PayPeriod < FinchAPI::Internal::Type::BaseModel attr_reader end_date: bool? def end_date=: (bool) -> bool @@ -1292,7 +1292,7 @@ module FinchAPI :assisted | :credential | :api_token | :api_credential | :oauth module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASSISTED: :assisted CREDENTIAL: :credential diff --git a/sig/finch_api/models/provider_list_params.rbs b/sig/finch_api/models/provider_list_params.rbs new file mode 100644 index 00000000..37e793d2 --- /dev/null +++ b/sig/finch_api/models/provider_list_params.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Models + type provider_list_params = + { } & FinchAPI::Internal::Type::request_parameters + + class ProviderListParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::provider_list_params + end + end +end diff --git a/sig/finch-api/models/request_forwarding_forward_params.rbs b/sig/finch_api/models/request_forwarding_forward_params.rbs similarity index 72% rename from sig/finch-api/models/request_forwarding_forward_params.rbs rename to sig/finch_api/models/request_forwarding_forward_params.rbs index 6f507dd6..e0b85fbc 100644 --- a/sig/finch-api/models/request_forwarding_forward_params.rbs +++ b/sig/finch_api/models/request_forwarding_forward_params.rbs @@ -8,11 +8,11 @@ module FinchAPI headers: top?, params: top? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class RequestForwardingForwardParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class RequestForwardingForwardParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor method_: String diff --git a/sig/finch-api/models/request_forwarding_forward_response.rbs b/sig/finch_api/models/request_forwarding_forward_response.rbs similarity index 90% rename from sig/finch-api/models/request_forwarding_forward_response.rbs rename to sig/finch_api/models/request_forwarding_forward_response.rbs index f610a1d2..c4f9f91a 100644 --- a/sig/finch-api/models/request_forwarding_forward_response.rbs +++ b/sig/finch_api/models/request_forwarding_forward_response.rbs @@ -8,7 +8,7 @@ module FinchAPI status_code: Integer } - class RequestForwardingForwardResponse < FinchAPI::BaseModel + class RequestForwardingForwardResponse < FinchAPI::Internal::Type::BaseModel attr_accessor data: String? attr_accessor headers: top? @@ -35,7 +35,7 @@ module FinchAPI route: String } - class Request < FinchAPI::BaseModel + class Request < FinchAPI::Internal::Type::BaseModel attr_accessor data: String? attr_accessor headers: top? diff --git a/sig/finch-api/models/sandbox/company_update_params.rbs b/sig/finch_api/models/sandbox/company_update_params.rbs similarity index 89% rename from sig/finch-api/models/sandbox/company_update_params.rbs rename to sig/finch_api/models/sandbox/company_update_params.rbs index dfc48c42..2d9c5010 100644 --- a/sig/finch-api/models/sandbox/company_update_params.rbs +++ b/sig/finch_api/models/sandbox/company_update_params.rbs @@ -12,11 +12,11 @@ module FinchAPI primary_email: String?, primary_phone_number: String? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class CompanyUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class CompanyUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]? @@ -57,7 +57,7 @@ module FinchAPI routing_number: String? } - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel attr_accessor account_name: String? attr_accessor account_number: String? @@ -81,7 +81,7 @@ module FinchAPI type account_type = :checking | :savings module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECKING: :checking SAVINGS: :savings @@ -96,7 +96,7 @@ module FinchAPI parent: FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? attr_accessor parent: FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent? @@ -110,7 +110,7 @@ module FinchAPI type parent = { name: String? } - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -125,7 +125,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_? } - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype? attr_accessor type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_? @@ -140,7 +140,7 @@ module FinchAPI type subtype = :s_corporation | :c_corporation | :b_corporation module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum S_CORPORATION: :s_corporation C_CORPORATION: :c_corporation @@ -159,7 +159,7 @@ module FinchAPI | :cooperative module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum LLC: :llc LP: :lp diff --git a/sig/finch-api/models/sandbox/company_update_response.rbs b/sig/finch_api/models/sandbox/company_update_response.rbs similarity index 92% rename from sig/finch-api/models/sandbox/company_update_response.rbs rename to sig/finch_api/models/sandbox/company_update_response.rbs index f1c9dc63..911b2b9e 100644 --- a/sig/finch-api/models/sandbox/company_update_response.rbs +++ b/sig/finch_api/models/sandbox/company_update_response.rbs @@ -13,7 +13,7 @@ module FinchAPI primary_phone_number: String? } - class CompanyUpdateResponse < FinchAPI::BaseModel + class CompanyUpdateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]? attr_accessor departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department?]? @@ -52,7 +52,7 @@ module FinchAPI routing_number: String? } - class Account < FinchAPI::BaseModel + class Account < FinchAPI::Internal::Type::BaseModel attr_accessor account_name: String? attr_accessor account_number: String? @@ -76,7 +76,7 @@ module FinchAPI type account_type = :checking | :savings module AccountType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECKING: :checking SAVINGS: :savings @@ -91,7 +91,7 @@ module FinchAPI parent: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? attr_accessor parent: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent? @@ -105,7 +105,7 @@ module FinchAPI type parent = { name: String? } - class Parent < FinchAPI::BaseModel + class Parent < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -120,7 +120,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_? } - class Entity < FinchAPI::BaseModel + class Entity < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype? attr_accessor type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_? @@ -135,7 +135,7 @@ module FinchAPI type subtype = :s_corporation | :c_corporation | :b_corporation module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum S_CORPORATION: :s_corporation C_CORPORATION: :c_corporation @@ -154,7 +154,7 @@ module FinchAPI | :cooperative module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum LLC: :llc LP: :lp diff --git a/sig/finch-api/models/sandbox/connection_create_params.rbs b/sig/finch_api/models/sandbox/connection_create_params.rbs similarity index 84% rename from sig/finch-api/models/sandbox/connection_create_params.rbs rename to sig/finch_api/models/sandbox/connection_create_params.rbs index eac61b79..7900b7a4 100644 --- a/sig/finch-api/models/sandbox/connection_create_params.rbs +++ b/sig/finch_api/models/sandbox/connection_create_params.rbs @@ -8,11 +8,11 @@ module FinchAPI employee_size: Integer, products: ::Array[String] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class ConnectionCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class ConnectionCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor provider_id: String @@ -43,7 +43,7 @@ module FinchAPI type authentication_type = :credential | :api_token | :oauth | :assisted module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL: :credential API_TOKEN: :api_token diff --git a/sig/finch-api/models/sandbox/connection_create_response.rbs b/sig/finch_api/models/sandbox/connection_create_response.rbs similarity index 93% rename from sig/finch-api/models/sandbox/connection_create_response.rbs rename to sig/finch_api/models/sandbox/connection_create_response.rbs index a42a0068..50e73a8f 100644 --- a/sig/finch-api/models/sandbox/connection_create_response.rbs +++ b/sig/finch_api/models/sandbox/connection_create_response.rbs @@ -13,7 +13,7 @@ module FinchAPI token_type: String } - class ConnectionCreateResponse < FinchAPI::BaseModel + class ConnectionCreateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor access_token: String attr_accessor account_id: String @@ -48,7 +48,7 @@ module FinchAPI type authentication_type = :credential | :api_token | :oauth | :assisted module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL: :credential API_TOKEN: :api_token diff --git a/sig/finch-api/models/sandbox/connections/account_create_params.rbs b/sig/finch_api/models/sandbox/connections/account_create_params.rbs similarity index 84% rename from sig/finch-api/models/sandbox/connections/account_create_params.rbs rename to sig/finch_api/models/sandbox/connections/account_create_params.rbs index 14d08390..957d22ac 100644 --- a/sig/finch-api/models/sandbox/connections/account_create_params.rbs +++ b/sig/finch_api/models/sandbox/connections/account_create_params.rbs @@ -9,11 +9,11 @@ module FinchAPI authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type, products: ::Array[String] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class AccountCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AccountCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor company_id: String @@ -43,7 +43,7 @@ module FinchAPI :credential | :api_token | :oauth | :assisted module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL: :credential API_TOKEN: :api_token diff --git a/sig/finch-api/models/sandbox/connections/account_create_response.rbs b/sig/finch_api/models/sandbox/connections/account_create_response.rbs similarity index 93% rename from sig/finch-api/models/sandbox/connections/account_create_response.rbs rename to sig/finch_api/models/sandbox/connections/account_create_response.rbs index 1dda3ee7..cc1f0a54 100644 --- a/sig/finch-api/models/sandbox/connections/account_create_response.rbs +++ b/sig/finch_api/models/sandbox/connections/account_create_response.rbs @@ -13,7 +13,7 @@ module FinchAPI provider_id: String } - class AccountCreateResponse < FinchAPI::BaseModel + class AccountCreateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor access_token: String attr_accessor account_id: String @@ -44,7 +44,7 @@ module FinchAPI :credential | :api_token | :oauth | :assisted module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL: :credential API_TOKEN: :api_token diff --git a/sig/finch-api/models/sandbox/connections/account_update_params.rbs b/sig/finch_api/models/sandbox/connections/account_update_params.rbs similarity index 73% rename from sig/finch-api/models/sandbox/connections/account_update_params.rbs rename to sig/finch_api/models/sandbox/connections/account_update_params.rbs index 67248df6..c7769181 100644 --- a/sig/finch-api/models/sandbox/connections/account_update_params.rbs +++ b/sig/finch_api/models/sandbox/connections/account_update_params.rbs @@ -4,11 +4,11 @@ module FinchAPI module Connections type account_update_params = { connection_status: FinchAPI::Models::connection_status_type } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class AccountUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class AccountUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader connection_status: FinchAPI::Models::connection_status_type? diff --git a/sig/finch-api/models/sandbox/connections/account_update_response.rbs b/sig/finch_api/models/sandbox/connections/account_update_response.rbs similarity index 93% rename from sig/finch-api/models/sandbox/connections/account_update_response.rbs rename to sig/finch_api/models/sandbox/connections/account_update_response.rbs index 09d2e17c..f4f1790a 100644 --- a/sig/finch-api/models/sandbox/connections/account_update_response.rbs +++ b/sig/finch_api/models/sandbox/connections/account_update_response.rbs @@ -12,7 +12,7 @@ module FinchAPI connection_id: String } - class AccountUpdateResponse < FinchAPI::BaseModel + class AccountUpdateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor account_id: String attr_accessor authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type @@ -42,7 +42,7 @@ module FinchAPI :credential | :api_token | :oauth | :assisted module AuthenticationType - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CREDENTIAL: :credential API_TOKEN: :api_token diff --git a/sig/finch-api/models/sandbox/directory_create_params.rbs b/sig/finch_api/models/sandbox/directory_create_params.rbs similarity index 92% rename from sig/finch-api/models/sandbox/directory_create_params.rbs rename to sig/finch_api/models/sandbox/directory_create_params.rbs index dbbf2c14..c5b61dd2 100644 --- a/sig/finch-api/models/sandbox/directory_create_params.rbs +++ b/sig/finch_api/models/sandbox/directory_create_params.rbs @@ -5,11 +5,11 @@ module FinchAPI { body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class DirectoryCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class DirectoryCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body]? @@ -55,7 +55,7 @@ module FinchAPI title: String? } - class Body < FinchAPI::BaseModel + class Body < FinchAPI::Internal::Type::BaseModel attr_accessor class_code: String? attr_reader custom_fields: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField]? @@ -150,7 +150,7 @@ module FinchAPI type custom_field = { name: String?, value: top } - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? attr_reader value: top? @@ -164,7 +164,7 @@ module FinchAPI type department = { name: String? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -178,7 +178,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_? } - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel attr_reader data: String? def data=: (String) -> String @@ -195,7 +195,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal @@ -210,7 +210,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_? } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype? attr_accessor type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_? @@ -231,7 +231,7 @@ module FinchAPI | :individual_contractor module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME: :full_time INTERN: :intern @@ -246,7 +246,7 @@ module FinchAPI type type_ = :employee | :contractor module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE: :employee CONTRACTOR: :contractor @@ -265,7 +265,7 @@ module FinchAPI | :terminated module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE: :active DECEASED: :deceased @@ -289,7 +289,7 @@ module FinchAPI | :decline_to_specify module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN: :asian WHITE: :white @@ -306,7 +306,7 @@ module FinchAPI type gender = :female | :male | :other | :decline_to_specify module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE: :female MALE: :male @@ -318,7 +318,7 @@ module FinchAPI type manager = { id: String } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -334,7 +334,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_? } - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel attr_accessor data: String? attr_accessor type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_? @@ -349,7 +349,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal diff --git a/sig/finch-api/models/sandbox/directory_create_response.rbs b/sig/finch_api/models/sandbox/directory_create_response.rbs similarity index 100% rename from sig/finch-api/models/sandbox/directory_create_response.rbs rename to sig/finch_api/models/sandbox/directory_create_response.rbs diff --git a/sig/finch-api/models/sandbox/employment_update_params.rbs b/sig/finch_api/models/sandbox/employment_update_params.rbs similarity index 90% rename from sig/finch-api/models/sandbox/employment_update_params.rbs rename to sig/finch_api/models/sandbox/employment_update_params.rbs index 00620e89..df3214ff 100644 --- a/sig/finch-api/models/sandbox/employment_update_params.rbs +++ b/sig/finch_api/models/sandbox/employment_update_params.rbs @@ -22,11 +22,11 @@ module FinchAPI start_date: String?, title: String? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class EmploymentUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor class_code: String? @@ -96,7 +96,7 @@ module FinchAPI type custom_field = { name: String?, value: top } - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? attr_reader value: top? @@ -110,7 +110,7 @@ module FinchAPI type department = { name: String? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -124,7 +124,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_? } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype? attr_accessor type: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_? @@ -145,7 +145,7 @@ module FinchAPI | :individual_contractor module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME: :full_time INTERN: :intern @@ -160,7 +160,7 @@ module FinchAPI type type_ = :employee | :contractor module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE: :employee CONTRACTOR: :contractor @@ -179,7 +179,7 @@ module FinchAPI | :terminated module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE: :active DECEASED: :deceased @@ -194,7 +194,7 @@ module FinchAPI type manager = { id: String } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String diff --git a/sig/finch-api/models/sandbox/employment_update_response.rbs b/sig/finch_api/models/sandbox/employment_update_response.rbs similarity index 93% rename from sig/finch-api/models/sandbox/employment_update_response.rbs rename to sig/finch_api/models/sandbox/employment_update_response.rbs index 9360ac59..b6d0629e 100644 --- a/sig/finch-api/models/sandbox/employment_update_response.rbs +++ b/sig/finch_api/models/sandbox/employment_update_response.rbs @@ -24,7 +24,7 @@ module FinchAPI title: String? } - class EmploymentUpdateResponse < FinchAPI::BaseModel + class EmploymentUpdateResponse < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -97,7 +97,7 @@ module FinchAPI type custom_field = { name: String?, value: top } - class CustomField < FinchAPI::BaseModel + class CustomField < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? attr_reader value: top? @@ -111,7 +111,7 @@ module FinchAPI type department = { name: String? } - class Department < FinchAPI::BaseModel + class Department < FinchAPI::Internal::Type::BaseModel attr_accessor name: String? def initialize: (?name: String?) -> void @@ -125,7 +125,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_? } - class Employment < FinchAPI::BaseModel + class Employment < FinchAPI::Internal::Type::BaseModel attr_accessor subtype: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype? attr_accessor type: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_? @@ -146,7 +146,7 @@ module FinchAPI | :individual_contractor module Subtype - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FULL_TIME: :full_time INTERN: :intern @@ -161,7 +161,7 @@ module FinchAPI type type_ = :employee | :contractor module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum EMPLOYEE: :employee CONTRACTOR: :contractor @@ -180,7 +180,7 @@ module FinchAPI | :terminated module EmploymentStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ACTIVE: :active DECEASED: :deceased @@ -195,7 +195,7 @@ module FinchAPI type manager = { id: String } - class Manager < FinchAPI::BaseModel + class Manager < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String diff --git a/sig/finch-api/models/sandbox/individual_update_params.rbs b/sig/finch_api/models/sandbox/individual_update_params.rbs similarity index 89% rename from sig/finch-api/models/sandbox/individual_update_params.rbs rename to sig/finch_api/models/sandbox/individual_update_params.rbs index 60d1994d..08ba4003 100644 --- a/sig/finch-api/models/sandbox/individual_update_params.rbs +++ b/sig/finch_api/models/sandbox/individual_update_params.rbs @@ -16,11 +16,11 @@ module FinchAPI residence: FinchAPI::Models::Location?, ssn: String? } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class IndividualUpdateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class IndividualUpdateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor dob: String? @@ -70,7 +70,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_? } - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel attr_reader data: String? def data=: (String) -> String @@ -87,7 +87,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal @@ -107,7 +107,7 @@ module FinchAPI | :decline_to_specify module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN: :asian WHITE: :white @@ -124,7 +124,7 @@ module FinchAPI type gender = :female | :male | :other | :decline_to_specify module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE: :female MALE: :male @@ -140,7 +140,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_? } - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel attr_accessor data: String? attr_accessor type: FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_? @@ -155,7 +155,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal diff --git a/sig/finch-api/models/sandbox/individual_update_response.rbs b/sig/finch_api/models/sandbox/individual_update_response.rbs similarity index 93% rename from sig/finch-api/models/sandbox/individual_update_response.rbs rename to sig/finch_api/models/sandbox/individual_update_response.rbs index dc433e27..b1b2d17a 100644 --- a/sig/finch-api/models/sandbox/individual_update_response.rbs +++ b/sig/finch_api/models/sandbox/individual_update_response.rbs @@ -18,7 +18,7 @@ module FinchAPI ssn: String? } - class IndividualUpdateResponse < FinchAPI::BaseModel + class IndividualUpdateResponse < FinchAPI::Internal::Type::BaseModel attr_reader id: String? def id=: (String) -> String @@ -71,7 +71,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_? } - class Email < FinchAPI::BaseModel + class Email < FinchAPI::Internal::Type::BaseModel attr_reader data: String? def data=: (String) -> String @@ -88,7 +88,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal @@ -108,7 +108,7 @@ module FinchAPI | :decline_to_specify module Ethnicity - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ASIAN: :asian WHITE: :white @@ -125,7 +125,7 @@ module FinchAPI type gender = :female | :male | :other | :decline_to_specify module Gender - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum FEMALE: :female MALE: :male @@ -141,7 +141,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_? } - class PhoneNumber < FinchAPI::BaseModel + class PhoneNumber < FinchAPI::Internal::Type::BaseModel attr_accessor data: String? attr_accessor type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_? @@ -156,7 +156,7 @@ module FinchAPI type type_ = :work | :personal module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum WORK: :work PERSONAL: :personal diff --git a/sig/finch-api/models/sandbox/job_create_params.rbs b/sig/finch_api/models/sandbox/job_create_params.rbs similarity index 69% rename from sig/finch-api/models/sandbox/job_create_params.rbs rename to sig/finch_api/models/sandbox/job_create_params.rbs index 42d38738..b1ae643e 100644 --- a/sig/finch-api/models/sandbox/job_create_params.rbs +++ b/sig/finch_api/models/sandbox/job_create_params.rbs @@ -3,11 +3,11 @@ module FinchAPI module Sandbox type job_create_params = { type: FinchAPI::Models::Sandbox::JobCreateParams::type_ } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class JobCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class JobCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_accessor type: FinchAPI::Models::Sandbox::JobCreateParams::type_ @@ -21,7 +21,7 @@ module FinchAPI type type_ = :data_sync_all module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DATA_SYNC_ALL: :data_sync_all diff --git a/sig/finch-api/models/sandbox/job_create_response.rbs b/sig/finch_api/models/sandbox/job_create_response.rbs similarity index 91% rename from sig/finch-api/models/sandbox/job_create_response.rbs rename to sig/finch_api/models/sandbox/job_create_response.rbs index 29eb4877..7a97dc3b 100644 --- a/sig/finch-api/models/sandbox/job_create_response.rbs +++ b/sig/finch_api/models/sandbox/job_create_response.rbs @@ -9,7 +9,7 @@ module FinchAPI remaining_refreshes: Integer } - class JobCreateResponse < FinchAPI::BaseModel + class JobCreateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor allowed_refreshes: Integer attr_accessor job_id: String diff --git a/sig/finch_api/models/sandbox/jobs/configuration_retrieve_params.rbs b/sig/finch_api/models/sandbox/jobs/configuration_retrieve_params.rbs new file mode 100644 index 00000000..ffd40caa --- /dev/null +++ b/sig/finch_api/models/sandbox/jobs/configuration_retrieve_params.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Models + module Sandbox + module Jobs + type configuration_retrieve_params = + { } & FinchAPI::Internal::Type::request_parameters + + class ConfigurationRetrieveParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters + + def initialize: (?request_options: FinchAPI::request_opts) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_params + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbs b/sig/finch_api/models/sandbox/jobs/configuration_retrieve_response.rbs similarity index 100% rename from sig/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbs rename to sig/finch_api/models/sandbox/jobs/configuration_retrieve_response.rbs diff --git a/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs b/sig/finch_api/models/sandbox/jobs/configuration_update_params.rbs similarity index 61% rename from sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs rename to sig/finch_api/models/sandbox/jobs/configuration_update_params.rbs index f8b8014c..37b9c597 100644 --- a/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs +++ b/sig/finch_api/models/sandbox/jobs/configuration_update_params.rbs @@ -2,11 +2,12 @@ module FinchAPI module Models module Sandbox module Jobs - type configuration_update_params = { } & FinchAPI::request_parameters + type configuration_update_params = + { } & FinchAPI::Internal::Type::request_parameters class ConfigurationUpdateParams < FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters def initialize: (?request_options: FinchAPI::request_opts) -> void diff --git a/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs b/sig/finch_api/models/sandbox/jobs/sandbox_job_configuration.rbs similarity index 89% rename from sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs rename to sig/finch_api/models/sandbox/jobs/sandbox_job_configuration.rbs index c3c09985..d4647eff 100644 --- a/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs +++ b/sig/finch_api/models/sandbox/jobs/sandbox_job_configuration.rbs @@ -8,7 +8,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_ } - class SandboxJobConfiguration < FinchAPI::BaseModel + class SandboxJobConfiguration < FinchAPI::Internal::Type::BaseModel attr_accessor completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status attr_accessor type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_ @@ -24,7 +24,7 @@ module FinchAPI :complete | :reauth_error | :permissions_error | :error module CompletionStatus - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum COMPLETE: :complete REAUTH_ERROR: :reauth_error @@ -37,7 +37,7 @@ module FinchAPI type type_ = :data_sync_all module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum DATA_SYNC_ALL: :data_sync_all diff --git a/sig/finch-api/models/sandbox/payment_create_params.rbs b/sig/finch_api/models/sandbox/payment_create_params.rbs similarity index 92% rename from sig/finch-api/models/sandbox/payment_create_params.rbs rename to sig/finch_api/models/sandbox/payment_create_params.rbs index 5e90cb1c..2b90d74c 100644 --- a/sig/finch-api/models/sandbox/payment_create_params.rbs +++ b/sig/finch_api/models/sandbox/payment_create_params.rbs @@ -7,11 +7,11 @@ module FinchAPI pay_statements: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], start_date: String } - & FinchAPI::request_parameters + & FinchAPI::Internal::Type::request_parameters - class PaymentCreateParams < FinchAPI::BaseModel - extend FinchAPI::Type::RequestParameters::Converter - include FinchAPI::RequestParameters + class PaymentCreateParams < FinchAPI::Internal::Type::BaseModel + extend FinchAPI::Internal::Type::RequestParameters::Converter + include FinchAPI::Internal::Type::RequestParameters attr_reader end_date: String? @@ -50,7 +50,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::type_? } - class PayStatement < FinchAPI::BaseModel + class PayStatement < FinchAPI::Internal::Type::BaseModel attr_accessor earnings: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning?]? attr_accessor employee_deductions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction?]? @@ -98,7 +98,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_? } - class Earning < FinchAPI::BaseModel + class Earning < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes? @@ -127,7 +127,7 @@ module FinchAPI metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata? def metadata=: ( @@ -142,7 +142,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -169,7 +169,7 @@ module FinchAPI | :other module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum SALARY: :salary WAGE: :wage @@ -182,7 +182,7 @@ module FinchAPI BONUS: :bonus COMMISSION: :commission TIPS: :tips - NUMBER_1099: :"1099" + TYPE_1099: :"1099" OTHER: :other def self?.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_] @@ -199,7 +199,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::benefit_type? } - class EmployeeDeduction < FinchAPI::BaseModel + class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes? @@ -228,7 +228,7 @@ module FinchAPI metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata? def metadata=: ( @@ -243,7 +243,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -264,7 +264,7 @@ module FinchAPI type: FinchAPI::Models::HRIS::benefit_type? } - class EmployerContribution < FinchAPI::BaseModel + class EmployerContribution < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes? @@ -290,7 +290,7 @@ module FinchAPI metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata? def metadata=: ( @@ -305,7 +305,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -320,7 +320,7 @@ module FinchAPI type payment_method = :check | :direct_deposit module PaymentMethod - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum CHECK: :check DIRECT_DEPOSIT: :direct_deposit @@ -338,7 +338,7 @@ module FinchAPI type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::type_? } - class Tax < FinchAPI::BaseModel + class Tax < FinchAPI::Internal::Type::BaseModel attr_accessor amount: Integer? attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes? @@ -367,7 +367,7 @@ module FinchAPI metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata } - class Attributes < FinchAPI::BaseModel + class Attributes < FinchAPI::Internal::Type::BaseModel attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata? def metadata=: ( @@ -382,7 +382,7 @@ module FinchAPI type metadata = { metadata: ::Hash[Symbol, top] } - class Metadata < FinchAPI::BaseModel + class Metadata < FinchAPI::Internal::Type::BaseModel attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -396,7 +396,7 @@ module FinchAPI type type_ = :state | :federal | :local | :fica module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum STATE: :state FEDERAL: :federal @@ -410,7 +410,7 @@ module FinchAPI type type_ = :regular_payroll | :off_cycle_payroll | :one_time_payment module Type - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum REGULAR_PAYROLL: :regular_payroll OFF_CYCLE_PAYROLL: :off_cycle_payroll diff --git a/sig/finch-api/models/sandbox/payment_create_response.rbs b/sig/finch_api/models/sandbox/payment_create_response.rbs similarity index 84% rename from sig/finch-api/models/sandbox/payment_create_response.rbs rename to sig/finch_api/models/sandbox/payment_create_response.rbs index d26afe86..9098cefb 100644 --- a/sig/finch-api/models/sandbox/payment_create_response.rbs +++ b/sig/finch_api/models/sandbox/payment_create_response.rbs @@ -3,7 +3,7 @@ module FinchAPI module Sandbox type payment_create_response = { pay_date: String, payment_id: String } - class PaymentCreateResponse < FinchAPI::BaseModel + class PaymentCreateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor pay_date: String attr_accessor payment_id: String diff --git a/sig/finch-api/models/webhook_event.rbs b/sig/finch_api/models/webhook_event.rbs similarity index 94% rename from sig/finch-api/models/webhook_event.rbs rename to sig/finch_api/models/webhook_event.rbs index b6870bda..1cfc1fc0 100644 --- a/sig/finch-api/models/webhook_event.rbs +++ b/sig/finch_api/models/webhook_event.rbs @@ -11,7 +11,7 @@ module FinchAPI | FinchAPI::Models::PayStatementEvent module WebhookEvent - extend FinchAPI::Union + extend FinchAPI::Internal::Type::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 diff --git a/sig/finch-api/request_options.rbs b/sig/finch_api/request_options.rbs similarity index 93% rename from sig/finch-api/request_options.rbs rename to sig/finch_api/request_options.rbs index 12ac2fe0..8f2a8ade 100644 --- a/sig/finch-api/request_options.rbs +++ b/sig/finch_api/request_options.rbs @@ -12,7 +12,7 @@ module FinchAPI timeout: Float? } - class RequestOptions < FinchAPI::BaseModel + class RequestOptions < FinchAPI::Internal::Type::BaseModel def self.validate!: (self | ::Hash[Symbol, top] opts) -> void attr_accessor idempotency_key: String? diff --git a/sig/finch-api/resources/access_tokens.rbs b/sig/finch_api/resources/access_tokens.rbs similarity index 100% rename from sig/finch-api/resources/access_tokens.rbs rename to sig/finch_api/resources/access_tokens.rbs diff --git a/sig/finch-api/resources/account.rbs b/sig/finch_api/resources/account.rbs similarity index 100% rename from sig/finch-api/resources/account.rbs rename to sig/finch_api/resources/account.rbs diff --git a/sig/finch-api/resources/connect.rbs b/sig/finch_api/resources/connect.rbs similarity index 100% rename from sig/finch-api/resources/connect.rbs rename to sig/finch_api/resources/connect.rbs diff --git a/sig/finch-api/resources/connect/sessions.rbs b/sig/finch_api/resources/connect/sessions.rbs similarity index 100% rename from sig/finch-api/resources/connect/sessions.rbs rename to sig/finch_api/resources/connect/sessions.rbs diff --git a/sig/finch-api/resources/hris.rbs b/sig/finch_api/resources/hris.rbs similarity index 100% rename from sig/finch-api/resources/hris.rbs rename to sig/finch_api/resources/hris.rbs diff --git a/sig/finch-api/resources/hris/benefits.rbs b/sig/finch_api/resources/hris/benefits.rbs similarity index 86% rename from sig/finch-api/resources/hris/benefits.rbs rename to sig/finch_api/resources/hris/benefits.rbs index 6c8e932f..2579f5f8 100644 --- a/sig/finch-api/resources/hris/benefits.rbs +++ b/sig/finch_api/resources/hris/benefits.rbs @@ -24,11 +24,11 @@ module FinchAPI def list: ( ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit] + ) -> FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit] def list_supported_benefits: ( ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit] + ) -> FinchAPI::Internal::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 similarity index 75% rename from sig/finch-api/resources/hris/benefits/individuals.rbs rename to sig/finch_api/resources/hris/benefits/individuals.rbs index 7da70cdf..45bcf8c7 100644 --- a/sig/finch-api/resources/hris/benefits/individuals.rbs +++ b/sig/finch_api/resources/hris/benefits/individuals.rbs @@ -7,7 +7,7 @@ module FinchAPI String benefit_id, ?individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual] + ) -> FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual] def enrolled_ids: ( String benefit_id, @@ -18,13 +18,13 @@ module FinchAPI String benefit_id, ?individual_ids: String, ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit] + ) -> FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit] def unenroll_many: ( String benefit_id, ?individual_ids: ::Array[String], ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual] + ) -> FinchAPI::Internal::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 similarity index 75% rename from sig/finch-api/resources/hris/company.rbs rename to sig/finch_api/resources/hris/company.rbs index d4772d93..2e3ece32 100644 --- a/sig/finch-api/resources/hris/company.rbs +++ b/sig/finch_api/resources/hris/company.rbs @@ -2,6 +2,8 @@ module FinchAPI module Resources class HRIS class Company + attr_reader pay_statement_item: FinchAPI::Resources::HRIS::Company::PayStatementItem + def retrieve: ( ?request_options: FinchAPI::request_opts ) -> FinchAPI::Models::HRIS::HRISCompany diff --git a/sig/finch_api/resources/hris/company/pay_statement_item.rbs b/sig/finch_api/resources/hris/company/pay_statement_item.rbs new file mode 100644 index 00000000..00da5c7b --- /dev/null +++ b/sig/finch_api/resources/hris/company/pay_statement_item.rbs @@ -0,0 +1,22 @@ +module FinchAPI + module Resources + class HRIS + class Company + class PayStatementItem + attr_reader rules: FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules + + def list: ( + ?categories: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItemListParams::category], + ?end_date: Date, + ?name: String, + ?start_date: Date, + ?type: String, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::Company::PayStatementItemListResponse] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end + end +end diff --git a/sig/finch_api/resources/hris/company/pay_statement_item/rules.rbs b/sig/finch_api/resources/hris/company/pay_statement_item/rules.rbs new file mode 100644 index 00000000..aca0f0ba --- /dev/null +++ b/sig/finch_api/resources/hris/company/pay_statement_item/rules.rbs @@ -0,0 +1,37 @@ +module FinchAPI + module Resources + class HRIS + class Company + class PayStatementItem + class Rules + def create: ( + ?attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Attributes, + ?conditions: ::Array[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::Condition], + ?effective_end_date: String?, + ?effective_start_date: String?, + ?entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams::entity_type, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse + + def update: ( + String rule_id, + ?optional_property: top, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse + + def list: ( + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Internal::ResponsesPage[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse] + + def delete: ( + String rule_id, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end + end + end +end diff --git a/sig/finch-api/resources/hris/directory.rbs b/sig/finch_api/resources/hris/directory.rbs similarity index 77% rename from sig/finch-api/resources/hris/directory.rbs rename to sig/finch_api/resources/hris/directory.rbs index 2c8d548f..bd924689 100644 --- a/sig/finch-api/resources/hris/directory.rbs +++ b/sig/finch_api/resources/hris/directory.rbs @@ -6,7 +6,7 @@ module FinchAPI ?limit: Integer, ?offset: Integer, ?request_options: FinchAPI::request_opts - ) -> FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory] + ) -> FinchAPI::Internal::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory] alias list_individuals list diff --git a/sig/finch-api/resources/hris/documents.rbs b/sig/finch_api/resources/hris/documents.rbs similarity index 100% rename from sig/finch-api/resources/hris/documents.rbs rename to sig/finch_api/resources/hris/documents.rbs diff --git a/sig/finch-api/resources/hris/employments.rbs b/sig/finch_api/resources/hris/employments.rbs similarity index 77% rename from sig/finch-api/resources/hris/employments.rbs rename to sig/finch_api/resources/hris/employments.rbs index b8b1a3dc..78e42fb5 100644 --- a/sig/finch-api/resources/hris/employments.rbs +++ b/sig/finch_api/resources/hris/employments.rbs @@ -5,7 +5,7 @@ module FinchAPI def retrieve_many: ( requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], ?request_options: FinchAPI::request_opts - ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse] + ) -> FinchAPI::Internal::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 similarity index 82% rename from sig/finch-api/resources/hris/individuals.rbs rename to sig/finch_api/resources/hris/individuals.rbs index 68edce8b..8cda1a67 100644 --- a/sig/finch-api/resources/hris/individuals.rbs +++ b/sig/finch_api/resources/hris/individuals.rbs @@ -6,7 +6,7 @@ module FinchAPI ?options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options?, ?requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], ?request_options: FinchAPI::request_opts - ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::IndividualResponse] + ) -> FinchAPI::Internal::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 similarity index 78% rename from sig/finch-api/resources/hris/pay_statements.rbs rename to sig/finch_api/resources/hris/pay_statements.rbs index 16c8f9c0..2f31295d 100644 --- a/sig/finch-api/resources/hris/pay_statements.rbs +++ b/sig/finch_api/resources/hris/pay_statements.rbs @@ -5,7 +5,7 @@ module FinchAPI def retrieve_many: ( requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], ?request_options: FinchAPI::request_opts - ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse] + ) -> FinchAPI::Internal::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 similarity index 78% rename from sig/finch-api/resources/hris/payments.rbs rename to sig/finch_api/resources/hris/payments.rbs index ad46cd22..b1b192a3 100644 --- a/sig/finch-api/resources/hris/payments.rbs +++ b/sig/finch_api/resources/hris/payments.rbs @@ -6,7 +6,7 @@ module FinchAPI end_date: Date, start_date: Date, ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment] + ) -> FinchAPI::Internal::SinglePage[FinchAPI::Models::HRIS::Payment] def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/jobs.rbs b/sig/finch_api/resources/jobs.rbs similarity index 100% rename from sig/finch-api/resources/jobs.rbs rename to sig/finch_api/resources/jobs.rbs diff --git a/sig/finch-api/resources/jobs/automated.rbs b/sig/finch_api/resources/jobs/automated.rbs similarity index 100% rename from sig/finch-api/resources/jobs/automated.rbs rename to sig/finch_api/resources/jobs/automated.rbs diff --git a/sig/finch-api/resources/jobs/manual.rbs b/sig/finch_api/resources/jobs/manual.rbs similarity index 100% rename from sig/finch-api/resources/jobs/manual.rbs rename to sig/finch_api/resources/jobs/manual.rbs diff --git a/sig/finch-api/resources/payroll.rbs b/sig/finch_api/resources/payroll.rbs similarity index 100% rename from sig/finch-api/resources/payroll.rbs rename to sig/finch_api/resources/payroll.rbs diff --git a/sig/finch-api/resources/payroll/pay_groups.rbs b/sig/finch_api/resources/payroll/pay_groups.rbs similarity index 83% rename from sig/finch-api/resources/payroll/pay_groups.rbs rename to sig/finch_api/resources/payroll/pay_groups.rbs index d45e3439..6c305dd0 100644 --- a/sig/finch-api/resources/payroll/pay_groups.rbs +++ b/sig/finch_api/resources/payroll/pay_groups.rbs @@ -11,7 +11,7 @@ module FinchAPI ?individual_id: String, ?pay_frequencies: ::Array[String], ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::Payroll::PayGroupListResponse] + ) -> FinchAPI::Internal::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 similarity index 73% rename from sig/finch-api/resources/providers.rbs rename to sig/finch_api/resources/providers.rbs index b7d3a9af..b1481a69 100644 --- a/sig/finch-api/resources/providers.rbs +++ b/sig/finch_api/resources/providers.rbs @@ -3,7 +3,7 @@ module FinchAPI class Providers def list: ( ?request_options: FinchAPI::request_opts - ) -> FinchAPI::SinglePage[FinchAPI::Models::Provider] + ) -> FinchAPI::Internal::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 similarity index 100% rename from sig/finch-api/resources/request_forwarding.rbs rename to sig/finch_api/resources/request_forwarding.rbs diff --git a/sig/finch-api/resources/sandbox.rbs b/sig/finch_api/resources/sandbox.rbs similarity index 100% rename from sig/finch-api/resources/sandbox.rbs rename to sig/finch_api/resources/sandbox.rbs diff --git a/sig/finch-api/resources/sandbox/company.rbs b/sig/finch_api/resources/sandbox/company.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/company.rbs rename to sig/finch_api/resources/sandbox/company.rbs diff --git a/sig/finch-api/resources/sandbox/connections.rbs b/sig/finch_api/resources/sandbox/connections.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/connections.rbs rename to sig/finch_api/resources/sandbox/connections.rbs diff --git a/sig/finch-api/resources/sandbox/connections/accounts.rbs b/sig/finch_api/resources/sandbox/connections/accounts.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/connections/accounts.rbs rename to sig/finch_api/resources/sandbox/connections/accounts.rbs diff --git a/sig/finch-api/resources/sandbox/directory.rbs b/sig/finch_api/resources/sandbox/directory.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/directory.rbs rename to sig/finch_api/resources/sandbox/directory.rbs diff --git a/sig/finch-api/resources/sandbox/employment.rbs b/sig/finch_api/resources/sandbox/employment.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/employment.rbs rename to sig/finch_api/resources/sandbox/employment.rbs diff --git a/sig/finch-api/resources/sandbox/individual.rbs b/sig/finch_api/resources/sandbox/individual.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/individual.rbs rename to sig/finch_api/resources/sandbox/individual.rbs diff --git a/sig/finch-api/resources/sandbox/jobs.rbs b/sig/finch_api/resources/sandbox/jobs.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/jobs.rbs rename to sig/finch_api/resources/sandbox/jobs.rbs diff --git a/sig/finch-api/resources/sandbox/jobs/configuration.rbs b/sig/finch_api/resources/sandbox/jobs/configuration.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/jobs/configuration.rbs rename to sig/finch_api/resources/sandbox/jobs/configuration.rbs diff --git a/sig/finch-api/resources/sandbox/payment.rbs b/sig/finch_api/resources/sandbox/payment.rbs similarity index 100% rename from sig/finch-api/resources/sandbox/payment.rbs rename to sig/finch_api/resources/sandbox/payment.rbs diff --git a/sig/finch-api/resources/webhooks.rbs b/sig/finch_api/resources/webhooks.rbs similarity index 100% rename from sig/finch-api/resources/webhooks.rbs rename to sig/finch_api/resources/webhooks.rbs diff --git a/sig/finch_api/version.rbs b/sig/finch_api/version.rbs new file mode 100644 index 00000000..9c909e8c --- /dev/null +++ b/sig/finch_api/version.rbs @@ -0,0 +1,3 @@ +module FinchAPI + VERSION: String +end diff --git a/test/finch-api/client_test.rb b/test/finch_api/client_test.rb similarity index 90% rename from test/finch-api/client_test.rb rename to test/finch_api/client_test.rb index f8776415..8d823b13 100644 --- a/test/finch-api/client_test.rb +++ b/test/finch_api/client_test.rb @@ -48,7 +48,7 @@ def test_client_default_request_default_retry_attempts requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list end @@ -61,7 +61,7 @@ def test_client_given_request_default_retry_attempts requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list end @@ -73,7 +73,7 @@ def test_client_default_request_given_retry_attempts requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {max_retries: 3}) end @@ -86,7 +86,7 @@ def test_client_given_request_given_retry_attempts requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {max_retries: 4}) end @@ -99,7 +99,7 @@ def test_client_retry_after_seconds requester = MockRequester.new(500, {"retry-after" => "1.3"}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list end @@ -113,7 +113,7 @@ def test_client_retry_after_date requester = MockRequester.new(500, {"retry-after" => (Time.now + 10).httpdate}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do Thread.current.thread_variable_set(:time_now, Time.now) finch.hris.directory.list Thread.current.thread_variable_set(:time_now, nil) @@ -129,7 +129,7 @@ def test_client_retry_after_ms requester = MockRequester.new(500, {"retry-after-ms" => "1300"}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list end @@ -142,7 +142,7 @@ def test_retry_count_header requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list end @@ -155,7 +155,7 @@ def test_omit_retry_count_header requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) end @@ -168,7 +168,7 @@ def test_overwrite_retry_count_header requester = MockRequester.new(500, {}, {}) finch.requester = requester - assert_raises(FinchAPI::InternalServerError) do + assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => "42"}}) end @@ -181,7 +181,7 @@ def test_client_redirect_307 requester = MockRequester.new(307, {"location" => "/redirected"}, {}) finch.requester = requester - assert_raises(FinchAPI::APIConnectionError) do + assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {}}) end @@ -199,7 +199,7 @@ def test_client_redirect_303 requester = MockRequester.new(303, {"location" => "/redirected"}, {}) finch.requester = requester - assert_raises(FinchAPI::APIConnectionError) do + assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {}}) end @@ -214,7 +214,7 @@ def test_client_redirect_auth_keep_same_origin requester = MockRequester.new(307, {"location" => "/redirected"}, {}) finch.requester = requester - assert_raises(FinchAPI::APIConnectionError) do + assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {"Authorization" => "Bearer xyz"}}) end @@ -229,7 +229,7 @@ def test_client_redirect_auth_strip_cross_origin requester = MockRequester.new(307, {"location" => "https://example.com/redirected"}, {}) finch.requester = requester - assert_raises(FinchAPI::APIConnectionError) do + assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {"Authorization" => "Bearer xyz"}}) end diff --git a/test/finch-api/base_model_test.rb b/test/finch_api/internal/type/base_model_test.rb similarity index 75% rename from test/finch-api/base_model_test.rb rename to test/finch_api/internal/type/base_model_test.rb index a382546c..96fba90c 100644 --- a/test/finch-api/base_model_test.rb +++ b/test/finch_api/internal/type/base_model_test.rb @@ -1,28 +1,28 @@ # frozen_string_literal: true -require_relative "test_helper" +require_relative "../../test_helper" class FinchAPI::Test::PrimitiveModelTest < Minitest::Test - A = FinchAPI::ArrayOf[-> { Integer }] - H = FinchAPI::HashOf[-> { Integer }, nil?: true] + A = FinchAPI::Internal::Type::ArrayOf[-> { Integer }] + H = FinchAPI::Internal::Type::HashOf[-> { Integer }, nil?: true] module E - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum end module U - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union end - class B < FinchAPI::BaseModel + class B < FinchAPI::Internal::Type::BaseModel optional :a, Integer optional :b, B end def test_typing converters = [ - FinchAPI::Unknown, - FinchAPI::BooleanModel, + FinchAPI::Internal::Type::Unknown, + FinchAPI::Internal::Type::BooleanModel, A, H, E, @@ -32,18 +32,18 @@ def test_typing converters.each do |conv| assert_pattern do - conv => FinchAPI::Type::Converter + conv => FinchAPI::Internal::Type::Converter end end end def test_coerce cases = { - [FinchAPI::Unknown, :a] => [{yes: 1}, :a], + [FinchAPI::Internal::Type::Unknown, :a] => [{yes: 1}, :a], [NilClass, :a] => [{maybe: 1}, nil], [NilClass, nil] => [{yes: 1}, nil], - [FinchAPI::BooleanModel, true] => [{yes: 1}, true], - [FinchAPI::BooleanModel, "true"] => [{no: 1}, "true"], + [FinchAPI::Internal::Type::BooleanModel, true] => [{yes: 1}, true], + [FinchAPI::Internal::Type::BooleanModel, "true"] => [{no: 1}, "true"], [Integer, 1] => [{yes: 1}, 1], [Integer, 1.0] => [{maybe: 1}, 1], [Integer, "1"] => [{maybe: 1}, 1], @@ -68,7 +68,7 @@ def test_coerce exactness, expect = rhs state = {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} assert_pattern do - FinchAPI::Type::Converter.coerce(target, input, state: state) => ^expect + FinchAPI::Internal::Type::Converter.coerce(target, input, state: state) => ^expect state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness end end @@ -76,7 +76,7 @@ def test_coerce def test_dump cases = { - [FinchAPI::Unknown, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [FinchAPI::Internal::Type::Unknown, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, [A, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, [H, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, [E, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, @@ -85,8 +85,8 @@ def test_dump [String, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, [:b, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, [nil, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [FinchAPI::BooleanModel, true] => true, - [FinchAPI::BooleanModel, "true"] => "true", + [FinchAPI::Internal::Type::BooleanModel, true] => true, + [FinchAPI::Internal::Type::BooleanModel, "true"] => "true", [Integer, "1"] => "1", [Float, 1] => 1, [String, "one"] => "one", @@ -99,7 +99,7 @@ def test_dump target, input = _1 expect = _2 assert_pattern do - FinchAPI::Type::Converter.dump(target, input) => ^expect + FinchAPI::Internal::Type::Converter.dump(target, input) => ^expect end end end @@ -118,7 +118,7 @@ def test_coerce_errors target, input = _1 state = {strictness: :strong, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} assert_raises(_2) do - FinchAPI::Type::Converter.coerce(target, input, state: state) + FinchAPI::Internal::Type::Converter.coerce(target, input, state: state) end end end @@ -126,27 +126,27 @@ def test_coerce_errors class FinchAPI::Test::EnumModelTest < Minitest::Test module E1 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum TRUE = true end module E2 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ONE = 1 TWO = 2 end module E3 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ONE = 1.0 TWO = 2.0 end module E4 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum ONE = :one TWO = :two @@ -154,9 +154,11 @@ module E4 def test_coerce cases = { + # rubocop:disable Style/BooleanSymbol [E1, true] => [{yes: 1}, true], [E1, false] => [{no: 1}, false], [E1, :true] => [{no: 1}, :true], + # rubocop:enable Style/BooleanSymbol [E2, 1] => [{yes: 1}, 1], [E2, 1.0] => [{yes: 1}, 1], @@ -179,7 +181,7 @@ def test_coerce exactness, expect = rhs state = {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} assert_pattern do - FinchAPI::Type::Converter.coerce(target, input, state: state) => ^expect + FinchAPI::Internal::Type::Converter.coerce(target, input, state: state) => ^expect state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness end end @@ -207,21 +209,21 @@ def test_dump target, input = _1 expect = _2 assert_pattern do - FinchAPI::Type::Converter.dump(target, input) => ^expect + FinchAPI::Internal::Type::Converter.dump(target, input) => ^expect end end end end class FinchAPI::Test::CollectionModelTest < Minitest::Test - A1 = FinchAPI::ArrayOf[-> { Integer }] - H1 = FinchAPI::HashOf[Integer] + A1 = FinchAPI::Internal::Type::ArrayOf[-> { Integer }] + H1 = FinchAPI::Internal::Type::HashOf[Integer] - A2 = FinchAPI::ArrayOf[H1] - H2 = FinchAPI::HashOf[-> { A1 }] + A2 = FinchAPI::Internal::Type::ArrayOf[H1] + H2 = FinchAPI::Internal::Type::HashOf[-> { A1 }] - A3 = FinchAPI::ArrayOf[Integer, nil?: true] - H3 = FinchAPI::HashOf[Integer, nil?: true] + A3 = FinchAPI::Internal::Type::ArrayOf[Integer, nil?: true] + H3 = FinchAPI::Internal::Type::HashOf[Integer, nil?: true] def test_coerce cases = { @@ -253,7 +255,7 @@ def test_coerce exactness, expect = rhs state = {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} assert_pattern do - FinchAPI::Type::Converter.coerce(target, input, state: state) => ^expect + FinchAPI::Internal::Type::Converter.coerce(target, input, state: state) => ^expect state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness end end @@ -261,7 +263,7 @@ def test_coerce end class FinchAPI::Test::BaseModelTest < Minitest::Test - class M1 < FinchAPI::BaseModel + class M1 < FinchAPI::Internal::Type::BaseModel required :a, Integer end @@ -271,7 +273,7 @@ class M2 < M1 optional :c, String end - class M3 < FinchAPI::BaseModel + class M3 < FinchAPI::Internal::Type::BaseModel optional :c, const: :c required :d, const: :d end @@ -288,7 +290,7 @@ class M4 < M1 end end - class M5 < FinchAPI::BaseModel + class M5 < FinchAPI::Internal::Type::BaseModel request_only do required :c, const: :c end @@ -299,7 +301,7 @@ class M5 < FinchAPI::BaseModel end class M6 < M1 - required :a, FinchAPI::ArrayOf[M6] + required :a, FinchAPI::Internal::Type::ArrayOf[M6] end def test_coerce @@ -333,9 +335,9 @@ def test_coerce exactness, expect = rhs state = {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} assert_pattern do - coerced = FinchAPI::Type::Converter.coerce(target, input, state: state) + coerced = FinchAPI::Internal::Type::Converter.coerce(target, input, state: state) assert_equal(coerced, coerced) - if coerced.is_a?(FinchAPI::BaseModel) + if coerced.is_a?(FinchAPI::Internal::Type::BaseModel) coerced.to_h => ^expect else coerced => ^expect @@ -363,7 +365,7 @@ def test_dump target, input = _1 expect = _2 assert_pattern do - FinchAPI::Type::Converter.dump(target, input) => ^expect + FinchAPI::Internal::Type::Converter.dump(target, input) => ^expect end end end @@ -388,7 +390,7 @@ def test_accessors tap do target.public_send(accessor) flunk - rescue FinchAPI::ConversionError => e + rescue FinchAPI::Errors::ConversionError => e assert_kind_of(expect, e.cause) end else @@ -401,27 +403,27 @@ def test_accessors class FinchAPI::Test::UnionTest < Minitest::Test module U0 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union end module U1 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union variant const: :a variant const: 2 end - class M1 < FinchAPI::BaseModel + class M1 < FinchAPI::Internal::Type::BaseModel required :t, const: :a, api_name: :type optional :c, String end - class M2 < FinchAPI::BaseModel + class M2 < FinchAPI::Internal::Type::BaseModel required :type, const: :b optional :c, String end module U2 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union discriminator :type variant :a, M1 @@ -429,7 +431,7 @@ module U2 end module U3 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union discriminator :type variant :a, M1 @@ -437,37 +439,37 @@ module U3 end module U4 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union discriminator :type variant String variant :a, M1 end - class M3 < FinchAPI::BaseModel + class M3 < FinchAPI::Internal::Type::BaseModel optional :recur, -> { U5 } required :a, Integer end - class M4 < FinchAPI::BaseModel + class M4 < FinchAPI::Internal::Type::BaseModel optional :recur, -> { U5 } - required :a, FinchAPI::ArrayOf[-> { U5 }] + required :a, FinchAPI::Internal::Type::ArrayOf[-> { U5 }] end - class M5 < FinchAPI::BaseModel + class M5 < FinchAPI::Internal::Type::BaseModel optional :recur, -> { U5 } - required :b, FinchAPI::ArrayOf[-> { U5 }] + required :b, FinchAPI::Internal::Type::ArrayOf[-> { U5 }] end module U5 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union variant -> { M3 } variant -> { M4 } end module U6 - extend FinchAPI::Union + extend FinchAPI::Internal::Type::Union variant -> { M3 } variant -> { M5 } @@ -478,7 +480,7 @@ def test_accessors tap do model.recur flunk - rescue FinchAPI::ConversionError => e + rescue FinchAPI::Errors::ConversionError => e assert_kind_of(ArgumentError, e.cause) end end @@ -509,9 +511,9 @@ def test_coerce exactness, branched, expect = rhs state = {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} assert_pattern do - coerced = FinchAPI::Type::Converter.coerce(target, input, state: state) + coerced = FinchAPI::Internal::Type::Converter.coerce(target, input, state: state) assert_equal(coerced, coerced) - if coerced.is_a?(FinchAPI::BaseModel) + if coerced.is_a?(FinchAPI::Internal::Type::BaseModel) coerced.to_h => ^expect else coerced => ^expect @@ -525,29 +527,29 @@ def test_coerce class FinchAPI::Test::BaseModelQoLTest < Minitest::Test module E1 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum A = 1 end module E2 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum A = 1 end module E3 - extend FinchAPI::Enum + extend FinchAPI::Internal::Type::Enum A = 2 B = 3 end - class M1 < FinchAPI::BaseModel + class M1 < FinchAPI::Internal::Type::BaseModel required :a, Integer end - class M2 < FinchAPI::BaseModel + class M2 < FinchAPI::Internal::Type::BaseModel required :a, Integer, nil?: true end @@ -557,9 +559,9 @@ class M3 < M2 def test_equality cases = { - [FinchAPI::Unknown, FinchAPI::Unknown] => true, - [FinchAPI::BooleanModel, FinchAPI::BooleanModel] => true, - [FinchAPI::Unknown, FinchAPI::BooleanModel] => false, + [FinchAPI::Internal::Type::Unknown, FinchAPI::Internal::Type::Unknown] => true, + [FinchAPI::Internal::Type::BooleanModel, FinchAPI::Internal::Type::BooleanModel] => true, + [FinchAPI::Internal::Type::Unknown, FinchAPI::Internal::Type::BooleanModel] => false, [E1, E2] => true, [E1, E3] => false, [M1, M2] => false, diff --git a/test/finch-api/util_test.rb b/test/finch_api/internal/util_test.rb similarity index 74% rename from test/finch-api/util_test.rb rename to test/finch_api/internal/util_test.rb index 969d487e..981afb62 100644 --- a/test/finch-api/util_test.rb +++ b/test/finch_api/internal/util_test.rb @@ -1,48 +1,48 @@ # frozen_string_literal: true -require_relative "test_helper" +require_relative "../test_helper" class FinchAPI::Test::UtilDataHandlingTest < Minitest::Test def test_left_map assert_pattern do - FinchAPI::Util.deep_merge({a: 1}, nil) => nil + FinchAPI::Internal::Util.deep_merge({a: 1}, nil) => nil end end def test_right_map assert_pattern do - FinchAPI::Util.deep_merge(nil, {a: 1}) => {a: 1} + FinchAPI::Internal::Util.deep_merge(nil, {a: 1}) => {a: 1} end end def test_disjoint_maps assert_pattern do - FinchAPI::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} + FinchAPI::Internal::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} end end def test_overlapping_maps assert_pattern do - FinchAPI::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} + FinchAPI::Internal::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} end end def test_nested assert_pattern do - FinchAPI::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} + FinchAPI::Internal::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} end end def test_nested_left_map assert_pattern do - FinchAPI::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} + FinchAPI::Internal::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} end end def test_omission - merged = FinchAPI::Util.deep_merge( + merged = FinchAPI::Internal::Util.deep_merge( {b: {b2: 1, b3: {c: 4, d: 5}}}, - {b: {b2: 1, b3: {c: FinchAPI::Util::OMIT, d: 5}}} + {b: {b2: 1, b3: {c: FinchAPI::Internal::OMIT, d: 5}}} ) assert_pattern do @@ -51,7 +51,7 @@ def test_omission end def test_concat - merged = FinchAPI::Util.deep_merge( + merged = FinchAPI::Internal::Util.deep_merge( {a: {b: [1, 2]}}, {a: {b: [3, 4]}}, concat: true @@ -63,7 +63,7 @@ def test_concat end def test_concat_false - merged = FinchAPI::Util.deep_merge( + merged = FinchAPI::Internal::Util.deep_merge( {a: {b: [1, 2]}}, {a: {b: [3, 4]}}, concat: false @@ -76,19 +76,19 @@ def test_concat_false def test_dig assert_pattern do - FinchAPI::Util.dig(1, nil) => 1 - FinchAPI::Util.dig({a: 1}, :b) => nil - FinchAPI::Util.dig({a: 1}, :a) => 1 - FinchAPI::Util.dig({a: {b: 1}}, [:a, :b]) => 1 - - FinchAPI::Util.dig([], 1) => nil - FinchAPI::Util.dig([nil, [nil, 1]], [1, 1]) => 1 - FinchAPI::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 - FinchAPI::Util.dig([], 1.0) => nil - - FinchAPI::Util.dig(Object, 1) => nil - FinchAPI::Util.dig([], 1.0, 2) => 2 - FinchAPI::Util.dig([], 1.0) { 2 } => 2 + FinchAPI::Internal::Util.dig(1, nil) => 1 + FinchAPI::Internal::Util.dig({a: 1}, :b) => nil + FinchAPI::Internal::Util.dig({a: 1}, :a) => 1 + FinchAPI::Internal::Util.dig({a: {b: 1}}, [:a, :b]) => 1 + + FinchAPI::Internal::Util.dig([], 1) => nil + FinchAPI::Internal::Util.dig([nil, [nil, 1]], [1, 1]) => 1 + FinchAPI::Internal::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 + FinchAPI::Internal::Util.dig([], 1.0) => nil + + FinchAPI::Internal::Util.dig(Object, 1) => nil + FinchAPI::Internal::Util.dig([], 1.0, 2) => 2 + FinchAPI::Internal::Util.dig([], 1.0) { 2 } => 2 end end end @@ -100,11 +100,11 @@ def test_parsing https://example.com/ https://example.com:443/example?e1=e1&e2=e2&e= ].each do |url| - parsed = FinchAPI::Util.parse_uri(url) - unparsed = FinchAPI::Util.unparse_uri(parsed).to_s + parsed = FinchAPI::Internal::Util.parse_uri(url) + unparsed = FinchAPI::Internal::Util.unparse_uri(parsed).to_s assert_equal(url, unparsed) - assert_equal(parsed, FinchAPI::Util.parse_uri(unparsed)) + assert_equal(parsed, FinchAPI::Internal::Util.parse_uri(unparsed)) end end @@ -113,7 +113,7 @@ def test_joining [ "h://a.b/c?d=e", "h://nope/ignored", - FinchAPI::Util.parse_uri("h://a.b/c?d=e") + FinchAPI::Internal::Util.parse_uri("h://a.b/c?d=e") ], [ "h://a.b/c?d=e", @@ -129,8 +129,8 @@ def test_joining cases.each do |expect, lhs, rhs| assert_equal( URI.parse(expect), - FinchAPI::Util.join_parsed_uri( - FinchAPI::Util.parse_uri(lhs), + FinchAPI::Internal::Util.join_parsed_uri( + FinchAPI::Internal::Util.parse_uri(lhs), rhs ) ) @@ -148,8 +148,8 @@ def test_joining_queries cases.each do |path, expected| assert_equal( URI.parse(expected), - FinchAPI::Util.join_parsed_uri( - FinchAPI::Util.parse_uri(base_url), + FinchAPI::Internal::Util.join_parsed_uri( + FinchAPI::Internal::Util.parse_uri(base_url), {path: path} ) ) @@ -162,7 +162,7 @@ class FakeCGI < CGI def initialize(headers, io) @ctype = headers["content-type"] # rubocop:disable Lint/EmptyBlock - @io = FinchAPI::Util::ReadIOAdapter.new(io) {} + @io = FinchAPI::Internal::Util::ReadIOAdapter.new(io) {} # rubocop:enable Lint/EmptyBlock @c_len = io.to_a.join.bytesize.to_s super() @@ -185,7 +185,7 @@ def test_file_encode StringIO.new("abc") => "abc" } cases.each do |body, val| - encoded = FinchAPI::Util.encode_content(headers, body) + encoded = FinchAPI::Internal::Util.encode_content(headers, body) cgi = FakeCGI.new(*encoded) assert_pattern do cgi[""] => ^val @@ -202,7 +202,7 @@ def test_hash_encode {file: StringIO.new("a")} => {"file" => "a"} } cases.each do |body, testcase| - encoded = FinchAPI::Util.encode_content(headers, body) + encoded = FinchAPI::Internal::Util.encode_content(headers, body) cgi = FakeCGI.new(*encoded) testcase.each do |key, val| assert_equal(val, cgi[key]) @@ -220,7 +220,7 @@ def test_copy_read cases.each do |input, expected| io = StringIO.new # rubocop:disable Lint/EmptyBlock - adapter = FinchAPI::Util::ReadIOAdapter.new(input) {} + adapter = FinchAPI::Internal::Util::ReadIOAdapter.new(input) {} # rubocop:enable Lint/EmptyBlock IO.copy_stream(adapter, io) assert_equal(expected, io.string) @@ -233,7 +233,7 @@ def test_copy_write StringIO.new("abc") => "abc" } cases.each do |input, expected| - enum = FinchAPI::Util.string_io do |y| + enum = FinchAPI::Internal::Util.writable_enum do |y| IO.copy_stream(input, y) end assert_equal(expected, enum.to_a.join) @@ -245,7 +245,7 @@ class FinchAPI::Test::UtilFusedEnumTest < Minitest::Test def test_closing arr = [1, 2, 3] once = 0 - fused = FinchAPI::Util.fused_enum(arr.to_enum) do + fused = FinchAPI::Internal::Util.fused_enum(arr.to_enum) do once = once.succ end @@ -260,7 +260,7 @@ def test_closing def test_rewind_chain once = 0 - fused = FinchAPI::Util.fused_enum([1, 2, 3].to_enum) do + fused = FinchAPI::Internal::Util.fused_enum([1, 2, 3].to_enum) do once = once.succ end .lazy @@ -277,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, external: true) + fused = FinchAPI::Internal::Util.fused_enum(it, external: true) assert_equal(1, first) assert_equal([2, 3], fused.to_a) @@ -285,11 +285,11 @@ def test_external_iteration def test_close_fused once = 0 - fused = FinchAPI::Util.fused_enum([1, 2, 3].to_enum) do + fused = FinchAPI::Internal::Util.fused_enum([1, 2, 3].to_enum) do once = once.succ end - FinchAPI::Util.close_fused!(fused) + FinchAPI::Internal::Util.close_fused!(fused) assert_equal(1, once) assert_equal([], fused.to_a) @@ -302,11 +302,11 @@ def test_closed_fused_extern_iteration taken = taken.succ _1 end - fused = FinchAPI::Util.fused_enum(enum) + fused = FinchAPI::Internal::Util.fused_enum(enum) first = fused.next assert_equal(1, first) - FinchAPI::Util.close_fused!(fused) + FinchAPI::Internal::Util.close_fused!(fused) assert_equal(1, taken) end @@ -318,10 +318,10 @@ def test_closed_fused_taken_count end .map(&:succ) .filter(&:odd?) - fused = FinchAPI::Util.fused_enum(enum) + fused = FinchAPI::Internal::Util.fused_enum(enum) assert_equal(0, taken) - FinchAPI::Util.close_fused!(fused) + FinchAPI::Internal::Util.close_fused!(fused) assert_equal(0, taken) end @@ -337,8 +337,8 @@ def test_closed_fused_extern_iter_taken_count assert_equal(2, first) assert_equal(1, taken) - fused = FinchAPI::Util.fused_enum(enum) - FinchAPI::Util.close_fused!(fused) + fused = FinchAPI::Internal::Util.fused_enum(enum) + FinchAPI::Internal::Util.close_fused!(fused) assert_equal(1, taken) end @@ -352,12 +352,12 @@ def test_close_fused_sse_chain .filter(&:odd?) .map(&:to_s) - fused_1 = FinchAPI::Util.fused_enum(enum) - fused_2 = FinchAPI::Util.decode_lines(fused_1) - fused_3 = FinchAPI::Util.decode_sse(fused_2) + fused_1 = FinchAPI::Internal::Util.fused_enum(enum) + fused_2 = FinchAPI::Internal::Util.decode_lines(fused_1) + fused_3 = FinchAPI::Internal::Util.decode_sse(fused_2) assert_equal(0, taken) - FinchAPI::Util.close_fused!(fused_3) + FinchAPI::Internal::Util.close_fused!(fused_3) assert_equal(0, taken) end end @@ -380,7 +380,7 @@ def test_decode_lines eols = %W[\n \r \r\n] cases.each do |enum, expected| eols.each do |eol| - lines = FinchAPI::Util.decode_lines(enum.map { _1.gsub("\n", eol) }) + lines = FinchAPI::Internal::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 @@ -398,7 +398,7 @@ def test_mixed_decode_lines %W[\n\r] => %W[\n \r] } cases.each do |enum, expected| - lines = FinchAPI::Util.decode_lines(enum) + lines = FinchAPI::Internal::Util.decode_lines(enum) assert_equal(expected, lines.to_a) end end @@ -521,7 +521,7 @@ def test_decode_sse cases.each do |name, test_cases| test_cases.each do |input, expected| - actual = FinchAPI::Util.decode_sse(input).map(&:compact) + actual = FinchAPI::Internal::Util.decode_sse(input).map(&:compact) assert_equal(expected, actual, name) end end diff --git a/test/finch-api/resource_namespaces.rb b/test/finch_api/resource_namespaces.rb similarity index 68% rename from test/finch-api/resource_namespaces.rb rename to test/finch_api/resource_namespaces.rb index 79ba2bd4..233c4db5 100644 --- a/test/finch-api/resource_namespaces.rb +++ b/test/finch_api/resource_namespaces.rb @@ -6,6 +6,11 @@ module Resources module Benefits end + module Company + module PayStatementItem + end + end + module Connect end @@ -15,6 +20,11 @@ module Connections module HRIS module Benefits end + + module Company + module PayStatementItem + end + end end module Jobs @@ -23,6 +33,9 @@ module Jobs module Payroll end + module PayStatementItem + end + module Sandbox module Connections end diff --git a/test/finch-api/resources/access_tokens_test.rb b/test/finch_api/resources/access_tokens_test.rb similarity index 92% rename from test/finch-api/resources/access_tokens_test.rb rename to test/finch_api/resources/access_tokens_test.rb index 6c6f2043..326b3b93 100644 --- a/test/finch-api/resources/access_tokens_test.rb +++ b/test/finch_api/resources/access_tokens_test.rb @@ -18,7 +18,7 @@ def test_create_required_params company_id: String, connection_id: String, connection_type: FinchAPI::Models::CreateAccessTokenResponse::ConnectionType, - products: ^(FinchAPI::ArrayOf[String]), + products: ^(FinchAPI::Internal::Type::ArrayOf[String]), provider_id: String, customer_id: String | nil, token_type: String | nil diff --git a/test/finch-api/resources/account_test.rb b/test/finch_api/resources/account_test.rb similarity index 82% rename from test/finch-api/resources/account_test.rb rename to test/finch_api/resources/account_test.rb index 9ce7dd22..362c12bb 100644 --- a/test/finch-api/resources/account_test.rb +++ b/test/finch_api/resources/account_test.rb @@ -27,7 +27,7 @@ def test_introspect assert_pattern do response => { account_id: String, - authentication_methods: ^(FinchAPI::ArrayOf[FinchAPI::Models::Introspection::AuthenticationMethod]), + authentication_methods: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Introspection::AuthenticationMethod]), client_id: String, client_type: FinchAPI::Models::Introspection::ClientType, company_id: String, @@ -37,9 +37,9 @@ def test_introspect customer_email: String | nil, customer_id: String | nil, customer_name: String | nil, - manual: FinchAPI::BooleanModel, + manual: FinchAPI::Internal::Type::BooleanModel, payroll_provider_id: String, - products: ^(FinchAPI::ArrayOf[String]), + products: ^(FinchAPI::Internal::Type::ArrayOf[String]), provider_id: String, username: String } diff --git a/test/finch-api/resources/connect/sessions_test.rb b/test/finch_api/resources/connect/sessions_test.rb similarity index 100% rename from test/finch-api/resources/connect/sessions_test.rb rename to test/finch_api/resources/connect/sessions_test.rb diff --git a/test/finch-api/resources/connect_test.rb b/test/finch_api/resources/connect_test.rb similarity index 100% rename from test/finch-api/resources/connect_test.rb rename to test/finch_api/resources/connect_test.rb diff --git a/test/finch-api/resources/hris/benefits/individuals_test.rb b/test/finch_api/resources/hris/benefits/individuals_test.rb similarity index 90% rename from test/finch-api/resources/hris/benefits/individuals_test.rb rename to test/finch_api/resources/hris/benefits/individuals_test.rb index eab27de2..e2dc5c51 100644 --- a/test/finch-api/resources/hris/benefits/individuals_test.rb +++ b/test/finch_api/resources/hris/benefits/individuals_test.rb @@ -7,7 +7,7 @@ def test_enroll_many response = @finch.hris.benefits.individuals.enroll_many("benefit_id") assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -36,7 +36,7 @@ def test_enrolled_ids assert_pattern do response => { benefit_id: String, - individual_ids: ^(FinchAPI::ArrayOf[String]) + individual_ids: ^(FinchAPI::Internal::Type::ArrayOf[String]) } end end @@ -45,7 +45,7 @@ def test_retrieve_many_benefits response = @finch.hris.benefits.individuals.retrieve_many_benefits("benefit_id") assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -68,7 +68,7 @@ def test_unenroll_many response = @finch.hris.benefits.individuals.unenroll_many("benefit_id") assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first diff --git a/test/finch-api/resources/hris/benefits_test.rb b/test/finch_api/resources/hris/benefits_test.rb similarity index 70% rename from test/finch-api/resources/hris/benefits_test.rb rename to test/finch_api/resources/hris/benefits_test.rb index 2ab6ec42..e1811320 100644 --- a/test/finch-api/resources/hris/benefits_test.rb +++ b/test/finch_api/resources/hris/benefits_test.rb @@ -52,7 +52,7 @@ def test_list response = @finch.hris.benefits.list assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -76,7 +76,7 @@ def test_list_supported_benefits response = @finch.hris.benefits.list_supported_benefits assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -88,13 +88,13 @@ def test_list_supported_benefits assert_pattern do row => { - annual_maximum: FinchAPI::BooleanModel | nil, - catch_up: FinchAPI::BooleanModel | nil, - company_contribution: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution, nil?: true]) | nil, + annual_maximum: FinchAPI::Internal::Type::BooleanModel | nil, + catch_up: FinchAPI::Internal::Type::BooleanModel | nil, + company_contribution: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution, nil?: true]) | nil, description: String | nil, - employee_deduction: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true]) | nil, - frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true]) | nil, - hsa_contribution_limit: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true]) | nil, + employee_deduction: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true]) | nil, + frequencies: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true]) | nil, + hsa_contribution_limit: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true]) | nil, type: FinchAPI::Models::HRIS::BenefitType | nil } end diff --git a/test/finch_api/resources/hris/company/pay_statement_item/rules_test.rb b/test/finch_api/resources/hris/company/pay_statement_item/rules_test.rb new file mode 100644 index 00000000..9e68894f --- /dev/null +++ b/test/finch_api/resources/hris/company/pay_statement_item/rules_test.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +require_relative "../../../../test_helper" + +class FinchAPI::Test::Resources::HRIS::Company::PayStatementItem::RulesTest < FinchAPI::Test::ResourceTest + def test_create + response = @finch.hris.company.pay_statement_item.rules.create + + assert_pattern do + response => FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse + end + + assert_pattern do + response => { + id: String | nil, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Attributes | nil, + conditions: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::Condition]) | nil, + created_at: Time | nil, + effective_end_date: String | nil, + effective_start_date: String | nil, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse::EntityType | nil, + priority: Integer | nil, + updated_at: Time | nil + } + end + end + + def test_update + response = @finch.hris.company.pay_statement_item.rules.update("rule_id") + + assert_pattern do + response => FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse + end + + assert_pattern do + response => { + id: String | nil, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Attributes | nil, + conditions: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::Condition]) | nil, + created_at: Time | nil, + effective_end_date: String | nil, + effective_start_date: String | nil, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse::EntityType | nil, + priority: Integer | nil, + updated_at: Time | nil + } + end + end + + def test_list + response = @finch.hris.company.pay_statement_item.rules.list + + assert_pattern do + response => FinchAPI::Internal::ResponsesPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse + end + + assert_pattern do + row => { + id: String | nil, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Attributes | nil, + conditions: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::Condition]) | nil, + created_at: Time | nil, + effective_end_date: String | nil, + effective_start_date: String | nil, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse::EntityType | nil, + priority: Integer | nil, + updated_at: Time | nil + } + end + end + + def test_delete + response = @finch.hris.company.pay_statement_item.rules.delete("rule_id") + + assert_pattern do + response => FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse + end + + assert_pattern do + response => { + id: String | nil, + attributes: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Attributes | nil, + conditions: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::Condition]) | nil, + created_at: Time | nil, + deleted_at: Time | nil, + effective_end_date: String | nil, + effective_start_date: String | nil, + entity_type: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse::EntityType | nil, + priority: Integer | nil, + updated_at: Time | nil + } + end + end +end diff --git a/test/finch_api/resources/hris/company/pay_statement_item_test.rb b/test/finch_api/resources/hris/company/pay_statement_item_test.rb new file mode 100644 index 00000000..b666c2ce --- /dev/null +++ b/test/finch_api/resources/hris/company/pay_statement_item_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class FinchAPI::Test::Resources::HRIS::Company::PayStatementItemTest < FinchAPI::Test::ResourceTest + def test_list + response = @finch.hris.company.pay_statement_item.list + + assert_pattern do + response => FinchAPI::Internal::ResponsesPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => FinchAPI::Models::HRIS::Company::PayStatementItemListResponse + end + + assert_pattern do + row => { + attributes: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Attributes | nil, + category: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse::Category | nil, + name: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/company_test.rb b/test/finch_api/resources/hris/company_test.rb similarity index 63% rename from test/finch-api/resources/hris/company_test.rb rename to test/finch_api/resources/hris/company_test.rb index f6a7cf5b..5446faa6 100644 --- a/test/finch-api/resources/hris/company_test.rb +++ b/test/finch_api/resources/hris/company_test.rb @@ -13,12 +13,12 @@ def test_retrieve assert_pattern do response => { id: String, - accounts: ^(FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Account]) | nil, - departments: ^(FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Department, nil?: true]) | nil, + accounts: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Account]) | nil, + departments: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Department, nil?: true]) | nil, ein: String | nil, entity: FinchAPI::Models::HRIS::HRISCompany::Entity | nil, legal_name: String | nil, - locations: ^(FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true]) | nil, + locations: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Location, nil?: true]) | nil, primary_email: String | nil, primary_phone_number: String | nil } diff --git a/test/finch-api/resources/hris/directory_test.rb b/test/finch_api/resources/hris/directory_test.rb similarity index 85% rename from test/finch-api/resources/hris/directory_test.rb rename to test/finch_api/resources/hris/directory_test.rb index e463f67a..12274ddf 100644 --- a/test/finch-api/resources/hris/directory_test.rb +++ b/test/finch_api/resources/hris/directory_test.rb @@ -7,7 +7,7 @@ def test_list response = @finch.hris.directory.list assert_pattern do - response => FinchAPI::IndividualsPage + response => FinchAPI::Internal::IndividualsPage end row = response.to_enum.first @@ -22,7 +22,7 @@ def test_list id: String | nil, department: FinchAPI::Models::HRIS::IndividualInDirectory::Department | nil, first_name: String | nil, - is_active: FinchAPI::BooleanModel | nil, + is_active: FinchAPI::Internal::Type::BooleanModel | nil, last_name: String | nil, manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager | nil, middle_name: String | nil @@ -34,7 +34,7 @@ def test_list_individuals response = @finch.hris.directory.list_individuals assert_pattern do - response => FinchAPI::IndividualsPage + response => FinchAPI::Internal::IndividualsPage end row = response.to_enum.first @@ -49,7 +49,7 @@ def test_list_individuals id: String | nil, department: FinchAPI::Models::HRIS::IndividualInDirectory::Department | nil, first_name: String | nil, - is_active: FinchAPI::BooleanModel | nil, + is_active: FinchAPI::Internal::Type::BooleanModel | nil, last_name: String | nil, manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager | nil, middle_name: String | nil diff --git a/test/finch-api/resources/hris/documents_test.rb b/test/finch_api/resources/hris/documents_test.rb similarity index 90% rename from test/finch-api/resources/hris/documents_test.rb rename to test/finch_api/resources/hris/documents_test.rb index 7232d55c..1214f1dc 100644 --- a/test/finch-api/resources/hris/documents_test.rb +++ b/test/finch_api/resources/hris/documents_test.rb @@ -12,7 +12,7 @@ def test_list assert_pattern do response => { - documents: ^(FinchAPI::ArrayOf[FinchAPI::Models::HRIS::DocumentResponse]), + documents: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::DocumentResponse]), paging: FinchAPI::Models::Paging } end diff --git a/test/finch-api/resources/hris/employments_test.rb b/test/finch_api/resources/hris/employments_test.rb similarity index 92% rename from test/finch-api/resources/hris/employments_test.rb rename to test/finch_api/resources/hris/employments_test.rb index f207e5e6..51b7e085 100644 --- a/test/finch-api/resources/hris/employments_test.rb +++ b/test/finch_api/resources/hris/employments_test.rb @@ -7,7 +7,7 @@ def test_retrieve_many_required_params response = @finch.hris.employments.retrieve_many(requests: [{individual_id: "individual_id"}]) assert_pattern do - response => FinchAPI::ResponsesPage + response => FinchAPI::Internal::ResponsesPage end row = response.to_enum.first diff --git a/test/finch-api/resources/hris/individuals_test.rb b/test/finch_api/resources/hris/individuals_test.rb similarity index 91% rename from test/finch-api/resources/hris/individuals_test.rb rename to test/finch_api/resources/hris/individuals_test.rb index efc4a612..f8890ab3 100644 --- a/test/finch-api/resources/hris/individuals_test.rb +++ b/test/finch_api/resources/hris/individuals_test.rb @@ -7,7 +7,7 @@ def test_retrieve_many response = @finch.hris.individuals.retrieve_many assert_pattern do - response => FinchAPI::ResponsesPage + response => FinchAPI::Internal::ResponsesPage end row = response.to_enum.first diff --git a/test/finch-api/resources/hris/pay_statements_test.rb b/test/finch_api/resources/hris/pay_statements_test.rb similarity index 76% rename from test/finch-api/resources/hris/pay_statements_test.rb rename to test/finch_api/resources/hris/pay_statements_test.rb index cfcc147c..bc1bbbe4 100644 --- a/test/finch-api/resources/hris/pay_statements_test.rb +++ b/test/finch_api/resources/hris/pay_statements_test.rb @@ -4,10 +4,11 @@ class FinchAPI::Test::Resources::HRIS::PayStatementsTest < FinchAPI::Test::ResourceTest def test_retrieve_many_required_params - response = @finch.hris.pay_statements.retrieve_many(requests: [{payment_id: "string"}]) + response = + @finch.hris.pay_statements.retrieve_many(requests: [{payment_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}]) assert_pattern do - response => FinchAPI::ResponsesPage + response => FinchAPI::Internal::ResponsesPage end row = response.to_enum.first diff --git a/test/finch-api/resources/hris/payments_test.rb b/test/finch_api/resources/hris/payments_test.rb similarity index 74% rename from test/finch-api/resources/hris/payments_test.rb rename to test/finch_api/resources/hris/payments_test.rb index 7410f95d..09402c9e 100644 --- a/test/finch-api/resources/hris/payments_test.rb +++ b/test/finch_api/resources/hris/payments_test.rb @@ -7,7 +7,7 @@ def test_list_required_params response = @finch.hris.payments.list(end_date: "2021-01-01", start_date: "2021-01-01") assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -25,11 +25,11 @@ def test_list_required_params employee_taxes: FinchAPI::Models::Money | nil, employer_taxes: FinchAPI::Models::Money | nil, gross_pay: FinchAPI::Models::Money | nil, - individual_ids: ^(FinchAPI::ArrayOf[String]) | nil, + individual_ids: ^(FinchAPI::Internal::Type::ArrayOf[String]) | nil, net_pay: FinchAPI::Models::Money | nil, pay_date: String | nil, - pay_frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::Payment::PayFrequency]) | nil, - pay_group_ids: ^(FinchAPI::ArrayOf[String]) | nil, + pay_frequencies: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::HRIS::Payment::PayFrequency]) | nil, + pay_group_ids: ^(FinchAPI::Internal::Type::ArrayOf[String]) | nil, pay_period: FinchAPI::Models::HRIS::Payment::PayPeriod | nil } end diff --git a/test/finch-api/resources/hris_test.rb b/test/finch_api/resources/hris_test.rb similarity index 100% rename from test/finch-api/resources/hris_test.rb rename to test/finch_api/resources/hris_test.rb diff --git a/test/finch-api/resources/jobs/automated_test.rb b/test/finch_api/resources/jobs/automated_test.rb similarity index 94% rename from test/finch-api/resources/jobs/automated_test.rb rename to test/finch_api/resources/jobs/automated_test.rb index 22538498..9457e52f 100644 --- a/test/finch-api/resources/jobs/automated_test.rb +++ b/test/finch_api/resources/jobs/automated_test.rb @@ -52,7 +52,7 @@ def test_list assert_pattern do response => { - data: ^(FinchAPI::ArrayOf[FinchAPI::Models::Jobs::AutomatedAsyncJob]), + data: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Jobs::AutomatedAsyncJob]), meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta } end diff --git a/test/finch-api/resources/jobs/manual_test.rb b/test/finch_api/resources/jobs/manual_test.rb similarity index 83% rename from test/finch-api/resources/jobs/manual_test.rb rename to test/finch_api/resources/jobs/manual_test.rb index 2811c1b9..2233c062 100644 --- a/test/finch-api/resources/jobs/manual_test.rb +++ b/test/finch_api/resources/jobs/manual_test.rb @@ -12,7 +12,7 @@ def test_retrieve assert_pattern do response => { - body: ^(FinchAPI::ArrayOf[FinchAPI::Unknown]) | nil, + body: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown]) | nil, job_id: String, status: FinchAPI::Models::Jobs::ManualAsyncJob::Status } diff --git a/test/finch-api/resources/jobs_test.rb b/test/finch_api/resources/jobs_test.rb similarity index 100% rename from test/finch-api/resources/jobs_test.rb rename to test/finch_api/resources/jobs_test.rb diff --git a/test/finch-api/resources/payroll/pay_groups_test.rb b/test/finch_api/resources/payroll/pay_groups_test.rb similarity index 67% rename from test/finch-api/resources/payroll/pay_groups_test.rb rename to test/finch_api/resources/payroll/pay_groups_test.rb index c69b7544..bd1d6b53 100644 --- a/test/finch-api/resources/payroll/pay_groups_test.rb +++ b/test/finch_api/resources/payroll/pay_groups_test.rb @@ -13,9 +13,9 @@ def test_retrieve assert_pattern do response => { id: String, - individual_ids: ^(FinchAPI::ArrayOf[String]), + individual_ids: ^(FinchAPI::Internal::Type::ArrayOf[String]), name: String, - pay_frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency]) + pay_frequencies: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency]) } end end @@ -24,7 +24,7 @@ def test_list response = @finch.payroll.pay_groups.list assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -38,7 +38,7 @@ def test_list row => { id: String | nil, name: String | nil, - pay_frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency]) | nil + pay_frequencies: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency]) | nil } end end diff --git a/test/finch-api/resources/payroll_test.rb b/test/finch_api/resources/payroll_test.rb similarity index 100% rename from test/finch-api/resources/payroll_test.rb rename to test/finch_api/resources/payroll_test.rb diff --git a/test/finch-api/resources/providers_test.rb b/test/finch_api/resources/providers_test.rb similarity index 56% rename from test/finch-api/resources/providers_test.rb rename to test/finch_api/resources/providers_test.rb index 13fa06b0..07622ef5 100644 --- a/test/finch-api/resources/providers_test.rb +++ b/test/finch_api/resources/providers_test.rb @@ -7,7 +7,7 @@ def test_list response = @finch.providers.list assert_pattern do - response => FinchAPI::SinglePage + response => FinchAPI::Internal::SinglePage end row = response.to_enum.first @@ -20,15 +20,15 @@ def test_list assert_pattern do row => { id: String | nil, - authentication_methods: ^(FinchAPI::ArrayOf[FinchAPI::Models::Provider::AuthenticationMethod]) | nil, - beta: FinchAPI::BooleanModel | nil, + authentication_methods: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Provider::AuthenticationMethod]) | nil, + beta: FinchAPI::Internal::Type::BooleanModel | nil, display_name: String | nil, icon: String | nil, logo: String | nil, - manual: FinchAPI::BooleanModel | nil, - mfa_required: FinchAPI::BooleanModel | nil, + manual: FinchAPI::Internal::Type::BooleanModel | nil, + mfa_required: FinchAPI::Internal::Type::BooleanModel | nil, primary_color: String | nil, - products: ^(FinchAPI::ArrayOf[String]) | nil + products: ^(FinchAPI::Internal::Type::ArrayOf[String]) | nil } end end diff --git a/test/finch-api/resources/request_forwarding_test.rb b/test/finch_api/resources/request_forwarding_test.rb similarity index 90% rename from test/finch-api/resources/request_forwarding_test.rb rename to test/finch_api/resources/request_forwarding_test.rb index 5fc1e2e9..3420553a 100644 --- a/test/finch-api/resources/request_forwarding_test.rb +++ b/test/finch_api/resources/request_forwarding_test.rb @@ -13,7 +13,7 @@ def test_forward_required_params assert_pattern do response => { data: String | nil, - headers: FinchAPI::Unknown | nil, + headers: FinchAPI::Internal::Type::Unknown | nil, request: FinchAPI::Models::RequestForwardingForwardResponse::Request, status_code: Integer } diff --git a/test/finch-api/resources/sandbox/company_test.rb b/test/finch_api/resources/sandbox/company_test.rb similarity index 70% rename from test/finch-api/resources/sandbox/company_test.rb rename to test/finch_api/resources/sandbox/company_test.rb index 40bd3dfe..68bbbfcc 100644 --- a/test/finch-api/resources/sandbox/company_test.rb +++ b/test/finch_api/resources/sandbox/company_test.rb @@ -22,12 +22,12 @@ def test_update_required_params assert_pattern do response => { - accounts: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]) | nil, - departments: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, nil?: true]) | nil, + accounts: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]) | nil, + departments: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, nil?: true]) | nil, ein: String | nil, entity: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity | nil, legal_name: String | nil, - locations: ^(FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true]) | nil, + locations: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Location, nil?: true]) | nil, primary_email: String | nil, primary_phone_number: String | nil } diff --git a/test/finch-api/resources/sandbox/connections/accounts_test.rb b/test/finch_api/resources/sandbox/connections/accounts_test.rb similarity index 91% rename from test/finch-api/resources/sandbox/connections/accounts_test.rb rename to test/finch_api/resources/sandbox/connections/accounts_test.rb index 7f92b645..7042e3cf 100644 --- a/test/finch-api/resources/sandbox/connections/accounts_test.rb +++ b/test/finch_api/resources/sandbox/connections/accounts_test.rb @@ -21,7 +21,7 @@ def test_create_required_params authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType, company_id: String, connection_id: String, - products: ^(FinchAPI::ArrayOf[String]), + products: ^(FinchAPI::Internal::Type::ArrayOf[String]), provider_id: String } end @@ -39,7 +39,7 @@ def test_update account_id: String, authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType, company_id: String, - products: ^(FinchAPI::ArrayOf[String]), + products: ^(FinchAPI::Internal::Type::ArrayOf[String]), provider_id: String, connection_id: String | nil } diff --git a/test/finch-api/resources/sandbox/connections_test.rb b/test/finch_api/resources/sandbox/connections_test.rb similarity index 91% rename from test/finch-api/resources/sandbox/connections_test.rb rename to test/finch_api/resources/sandbox/connections_test.rb index ecfb074d..55f2654e 100644 --- a/test/finch-api/resources/sandbox/connections_test.rb +++ b/test/finch_api/resources/sandbox/connections_test.rb @@ -17,7 +17,7 @@ def test_create_required_params authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType, company_id: String, connection_id: String, - products: ^(FinchAPI::ArrayOf[String]), + products: ^(FinchAPI::Internal::Type::ArrayOf[String]), provider_id: String, token_type: String | nil } diff --git a/test/finch-api/resources/sandbox/directory_test.rb b/test/finch_api/resources/sandbox/directory_test.rb similarity index 74% rename from test/finch-api/resources/sandbox/directory_test.rb rename to test/finch_api/resources/sandbox/directory_test.rb index 864b5f29..dfe04d10 100644 --- a/test/finch-api/resources/sandbox/directory_test.rb +++ b/test/finch_api/resources/sandbox/directory_test.rb @@ -7,7 +7,7 @@ def test_create response = @finch.sandbox.directory.create assert_pattern do - response => ^(FinchAPI::ArrayOf[FinchAPI::Unknown]) + response => ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown]) end end end diff --git a/test/finch-api/resources/sandbox/employment_test.rb b/test/finch_api/resources/sandbox/employment_test.rb similarity index 79% rename from test/finch-api/resources/sandbox/employment_test.rb rename to test/finch_api/resources/sandbox/employment_test.rb index 26caf144..04ac5b71 100644 --- a/test/finch-api/resources/sandbox/employment_test.rb +++ b/test/finch_api/resources/sandbox/employment_test.rb @@ -14,15 +14,15 @@ def test_update response => { id: String | nil, class_code: String | nil, - custom_fields: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) | nil, + custom_fields: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) | nil, department: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department | nil, employment: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment | nil, employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus | nil, end_date: String | nil, first_name: String | nil, income: FinchAPI::Models::Income | nil, - income_history: ^(FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true]) | nil, - is_active: FinchAPI::BooleanModel | nil, + income_history: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Income, nil?: true]) | nil, + is_active: FinchAPI::Internal::Type::BooleanModel | nil, last_name: String | nil, latest_rehire_date: String | nil, location: FinchAPI::Models::Location | nil, diff --git a/test/finch-api/resources/sandbox/individual_test.rb b/test/finch_api/resources/sandbox/individual_test.rb similarity index 77% rename from test/finch-api/resources/sandbox/individual_test.rb rename to test/finch_api/resources/sandbox/individual_test.rb index c909005a..1da64214 100644 --- a/test/finch-api/resources/sandbox/individual_test.rb +++ b/test/finch_api/resources/sandbox/individual_test.rb @@ -14,14 +14,14 @@ def test_update response => { id: String | nil, dob: String | nil, - emails: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]) | nil, + emails: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]) | nil, encrypted_ssn: String | nil, ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity | nil, first_name: String | nil, gender: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender | nil, last_name: String | nil, middle_name: String | nil, - phone_numbers: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, nil?: true]) | nil, + phone_numbers: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, nil?: true]) | nil, preferred_name: String | nil, residence: FinchAPI::Models::Location | nil, ssn: String | nil diff --git a/test/finch-api/resources/sandbox/jobs/configuration_test.rb b/test/finch_api/resources/sandbox/jobs/configuration_test.rb similarity index 87% rename from test/finch-api/resources/sandbox/jobs/configuration_test.rb rename to test/finch_api/resources/sandbox/jobs/configuration_test.rb index e4b2399e..1d8a12ac 100644 --- a/test/finch-api/resources/sandbox/jobs/configuration_test.rb +++ b/test/finch_api/resources/sandbox/jobs/configuration_test.rb @@ -7,7 +7,7 @@ def test_retrieve response = @finch.sandbox.jobs.configuration.retrieve assert_pattern do - response => ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration]) + response => ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration]) end end diff --git a/test/finch-api/resources/sandbox/jobs_test.rb b/test/finch_api/resources/sandbox/jobs_test.rb similarity index 100% rename from test/finch-api/resources/sandbox/jobs_test.rb rename to test/finch_api/resources/sandbox/jobs_test.rb diff --git a/test/finch-api/resources/sandbox/payment_test.rb b/test/finch_api/resources/sandbox/payment_test.rb similarity index 100% rename from test/finch-api/resources/sandbox/payment_test.rb rename to test/finch_api/resources/sandbox/payment_test.rb diff --git a/test/finch-api/resources/sandbox_test.rb b/test/finch_api/resources/sandbox_test.rb similarity index 100% rename from test/finch-api/resources/sandbox_test.rb rename to test/finch_api/resources/sandbox_test.rb diff --git a/test/finch-api/resources/shared_test.rb b/test/finch_api/resources/shared_test.rb similarity index 100% rename from test/finch-api/resources/shared_test.rb rename to test/finch_api/resources/shared_test.rb diff --git a/test/finch-api/resources/webhooks_test.rb b/test/finch_api/resources/webhooks_test.rb similarity index 100% rename from test/finch-api/resources/webhooks_test.rb rename to test/finch_api/resources/webhooks_test.rb diff --git a/test/finch-api/test_helper.rb b/test/finch_api/test_helper.rb similarity index 97% rename from test/finch-api/test_helper.rb rename to test/finch_api/test_helper.rb index 005cb3e2..f130f981 100644 --- a/test/finch-api/test_helper.rb +++ b/test/finch_api/test_helper.rb @@ -16,7 +16,7 @@ require "minitest/proveit" require "minitest/rg" -require_relative "../../lib/finch-api" +require_relative "../../lib/finch_api" require_relative "resource_namespaces" module Kernel