diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d58e0dc8..d09d5c7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,58 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' - 'stl-preview-base/**' jobs: + build: + timeout-minutes: 10 + name: build + permissions: + contents: read + id-token: write + runs-on: ${{ github.repository == 'stainless-sdks/finch-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: |- + github.repository == 'stainless-sdks/finch-ruby' && + (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + steps: + - uses: actions/checkout@v6 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Get GitHub OIDC Token + if: |- + github.repository == 'stainless-sdks/finch-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') + id: github-oidc + uses: actions/github-script@v8 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Build and upload gem artifacts + if: |- + github.repository == 'stainless-sdks/finch-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + PACKAGE_NAME: finch_api + run: ./scripts/utils/upload-artifact.sh lint: timeout-minutes: 10 name: lint diff --git a/.gitignore b/.gitignore index 3d26ceed..fc9eb287 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea/ .ignore .prism.log +.stdy.log .ruby-lsp/ .yardoc/ bin/tapioca diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 859ebd32..76293726 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.42" + ".": "0.1.0-alpha.43" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b15bfab0..91f464e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46f433f34d440aa1dfcc48cc8d822c598571b68be2f723ec99e1b4fba6c13b1e.yml -openapi_spec_hash: 5b5cd728776723ac773900f7e8a32c05 -config_hash: 0892e2e0eeb0343a022afa62e9080dd1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-63947213d9359808abc05e4c3cb53389325ca23c58d06bf293626f7d5d4fc2b8.yml +openapi_spec_hash: 50e4669590de9a411915a612615017d0 +config_hash: d21a244fc073152c8dbecb8ece970209 diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e9d9dd..3c7be099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # Changelog +## 0.1.0-alpha.43 (2026-03-31) + +Full Changelog: [v0.1.0-alpha.42...v0.1.0-alpha.43](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.42...v0.1.0-alpha.43) + +### Features + +* **api:** add per endpoint security ([ac937c1](https://github.com/Finch-API/finch-api-ruby/commit/ac937c138291704137a33d18cea1571d2e6f96ca)) +* **api:** api update ([8ff38e4](https://github.com/Finch-API/finch-api-ruby/commit/8ff38e4aeb774f2ec8f5be0692c787652a72b88f)) +* **api:** api update ([04d90f0](https://github.com/Finch-API/finch-api-ruby/commit/04d90f03077ba6b6459e3a1ecbb41baffd1e9eb5)) +* **client:** add webhook support ([f4ad88e](https://github.com/Finch-API/finch-api-ruby/commit/f4ad88e63dcec2d9c6f9b64e9f10aa01a34c2af4)) + + +### Bug Fixes + +* align path encoding with RFC 3986 section 3.3 ([0a99d63](https://github.com/Finch-API/finch-api-ruby/commit/0a99d63c11aa9516a7cac12937d35972c9638f32)) +* **api:** remove invalid transform config ([826feaa](https://github.com/Finch-API/finch-api-ruby/commit/826feaab2ca5d0afd202b196f5da0910c029a591)) +* **client:** always add content-length to post body, even when empty ([66e8f66](https://github.com/Finch-API/finch-api-ruby/commit/66e8f668ba49f9959bd0067d4161d972ebad46ee)) +* **client:** loosen json header parsing ([7bc3e65](https://github.com/Finch-API/finch-api-ruby/commit/7bc3e6509545d52948558cc20180865f09e946dc)) +* **docs:** fix mcp installation instructions for remote servers ([8022436](https://github.com/Finch-API/finch-api-ruby/commit/8022436ca504321dffdb8eedabc0c9ee82e0bf45)) +* **internal:** correct multipart form field name encoding ([76c688f](https://github.com/Finch-API/finch-api-ruby/commit/76c688f93a7a6bf6827baa4b1b06ad715826c491)) +* properly mock time in ruby ci tests ([86ece75](https://github.com/Finch-API/finch-api-ruby/commit/86ece75b5fefd736c827c70dc7b6140ec67fdf35)) +* **tests:** skip broken date validation test ([2ee41c8](https://github.com/Finch-API/finch-api-ruby/commit/2ee41c81ef9707aa7180723a283789a5bbaa041d)) +* variable name typo ([09ceda2](https://github.com/Finch-API/finch-api-ruby/commit/09ceda237d92712263d0942f1deb8654afc18071)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([b8e66d9](https://github.com/Finch-API/finch-api-ruby/commit/b8e66d9232c428b9c4104bf5c6ce6673690afa2a)) +* **ci:** skip uploading artifacts on stainless-internal branches ([1229fe8](https://github.com/Finch-API/finch-api-ruby/commit/1229fe85090c9c58caeb17b10434a8923fe2dcb2)) +* **ci:** support opting out of skipping builds on metadata-only commits ([f892be4](https://github.com/Finch-API/finch-api-ruby/commit/f892be499c5676f466ac47676d4106bb67f52f77)) +* **docs:** remove www prefix ([57bc88c](https://github.com/Finch-API/finch-api-ruby/commit/57bc88cdd60bfec535752170ffeeebe157a0bfce)) +* **internal:** codegen related update ([796b4db](https://github.com/Finch-API/finch-api-ruby/commit/796b4dba769b768e65dcff3921257f098d6ff9df)) +* **internal:** codegen related update ([a021ffb](https://github.com/Finch-API/finch-api-ruby/commit/a021ffb4eec64de459cb22c27b4c7c4592003d21)) +* **internal:** tweak CI branches ([c0b42bc](https://github.com/Finch-API/finch-api-ruby/commit/c0b42bcd72ff06cf71fec9a98856c12043b5cfe2)) +* **internal:** update gitignore ([a315475](https://github.com/Finch-API/finch-api-ruby/commit/a3154752a39a30ad3cb8aac78b2d473c3bb86dcf)) +* **tests:** bump steady to v0.19.4 ([93617aa](https://github.com/Finch-API/finch-api-ruby/commit/93617aad24e3c174e12dfdf2de4bad5cce0aeb2f)) +* **tests:** bump steady to v0.19.5 ([424035c](https://github.com/Finch-API/finch-api-ruby/commit/424035c08a1d4c56c3b1118cd1071bc1cbaad28a)) +* **tests:** bump steady to v0.19.6 ([b832805](https://github.com/Finch-API/finch-api-ruby/commit/b8328058d1e51765ee48832897ebf00984272323)) +* **tests:** bump steady to v0.19.7 ([fe2f5fb](https://github.com/Finch-API/finch-api-ruby/commit/fe2f5fb484c9684d6586106172cd984f17e914c1)) +* **tests:** bump steady to v0.20.1 ([6fb5f11](https://github.com/Finch-API/finch-api-ruby/commit/6fb5f11fe816634a6ea3267f5c10831b2f5a1058)) +* **tests:** bump steady to v0.20.2 ([a37acc5](https://github.com/Finch-API/finch-api-ruby/commit/a37acc5ccb90a944a7bb903befbf8a5faa60a32e)) +* update mock server docs ([47876a8](https://github.com/Finch-API/finch-api-ruby/commit/47876a8821367b8d730229c8bf401bc92907d4f0)) + + +### Refactors + +* **tests:** switch from prism to steady ([e294a79](https://github.com/Finch-API/finch-api-ruby/commit/e294a795e94df460394978881960bbc067181a7e)) + ## 0.1.0-alpha.42 (2026-01-16) Full Changelog: [v0.1.0-alpha.41...v0.1.0-alpha.42](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.41...v0.1.0-alpha.42) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1bc266a..cfed90a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g To install via git in your `Gemfile`: ```ruby -gem "finch-api", git: "https://www.github.com/Finch-API/finch-api-ruby" +gem "finch-api", git: "https://github.com/Finch-API/finch-api-ruby" ``` Alternatively, reference local copy of the repo: ```bash -$ git clone -- 'https://www.github.com/Finch-API/finch-api-ruby' '' +$ git clone -- 'https://github.com/Finch-API/finch-api-ruby' '' ``` ```ruby @@ -66,10 +66,10 @@ $ bundle exec rake ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. -```bash -$ npx prism mock path/to/your/openapi.yml +```sh +$ ./scripts/mock ``` ```bash diff --git a/Gemfile.lock b/Gemfile.lock index 01a79a1a..86f1478c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - finch-api (0.1.0.pre.alpha.42) + finch-api (0.1.0.pre.alpha.43) cgi connection_pool diff --git a/README.md b/README.md index 8085e54e..d2caebca 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ It is generated with [Stainless](https://www.stainless.com/). Use the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl19) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%7D) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D) > Note: You may need to set environment variables in your MCP client. @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "finch-api", "~> 0.1.0.pre.alpha.42" +gem "finch-api", "~> 0.1.0.pre.alpha.43" ``` diff --git a/lib/finch_api/client.rb b/lib/finch_api/client.rb index f3330ed8..8a859282 100644 --- a/lib/finch_api/client.rb +++ b/lib/finch_api/client.rb @@ -24,6 +24,9 @@ class Client < FinchAPI::Internal::Transport::BaseClient # @return [String, nil] attr_reader :client_secret + # @return [String, nil] + attr_reader :webhook_secret + # @return [FinchAPI::Resources::AccessTokens] attr_reader :access_tokens @@ -56,11 +59,11 @@ class Client < FinchAPI::Internal::Transport::BaseClient # @api private # + # @param security [Hash{Symbol=>Boolean}] + # # @return [Hash{String=>String}] - private def auth_headers - return bearer_auth unless bearer_auth.empty? - return basic_auth unless basic_auth.empty? - {} + private def auth_headers(security:) + {bearer_auth:, basic_auth:}.slice(*security.keys).values.reduce({}, :merge) end # @api private @@ -90,6 +93,8 @@ class Client < FinchAPI::Internal::Transport::BaseClient # # @param access_token [String, nil] # + # @param webhook_secret [String, nil] Defaults to `ENV["FINCH_WEBHOOK_SECRET"]` + # # @param base_url [String, nil] Override the default base URL for the API, e.g., # `"https://api.example.com/v2/"`. Defaults to `ENV["FINCH_BASE_URL"]` # @@ -104,6 +109,7 @@ def initialize( client_id: ENV["FINCH_CLIENT_ID"], client_secret: ENV["FINCH_CLIENT_SECRET"], access_token: nil, + webhook_secret: ENV["FINCH_WEBHOOK_SECRET"], base_url: ENV["FINCH_BASE_URL"], max_retries: self.class::DEFAULT_MAX_RETRIES, timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, @@ -119,6 +125,7 @@ def initialize( @client_id = client_id&.to_s @client_secret = client_secret&.to_s @access_token = access_token&.to_s + @webhook_secret = webhook_secret&.to_s super( base_url: base_url, diff --git a/lib/finch_api/internal/transport/base_client.rb b/lib/finch_api/internal/transport/base_client.rb index af133bbc..4b00c2be 100644 --- a/lib/finch_api/internal/transport/base_client.rb +++ b/lib/finch_api/internal/transport/base_client.rb @@ -31,7 +31,19 @@ class << self # # @raise [ArgumentError] def validate!(req) - keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] + keys = [ + :method, + :path, + :query, + :headers, + :body, + :unwrap, + :page, + :stream, + :model, + :security, + :options + ] case req in Hash req.each_key do |k| @@ -252,6 +264,8 @@ def initialize( # # @option req [FinchAPI::Internal::Type::Converter, Class, nil] :model # + # @option req [Hash{Symbol=>Boolean}, nil] :security + # # @param opts [Hash{Symbol=>Object}] . # # @option opts [String, nil] :idempotency_key @@ -276,7 +290,12 @@ def initialize( headers = FinchAPI::Internal::Util.normalized_headers( @headers, - auth_headers, + auth_headers( + security: req.fetch( + :security, + {bearer_auth: true, basic_auth: true} + ) + ), req[:headers].to_h, opts[:extra_headers].to_h ) @@ -439,7 +458,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) # 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: {}) + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, security: {bearer_auth: true, basic_auth: true}, options: {}) # # @param method [Symbol] # @@ -459,6 +478,8 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) # # @param model [FinchAPI::Internal::Type::Converter, Class, nil] # + # @param security [Hash{Symbol=>Boolean}, nil] + # # @param options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] . # # @option options [String, nil] :idempotency_key @@ -551,6 +572,7 @@ def inspect 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), + security: T.nilable({bearer_auth: T::Boolean, basic_auth: T::Boolean}), options: T.nilable(FinchAPI::RequestOptions::OrHash) } end diff --git a/lib/finch_api/internal/transport/pooled_net_requester.rb b/lib/finch_api/internal/transport/pooled_net_requester.rb index 97752aef..d8edf1aa 100644 --- a/lib/finch_api/internal/transport/pooled_net_requester.rb +++ b/lib/finch_api/internal/transport/pooled_net_requester.rb @@ -75,7 +75,7 @@ def build_request(request, &blk) case body in nil - nil + req["content-length"] ||= 0 unless req["transfer-encoding"] in String req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk) diff --git a/lib/finch_api/internal/util.rb b/lib/finch_api/internal/util.rb index 6c29c988..a103fded 100644 --- a/lib/finch_api/internal/util.rb +++ b/lib/finch_api/internal/util.rb @@ -157,7 +157,7 @@ def coerce_hash!(input) in Hash | nil => coerced coerced else - message = "Expected a #{Hash} or #{FinchAPI::Internal::Type::BaseModel}, got #{data.inspect}" + message = "Expected a #{Hash} or #{FinchAPI::Internal::Type::BaseModel}, got #{input.inspect}" raise ArgumentError.new(message) end end @@ -237,6 +237,11 @@ def dig(data, pick, &blk) end end + # @type [Regexp] + # + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/ + class << self # @api private # @@ -247,6 +252,15 @@ def uri_origin(uri) "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" end + # @api private + # + # @param path [String, Integer] + # + # @return [String] + def encode_path(path) + path.to_s.gsub(FinchAPI::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) } + end + # @api private # # @param path [String, Array] @@ -259,7 +273,7 @@ def interpolate_path(path) in [] "" in [String => p, *interpolations] - encoded = interpolations.map { ERB::Util.url_encode(_1) } + encoded = interpolations.map { encode_path(_1) } format(p, *encoded) end end @@ -485,11 +499,42 @@ def writable_enum(&blk) end # @type [Regexp] - JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)} + JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)} # @type [Regexp] JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)} class << self + # @api private + # + # @param query [Hash{Symbol=>Object}] + # + # @return [Hash{Symbol=>Object}] + def encode_query_params(query) + out = {} + query.each { write_query_param_element!(out, _1, _2) } + out + end + + # @api private + # + # @param collection [Hash{Symbol=>Object}] + # @param key [String] + # @param element [Object] + # + # @return [nil] + private def write_query_param_element!(collection, key, element) + case element + in Hash + element.each do |name, value| + write_query_param_element!(collection, "#{key}[#{name}]", value) + end + in Array + collection["#{key}[]"] = element.map(&:to_s) + else + collection[key] = element.to_s + end + end + # @api private # # @param y [Enumerator::Yielder] @@ -540,16 +585,15 @@ class << self y << "Content-Disposition: form-data" unless key.nil? - name = ERB::Util.url_encode(key.to_s) - y << "; name=\"#{name}\"" + y << "; name=\"#{key}\"" end case val in FinchAPI::FilePart unless val.filename.nil? - filename = ERB::Util.url_encode(val.filename) + filename = encode_path(val.filename) y << "; filename=\"#{filename}\"" in Pathname | IO - filename = ERB::Util.url_encode(::File.basename(val.to_path)) + filename = encode_path(::File.basename(val.to_path)) y << "; filename=\"#{filename}\"" else end diff --git a/lib/finch_api/models/create_access_token_response.rb b/lib/finch_api/models/create_access_token_response.rb index bc4d34c2..08a07ad8 100644 --- a/lib/finch_api/models/create_access_token_response.rb +++ b/lib/finch_api/models/create_access_token_response.rb @@ -80,7 +80,14 @@ class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :customer_id, String, nil?: true - # @!method initialize(access_token:, client_type:, connection_id:, connection_type:, entity_ids:, products:, provider_id:, token_type:, account_id: nil, company_id: nil, customer_id: nil) + # @!attribute customer_name + # The name of your customer you provided to Finch when a connect session was + # created for this connection + # + # @return [String, nil] + optional :customer_name, String, nil?: true + + # @!method initialize(access_token:, client_type:, connection_id:, connection_type:, entity_ids:, products:, provider_id:, token_type:, account_id: nil, company_id: nil, customer_id: nil, customer_name: nil) # Some parameter documentations has been truncated, see # {FinchAPI::Models::CreateAccessTokenResponse} for more details. # @@ -105,6 +112,8 @@ class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel # @param company_id [String] [DEPRECATED] Use `connection_id` to identify the connection instead of this comp # # @param customer_id [String, nil] The ID of your customer you provided to Finch when a connect session was created + # + # @param customer_name [String, nil] The name of your customer you provided to Finch when a connect session was creat # The type of application associated with a token. # diff --git a/lib/finch_api/models/hris/benefit_retrieve_params.rb b/lib/finch_api/models/hris/benefit_retrieve_params.rb index cd3246be..516ad2c9 100644 --- a/lib/finch_api/models/hris/benefit_retrieve_params.rb +++ b/lib/finch_api/models/hris/benefit_retrieve_params.rb @@ -8,13 +8,20 @@ class BenefitRetrieveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # # @return [Array, nil] optional :entity_ids, FinchAPI::Internal::Type::ArrayOf[String] - # @!method initialize(entity_ids: nil, request_options: {}) + # @!method initialize(benefit_id:, entity_ids: nil, request_options: {}) + # @param benefit_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/finch_api/models/hris/benefit_update_params.rb b/lib/finch_api/models/hris/benefit_update_params.rb index 0168d703..87570857 100644 --- a/lib/finch_api/models/hris/benefit_update_params.rb +++ b/lib/finch_api/models/hris/benefit_update_params.rb @@ -8,6 +8,11 @@ class BenefitUpdateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # @@ -20,7 +25,9 @@ class BenefitUpdateParams < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :description, String - # @!method initialize(entity_ids: nil, description: nil, request_options: {}) + # @!method initialize(benefit_id:, entity_ids: nil, description: nil, request_options: {}) + # @param benefit_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param description [String] Updated name or description. diff --git a/lib/finch_api/models/hris/benefits/individual_enroll_many_params.rb b/lib/finch_api/models/hris/benefits/individual_enroll_many_params.rb index fd30add6..8d09b75b 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 @@ -9,6 +9,11 @@ class IndividualEnrollManyParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # @@ -22,7 +27,9 @@ class IndividualEnrollManyParams < FinchAPI::Internal::Type::BaseModel optional :individuals, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::HRIS::Benefits::IndividualEnrollManyParams::Individual] } - # @!method initialize(entity_ids: nil, individuals: nil, request_options: {}) + # @!method initialize(benefit_id:, entity_ids: nil, individuals: nil, request_options: {}) + # @param benefit_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param individuals [Array] Array of the individual_id to enroll and a configuration object. 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 index e44e8816..73d88625 100644 --- a/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rb +++ b/lib/finch_api/models/hris/benefits/individual_enrolled_ids_params.rb @@ -9,13 +9,20 @@ class IndividualEnrolledIDsParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # # @return [Array, nil] optional :entity_ids, FinchAPI::Internal::Type::ArrayOf[String] - # @!method initialize(entity_ids: nil, request_options: {}) + # @!method initialize(benefit_id:, entity_ids: nil, request_options: {}) + # @param benefit_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] 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 index c3afb068..4fe70543 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 @@ -9,6 +9,11 @@ class IndividualRetrieveManyBenefitsParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # @@ -22,11 +27,13 @@ class IndividualRetrieveManyBenefitsParams < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :individual_ids, String - # @!method initialize(entity_ids: nil, individual_ids: nil, request_options: {}) + # @!method initialize(benefit_id:, entity_ids: nil, individual_ids: nil, request_options: {}) # Some parameter documentations has been truncated, see # {FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams} for # more details. # + # @param benefit_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param individual_ids [String] comma-delimited list of stable Finch uuids for each individual. If empty, defaul 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 index adba41a0..11c46653 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 @@ -9,6 +9,11 @@ class IndividualUnenrollManyParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # @@ -21,7 +26,9 @@ class IndividualUnenrollManyParams < FinchAPI::Internal::Type::BaseModel # @return [Array, nil] optional :individual_ids, FinchAPI::Internal::Type::ArrayOf[String] - # @!method initialize(entity_ids: nil, individual_ids: nil, request_options: {}) + # @!method initialize(benefit_id:, entity_ids: nil, individual_ids: nil, request_options: {}) + # @param benefit_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param individual_ids [Array] Array of individual_ids to unenroll. 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 index 4eb3d43e..45299bab 100644 --- 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 @@ -10,13 +10,20 @@ class RuleDeleteParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute rule_id + # + # @return [String] + required :rule_id, String + # @!attribute entity_ids # The entity IDs to delete the rule for. # # @return [Array, nil] optional :entity_ids, FinchAPI::Internal::Type::ArrayOf[String] - # @!method initialize(entity_ids: nil, request_options: {}) + # @!method initialize(rule_id:, entity_ids: nil, request_options: {}) + # @param rule_id [String] + # # @param entity_ids [Array] The entity IDs to delete the rule for. # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] 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 index 4dbc42ae..4e1d2c58 100644 --- 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 @@ -10,6 +10,11 @@ class RuleUpdateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute rule_id + # + # @return [String] + required :rule_id, String + # @!attribute entity_ids # The entity IDs to update the rule for. # @@ -21,7 +26,9 @@ class RuleUpdateParams < FinchAPI::Internal::Type::BaseModel # @return [Object, nil] optional :optional_property, FinchAPI::Internal::Type::Unknown, api_name: :optionalProperty - # @!method initialize(entity_ids: nil, optional_property: nil, request_options: {}) + # @!method initialize(rule_id:, entity_ids: nil, optional_property: nil, request_options: {}) + # @param rule_id [String] + # # @param entity_ids [Array] The entity IDs to update the rule for. # # @param optional_property [Object] diff --git a/lib/finch_api/models/hris/document_retreive_params.rb b/lib/finch_api/models/hris/document_retreive_params.rb index 35684b7f..930d91eb 100644 --- a/lib/finch_api/models/hris/document_retreive_params.rb +++ b/lib/finch_api/models/hris/document_retreive_params.rb @@ -8,13 +8,20 @@ class DocumentRetreiveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute document_id + # + # @return [String] + required :document_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # # @return [Array, nil] optional :entity_ids, FinchAPI::Internal::Type::ArrayOf[String] - # @!method initialize(entity_ids: nil, request_options: {}) + # @!method initialize(document_id:, entity_ids: nil, request_options: {}) + # @param document_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/finch_api/models/hris/employment_data.rb b/lib/finch_api/models/hris/employment_data.rb index 83b576cc..b24e115a 100644 --- a/lib/finch_api/models/hris/employment_data.rb +++ b/lib/finch_api/models/hris/employment_data.rb @@ -54,6 +54,17 @@ class UnionMember0 < FinchAPI::Internal::Type::BaseModel # @return [String, nil] required :first_name, String, nil?: true + # @!attribute flsa_status + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @return [Symbol, FinchAPI::Models::HRIS::EmploymentData::UnionMember0::FlsaStatus, nil] + required :flsa_status, + enum: -> { + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus + }, + nil?: true + # @!attribute is_active # `true` if the individual an an active employee or contractor at the company. # @@ -141,7 +152,7 @@ class UnionMember0 < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :work_id, String, nil?: true - # @!method initialize(id:, class_code:, department:, employment:, employment_status:, end_date:, first_name:, is_active:, last_name:, latest_rehire_date:, location:, manager:, middle_name:, start_date:, title:, custom_fields: nil, income: nil, income_history: nil, source_id: nil, work_id: nil) + # @!method initialize(id:, class_code:, department:, employment:, employment_status:, end_date:, first_name:, flsa_status:, is_active:, last_name:, latest_rehire_date:, location:, manager:, middle_name:, start_date:, title:, custom_fields: nil, income: nil, income_history: nil, source_id: nil, work_id: nil) # Some parameter documentations has been truncated, see # {FinchAPI::Models::HRIS::EmploymentData::UnionMember0} for more details. # @@ -159,6 +170,8 @@ class UnionMember0 < FinchAPI::Internal::Type::BaseModel # # @param first_name [String, nil] The legal first name of the individual. # + # @param flsa_status [Symbol, FinchAPI::Models::HRIS::EmploymentData::UnionMember0::FlsaStatus, nil] The FLSA status of the individual. Available options: `exempt`, `non_exempt`, `u + # # @param is_active [Boolean, nil] `true` if the individual an an active employee or contractor at the company. # # @param last_name [String, nil] The legal last name of the individual. @@ -281,6 +294,21 @@ module EmploymentStatus # @return [Array] end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @see FinchAPI::Models::HRIS::EmploymentData::UnionMember0#flsa_status + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT = :exempt + NON_EXEMPT = :non_exempt + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + # @see FinchAPI::Models::HRIS::EmploymentData::UnionMember0#manager class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute id diff --git a/lib/finch_api/models/introspection.rb b/lib/finch_api/models/introspection.rb index 0f8bf1bb..c7dea96c 100644 --- a/lib/finch_api/models/introspection.rb +++ b/lib/finch_api/models/introspection.rb @@ -346,12 +346,38 @@ class Entity < FinchAPI::Internal::Type::BaseModel # @return [String, nil] required :source_id, String, nil?: true - # @!method initialize(id:, name:, source_id:) + # @!attribute status + # The status of the entity connection + # + # @return [Symbol, FinchAPI::Models::Introspection::Entity::Status] + required :status, enum: -> { FinchAPI::Introspection::Entity::Status } + + # @!method initialize(id:, name:, source_id:, status:) # @param id [String] The connection account ID for this entity # # @param name [String, nil] The name of the entity (payroll provider company name) # # @param source_id [String, nil] The source ID of the entity + # + # @param status [Symbol, FinchAPI::Models::Introspection::Entity::Status] The status of the entity connection + + # The status of the entity connection + # + # @see FinchAPI::Models::Introspection::Entity#status + module Status + extend FinchAPI::Internal::Type::Enum + + PENDING = :pending + PROCESSING = :processing + CONNECTED = :connected + ERROR_NO_ACCOUNT_SETUP = :error_no_account_setup + ERROR_PERMISSIONS = :error_permissions + REAUTH = :reauth + DISCONNECTED = :disconnected + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/finch_api/models/jobs/automated_create_params.rb b/lib/finch_api/models/jobs/automated_create_params.rb index e1568c6a..f7d674ce 100644 --- a/lib/finch_api/models/jobs/automated_create_params.rb +++ b/lib/finch_api/models/jobs/automated_create_params.rb @@ -8,43 +8,67 @@ class AutomatedCreateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters - # @!attribute type - # The type of job to start. + # @!attribute body # - # @return [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] - required :type, enum: -> { FinchAPI::Jobs::AutomatedCreateParams::Type } + # @return [FinchAPI::Models::Jobs::AutomatedCreateParams::Body::DataSyncAll, FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync] + required :body, union: -> { FinchAPI::Jobs::AutomatedCreateParams::Body } - # @!attribute params - # - # @return [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] - required :params, -> { FinchAPI::Jobs::AutomatedCreateParams::Params } - - # @!method initialize(type:, params:, request_options: {}) - # @param type [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] The type of job to start. - # - # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] - # + # @!method initialize(body:, request_options: {}) + # @param body [FinchAPI::Models::Jobs::AutomatedCreateParams::Body::DataSyncAll, FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync] # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] - # The type of job to start. - module Type - extend FinchAPI::Internal::Type::Enum + module Body + extend FinchAPI::Internal::Type::Union - W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + discriminator :type - # @!method self.values - # @return [Array] - end + variant :data_sync_all, -> { FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll } + + variant :w4_form_employee_sync, -> { FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync } + + class DataSyncAll < FinchAPI::Internal::Type::BaseModel + # @!attribute type + # The type of job to start. + # + # @return [Symbol, :data_sync_all] + required :type, const: :data_sync_all + + # @!method initialize(type: :data_sync_all) + # @param type [Symbol, :data_sync_all] The type of job to start. + end + + class W4FormEmployeeSync < FinchAPI::Internal::Type::BaseModel + # @!attribute params + # + # @return [FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params] + required :params, -> { FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params } + + # @!attribute type + # The type of job to start. + # + # @return [Symbol, :w4_form_employee_sync] + required :type, const: :w4_form_employee_sync + + # @!method initialize(params:, type: :w4_form_employee_sync) + # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params] + # + # @param type [Symbol, :w4_form_employee_sync] The type of job to start. + + # @see FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync#params + class Params < FinchAPI::Internal::Type::BaseModel + # @!attribute individual_id + # The unique ID of the individual for W-4 data sync. + # + # @return [String] + required :individual_id, String - class Params < FinchAPI::Internal::Type::BaseModel - # @!attribute individual_id - # The unique ID of the individual for W-4 data sync. - # - # @return [String] - required :individual_id, String + # @!method initialize(individual_id:) + # @param individual_id [String] The unique ID of the individual for W-4 data sync. + end + end - # @!method initialize(individual_id:) - # @param individual_id [String] The unique ID of the individual for W-4 data sync. + # @!method self.variants + # @return [Array(FinchAPI::Models::Jobs::AutomatedCreateParams::Body::DataSyncAll, FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync)] 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 index dc698f82..9fed61c3 100644 --- a/lib/finch_api/models/jobs/automated_retrieve_params.rb +++ b/lib/finch_api/models/jobs/automated_retrieve_params.rb @@ -8,7 +8,13 @@ class AutomatedRetrieveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters - # @!method initialize(request_options: {}) + # @!attribute job_id + # + # @return [String] + required :job_id, String + + # @!method initialize(job_id:, request_options: {}) + # @param job_id [String] # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/finch_api/models/jobs/manual_retrieve_params.rb b/lib/finch_api/models/jobs/manual_retrieve_params.rb index 321c5aa6..e37866d3 100644 --- a/lib/finch_api/models/jobs/manual_retrieve_params.rb +++ b/lib/finch_api/models/jobs/manual_retrieve_params.rb @@ -8,7 +8,13 @@ class ManualRetrieveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters - # @!method initialize(request_options: {}) + # @!attribute job_id + # + # @return [String] + required :job_id, String + + # @!method initialize(job_id:, request_options: {}) + # @param job_id [String] # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] 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 index 69858b28..6f1b7b55 100644 --- a/lib/finch_api/models/payroll/pay_group_retrieve_params.rb +++ b/lib/finch_api/models/payroll/pay_group_retrieve_params.rb @@ -8,13 +8,20 @@ class PayGroupRetrieveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute pay_group_id + # + # @return [String] + required :pay_group_id, String + # @!attribute entity_ids # The entity IDs to specify which entities' data to access. # # @return [Array, nil] optional :entity_ids, FinchAPI::Internal::Type::ArrayOf[String] - # @!method initialize(entity_ids: nil, request_options: {}) + # @!method initialize(pay_group_id:, entity_ids: nil, request_options: {}) + # @param pay_group_id [String] + # # @param entity_ids [Array] The entity IDs to specify which entities' data to access. # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/finch_api/models/sandbox/directory_create_params.rb b/lib/finch_api/models/sandbox/directory_create_params.rb index 79bf039c..e3fd0506 100644 --- a/lib/finch_api/models/sandbox/directory_create_params.rb +++ b/lib/finch_api/models/sandbox/directory_create_params.rb @@ -105,6 +105,17 @@ class Body < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :first_name, String, nil?: true + # @!attribute flsa_status + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::FlsaStatus, nil] + optional :flsa_status, + enum: -> { + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus + }, + nil?: true + # @!attribute gender # The gender of the individual. # @@ -208,7 +219,7 @@ class Body < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :title, String, nil?: true - # @!method initialize(class_code: nil, custom_fields: nil, department: nil, dob: nil, emails: nil, employment: nil, employment_status: nil, encrypted_ssn: nil, end_date: nil, ethnicity: nil, first_name: nil, gender: nil, income: nil, income_history: nil, is_active: nil, last_name: nil, latest_rehire_date: nil, location: nil, manager: nil, middle_name: nil, phone_numbers: nil, preferred_name: nil, residence: nil, source_id: nil, ssn: nil, start_date: nil, title: nil) + # @!method initialize(class_code: nil, custom_fields: nil, department: nil, dob: nil, emails: nil, employment: nil, employment_status: nil, encrypted_ssn: nil, end_date: nil, ethnicity: nil, first_name: nil, flsa_status: nil, gender: nil, income: nil, income_history: nil, is_active: nil, last_name: nil, latest_rehire_date: nil, location: nil, manager: nil, middle_name: nil, phone_numbers: nil, preferred_name: nil, residence: nil, source_id: nil, ssn: nil, start_date: nil, title: nil) # Some parameter documentations has been truncated, see # {FinchAPI::Models::Sandbox::DirectoryCreateParams::Body} for more details. # @@ -234,6 +245,8 @@ class Body < FinchAPI::Internal::Type::BaseModel # # @param first_name [String, nil] The legal first name of the individual. # + # @param flsa_status [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::FlsaStatus, nil] The FLSA status of the individual. Available options: `exempt`, `non_exempt`, `u + # # @param gender [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender, nil] The gender of the individual. # # @param income [FinchAPI::Models::Income, nil] The employee's income as reported by the provider. This may not always be annual @@ -428,6 +441,21 @@ module Ethnicity # @return [Array] end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#flsa_status + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT = :exempt + NON_EXEMPT = :non_exempt + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + # The gender of the individual. # # @see FinchAPI::Models::Sandbox::DirectoryCreateParams::Body#gender diff --git a/lib/finch_api/models/sandbox/employment_update_params.rb b/lib/finch_api/models/sandbox/employment_update_params.rb index 7989b35b..dd928436 100644 --- a/lib/finch_api/models/sandbox/employment_update_params.rb +++ b/lib/finch_api/models/sandbox/employment_update_params.rb @@ -8,6 +8,11 @@ class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute individual_id + # + # @return [String] + required :individual_id, String + # @!attribute class_code # Worker's compensation classification code for this employee # @@ -57,6 +62,13 @@ class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :first_name, String, nil?: true + # @!attribute flsa_status + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::FlsaStatus, nil] + optional :flsa_status, enum: -> { FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus }, nil?: true + # @!attribute income # The employee's income as reported by the provider. This may not always be # annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, @@ -124,10 +136,12 @@ class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :title, String, nil?: true - # @!method initialize(class_code: nil, custom_fields: nil, department: nil, employment: nil, employment_status: nil, end_date: nil, first_name: nil, income: nil, income_history: nil, is_active: nil, last_name: nil, latest_rehire_date: nil, location: nil, manager: nil, middle_name: nil, source_id: nil, start_date: nil, title: nil, request_options: {}) + # @!method initialize(individual_id:, class_code: nil, custom_fields: nil, department: nil, employment: nil, employment_status: nil, end_date: nil, first_name: nil, flsa_status: 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: {}) # Some parameter documentations has been truncated, see # {FinchAPI::Models::Sandbox::EmploymentUpdateParams} for more details. # + # @param individual_id [String] + # # @param class_code [String, nil] Worker's compensation classification code for this employee # # @param custom_fields [Array, nil] Custom fields for the individual. These are fields which are defined by the empl @@ -142,6 +156,8 @@ class EmploymentUpdateParams < FinchAPI::Internal::Type::BaseModel # # @param first_name [String, nil] The legal first name of the individual. # + # @param flsa_status [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::FlsaStatus, nil] The FLSA status of the individual. Available options: `exempt`, `non_exempt`, `u + # # @param income [FinchAPI::Models::Income, nil] The employee's income as reported by the provider. This may not always be annual # # @param income_history [Array, nil] The array of income history. @@ -272,6 +288,19 @@ module EmploymentStatus # @return [Array] end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT = :exempt + NON_EXEMPT = :non_exempt + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute id # A stable Finch `id` (UUID v4) for an individual in the company. diff --git a/lib/finch_api/models/sandbox/employment_update_response.rb b/lib/finch_api/models/sandbox/employment_update_response.rb index 446c273a..1a1112f3 100644 --- a/lib/finch_api/models/sandbox/employment_update_response.rb +++ b/lib/finch_api/models/sandbox/employment_update_response.rb @@ -58,6 +58,15 @@ class EmploymentUpdateResponse < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :first_name, String, nil?: true + # @!attribute flsa_status + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus, nil] + optional :flsa_status, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus }, + nil?: true + # @!attribute income # The employee's income as reported by the provider. This may not always be # annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, @@ -125,7 +134,7 @@ class EmploymentUpdateResponse < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :title, String, nil?: true - # @!method initialize(id: nil, class_code: nil, custom_fields: nil, department: nil, employment: nil, employment_status: nil, end_date: nil, first_name: nil, income: nil, income_history: nil, is_active: nil, last_name: nil, latest_rehire_date: nil, location: nil, manager: nil, middle_name: nil, source_id: nil, start_date: nil, title: nil) + # @!method initialize(id: nil, class_code: nil, custom_fields: nil, department: nil, employment: nil, employment_status: nil, end_date: nil, first_name: nil, flsa_status: 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) # Some parameter documentations has been truncated, see # {FinchAPI::Models::Sandbox::EmploymentUpdateResponse} for more details. # @@ -145,6 +154,8 @@ class EmploymentUpdateResponse < FinchAPI::Internal::Type::BaseModel # # @param first_name [String, nil] The legal first name of the individual. # + # @param flsa_status [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus, nil] The FLSA status of the individual. Available options: `exempt`, `non_exempt`, `u + # # @param income [FinchAPI::Models::Income, nil] The employee's income as reported by the provider. This may not always be annual # # @param income_history [Array, nil] The array of income history. @@ -277,6 +288,21 @@ module EmploymentStatus # @return [Array] end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + # + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse#flsa_status + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT = :exempt + NON_EXEMPT = :non_exempt + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + # @see FinchAPI::Models::Sandbox::EmploymentUpdateResponse#manager class Manager < FinchAPI::Internal::Type::BaseModel # @!attribute id diff --git a/lib/finch_api/models/sandbox/individual_update_params.rb b/lib/finch_api/models/sandbox/individual_update_params.rb index 01a07c0d..6ed42b15 100644 --- a/lib/finch_api/models/sandbox/individual_update_params.rb +++ b/lib/finch_api/models/sandbox/individual_update_params.rb @@ -8,6 +8,11 @@ class IndividualUpdateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute individual_id + # + # @return [String] + required :individual_id, String + # @!attribute dob # # @return [String, nil] @@ -88,10 +93,12 @@ class IndividualUpdateParams < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :ssn, String, nil?: true - # @!method initialize(dob: nil, emails: nil, encrypted_ssn: nil, ethnicity: nil, first_name: nil, gender: nil, last_name: nil, middle_name: nil, phone_numbers: nil, preferred_name: nil, residence: nil, ssn: nil, request_options: {}) + # @!method initialize(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: {}) # Some parameter documentations has been truncated, see # {FinchAPI::Models::Sandbox::IndividualUpdateParams} for more details. # + # @param individual_id [String] + # # @param dob [String, nil] # # @param emails [Array, nil] diff --git a/lib/finch_api/resources/access_tokens.rb b/lib/finch_api/resources/access_tokens.rb index 9efb267d..a3898776 100644 --- a/lib/finch_api/resources/access_tokens.rb +++ b/lib/finch_api/resources/access_tokens.rb @@ -27,6 +27,7 @@ def create(params) path: "auth/token", body: parsed, model: FinchAPI::CreateAccessTokenResponse, + security: {}, options: options ) end diff --git a/lib/finch_api/resources/account.rb b/lib/finch_api/resources/account.rb index 0a8ec282..ebaa9431 100644 --- a/lib/finch_api/resources/account.rb +++ b/lib/finch_api/resources/account.rb @@ -17,6 +17,7 @@ def disconnect(params = {}) method: :post, path: "disconnect", model: FinchAPI::DisconnectResponse, + security: {bearer_auth: true}, options: params[:request_options] ) end @@ -35,6 +36,7 @@ def introspect(params = {}) method: :get, path: "introspect", model: FinchAPI::Introspection, + security: {bearer_auth: true}, options: params[:request_options] ) end diff --git a/lib/finch_api/resources/connect/sessions.rb b/lib/finch_api/resources/connect/sessions.rb index 3d850a1f..625186cd 100644 --- a/lib/finch_api/resources/connect/sessions.rb +++ b/lib/finch_api/resources/connect/sessions.rb @@ -41,6 +41,7 @@ def new(params) path: "connect/sessions", body: parsed, model: FinchAPI::Models::Connect::SessionNewResponse, + security: {basic_auth: true}, options: options ) end @@ -72,6 +73,7 @@ def reauthenticate(params) path: "connect/sessions/reauthenticate", body: parsed, model: FinchAPI::Models::Connect::SessionReauthenticateResponse, + security: {basic_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/benefits.rb b/lib/finch_api/resources/hris/benefits.rb index 9f72a62d..6d2988e3 100644 --- a/lib/finch_api/resources/hris/benefits.rb +++ b/lib/finch_api/resources/hris/benefits.rb @@ -31,14 +31,16 @@ class Benefits # # @see FinchAPI::Models::HRIS::BenefitCreateParams def create(params = {}) - parsed, options = FinchAPI::HRIS::BenefitCreateParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::BenefitCreateParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/benefits", - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), model: FinchAPI::HRIS::CreateCompanyBenefitsResponse, + security: {bearer_auth: true}, options: options ) end @@ -58,11 +60,13 @@ def create(params = {}) # @see FinchAPI::Models::HRIS::BenefitRetrieveParams def retrieve(benefit_id, params = {}) parsed, options = FinchAPI::HRIS::BenefitRetrieveParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["employer/benefits/%1$s", benefit_id], - query: parsed, + query: query, model: FinchAPI::HRIS::CompanyBenefit, + security: {bearer_auth: true}, options: options ) end @@ -83,14 +87,16 @@ def retrieve(benefit_id, params = {}) # # @see FinchAPI::Models::HRIS::BenefitUpdateParams def update(benefit_id, params = {}) - parsed, options = FinchAPI::HRIS::BenefitUpdateParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::BenefitUpdateParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: ["employer/benefits/%1$s", benefit_id], - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), model: FinchAPI::HRIS::UpdateCompanyBenefitResponse, + security: {bearer_auth: true}, options: options ) end @@ -108,12 +114,14 @@ def update(benefit_id, params = {}) # @see FinchAPI::Models::HRIS::BenefitListParams def list(params = {}) parsed, options = FinchAPI::HRIS::BenefitListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/benefits", - query: parsed, + query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::CompanyBenefit, + security: {bearer_auth: true}, options: options ) end @@ -131,12 +139,14 @@ def list(params = {}) # @see FinchAPI::Models::HRIS::BenefitListSupportedBenefitsParams def list_supported_benefits(params = {}) parsed, options = FinchAPI::HRIS::BenefitListSupportedBenefitsParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/benefits/meta", - query: parsed, + query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::SupportedBenefit, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/benefits/individuals.rb b/lib/finch_api/resources/hris/benefits/individuals.rb index 8ec78fa6..fc4666c4 100644 --- a/lib/finch_api/resources/hris/benefits/individuals.rb +++ b/lib/finch_api/resources/hris/benefits/individuals.rb @@ -25,12 +25,14 @@ class Individuals # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams def enroll_many(benefit_id, params = {}) parsed, options = FinchAPI::HRIS::Benefits::IndividualEnrollManyParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.except(:individuals)) @client.request( method: :post, path: ["employer/benefits/%1$s/individuals", benefit_id], - query: parsed.except(:individuals), + query: query, body: parsed[:individuals], model: FinchAPI::HRIS::Benefits::EnrolledIndividualBenefitResponse, + security: {bearer_auth: true}, options: options ) end @@ -50,11 +52,13 @@ def enroll_many(benefit_id, params = {}) # @see FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsParams def enrolled_ids(benefit_id, params = {}) parsed, options = FinchAPI::HRIS::Benefits::IndividualEnrolledIDsParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["employer/benefits/%1$s/enrolled", benefit_id], - query: parsed, + query: query, model: FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse, + security: {bearer_auth: true}, options: options ) end @@ -80,12 +84,14 @@ def enrolled_ids(benefit_id, params = {}) # @see FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams def retrieve_many_benefits(benefit_id, params = {}) parsed, options = FinchAPI::HRIS::Benefits::IndividualRetrieveManyBenefitsParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["employer/benefits/%1$s/individuals", benefit_id], - query: parsed, + query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::Benefits::IndividualBenefit, + security: {bearer_auth: true}, options: options ) end @@ -106,14 +112,16 @@ def retrieve_many_benefits(benefit_id, params = {}) # # @see FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams def unenroll_many(benefit_id, params = {}) - parsed, options = FinchAPI::HRIS::Benefits::IndividualUnenrollManyParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::Benefits::IndividualUnenrollManyParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :delete, path: ["employer/benefits/%1$s/individuals", benefit_id], - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), model: FinchAPI::HRIS::Benefits::UnenrolledIndividualBenefitResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/company.rb b/lib/finch_api/resources/hris/company.rb index 6a93f9fb..94dfbd24 100644 --- a/lib/finch_api/resources/hris/company.rb +++ b/lib/finch_api/resources/hris/company.rb @@ -20,11 +20,13 @@ class Company # @see FinchAPI::Models::HRIS::CompanyRetrieveParams def retrieve(params = {}) parsed, options = FinchAPI::HRIS::CompanyRetrieveParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/company", - query: parsed, + query: query, model: FinchAPI::HRIS::HRISCompany, + security: {bearer_auth: true}, options: options ) 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 index 26bb84ca..4e3d8f48 100644 --- a/lib/finch_api/resources/hris/company/pay_statement_item.rb +++ b/lib/finch_api/resources/hris/company/pay_statement_item.rb @@ -35,12 +35,14 @@ class PayStatementItem # @see FinchAPI::Models::HRIS::Company::PayStatementItemListParams def list(params = {}) parsed, options = FinchAPI::HRIS::Company::PayStatementItemListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/pay-statement-item", - query: parsed, + query: query, page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse, + security: {bearer_auth: true}, options: options ) 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 index c7085069..d8c4bffa 100644 --- a/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb +++ b/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb @@ -35,14 +35,16 @@ class Rules # # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateParams def create(params = {}) - parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleCreateParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleCreateParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/pay-statement-item/rule", - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse, + security: {bearer_auth: true}, options: options ) end @@ -63,14 +65,16 @@ def create(params = {}) # # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateParams def update(rule_id, params = {}) - parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleUpdateParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleUpdateParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :put, path: ["employer/pay-statement-item/rule/%1$s", rule_id], - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse, + security: {bearer_auth: true}, options: options ) end @@ -88,12 +92,14 @@ def update(rule_id, params = {}) # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListParams def list(params = {}) parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/pay-statement-item/rule", - query: parsed, + query: query, page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse, + security: {bearer_auth: true}, options: options ) end @@ -113,11 +119,13 @@ def list(params = {}) # @see FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteParams def delete(rule_id, params = {}) parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleDeleteParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["employer/pay-statement-item/rule/%1$s", rule_id], - query: parsed, + query: query, model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/directory.rb b/lib/finch_api/resources/hris/directory.rb index d04b348e..cafe53a2 100644 --- a/lib/finch_api/resources/hris/directory.rb +++ b/lib/finch_api/resources/hris/directory.rb @@ -21,12 +21,14 @@ class Directory # @see FinchAPI::Models::HRIS::DirectoryListParams def list(params = {}) parsed, options = FinchAPI::HRIS::DirectoryListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/directory", - query: parsed, + query: query, page: FinchAPI::Internal::IndividualsPage, model: FinchAPI::HRIS::IndividualInDirectory, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/documents.rb b/lib/finch_api/resources/hris/documents.rb index 02ac3131..aa1bdbd9 100644 --- a/lib/finch_api/resources/hris/documents.rb +++ b/lib/finch_api/resources/hris/documents.rb @@ -29,11 +29,13 @@ class Documents # @see FinchAPI::Models::HRIS::DocumentListParams def list(params = {}) parsed, options = FinchAPI::HRIS::DocumentListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/documents", - query: parsed, + query: query, model: FinchAPI::Models::HRIS::DocumentListResponse, + security: {bearer_auth: true}, options: options ) end @@ -54,11 +56,13 @@ def list(params = {}) # @see FinchAPI::Models::HRIS::DocumentRetreiveParams def retreive(document_id, params = {}) parsed, options = FinchAPI::HRIS::DocumentRetreiveParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["employer/documents/%1$s", document_id], - query: parsed, + query: query, model: FinchAPI::Models::HRIS::DocumentRetreiveResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/employments.rb b/lib/finch_api/resources/hris/employments.rb index 6609de72..a9921f85 100644 --- a/lib/finch_api/resources/hris/employments.rb +++ b/lib/finch_api/resources/hris/employments.rb @@ -18,15 +18,17 @@ class Employments # # @see FinchAPI::Models::HRIS::EmploymentRetrieveManyParams def retrieve_many(params) - parsed, options = FinchAPI::HRIS::EmploymentRetrieveManyParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::EmploymentRetrieveManyParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/employment", - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::HRIS::EmploymentDataResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/individuals.rb b/lib/finch_api/resources/hris/individuals.rb index 9f9182f6..e9c8f4a7 100644 --- a/lib/finch_api/resources/hris/individuals.rb +++ b/lib/finch_api/resources/hris/individuals.rb @@ -20,15 +20,17 @@ class Individuals # # @see FinchAPI::Models::HRIS::IndividualRetrieveManyParams def retrieve_many(params = {}) - parsed, options = FinchAPI::HRIS::IndividualRetrieveManyParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::IndividualRetrieveManyParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/individual", - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::HRIS::IndividualResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/pay_statements.rb b/lib/finch_api/resources/hris/pay_statements.rb index 40b48832..e875d15d 100644 --- a/lib/finch_api/resources/hris/pay_statements.rb +++ b/lib/finch_api/resources/hris/pay_statements.rb @@ -21,15 +21,17 @@ class PayStatements # # @see FinchAPI::Models::HRIS::PayStatementRetrieveManyParams def retrieve_many(params) - parsed, options = FinchAPI::HRIS::PayStatementRetrieveManyParams.dump_request(params) query_params = [:entity_ids] + parsed, options = FinchAPI::HRIS::PayStatementRetrieveManyParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/pay-statement", - query: parsed.slice(*query_params), + query: query, body: parsed.except(*query_params), page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::HRIS::PayStatementResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/payments.rb b/lib/finch_api/resources/hris/payments.rb index 1079291c..ef2f5059 100644 --- a/lib/finch_api/resources/hris/payments.rb +++ b/lib/finch_api/resources/hris/payments.rb @@ -24,12 +24,14 @@ class Payments # @see FinchAPI::Models::HRIS::PaymentListParams def list(params) parsed, options = FinchAPI::HRIS::PaymentListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/payment", - query: parsed, + query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::Payment, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/jobs/automated.rb b/lib/finch_api/resources/jobs/automated.rb index 08853dd8..939b1082 100644 --- a/lib/finch_api/resources/jobs/automated.rb +++ b/lib/finch_api/resources/jobs/automated.rb @@ -19,12 +19,9 @@ 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. # - # @overload create(type:, params:, request_options: {}) - # - # @param type [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] The type of job to start. - # - # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] + # @overload create(body:, request_options: {}) # + # @param body [FinchAPI::Models::Jobs::AutomatedCreateParams::Body::DataSyncAll, FinchAPI::Models::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync] # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [FinchAPI::Models::Jobs::AutomatedCreateResponse] @@ -35,8 +32,9 @@ def create(params) @client.request( method: :post, path: "jobs/automated", - body: parsed, + body: parsed[:body], model: FinchAPI::Models::Jobs::AutomatedCreateResponse, + security: {bearer_auth: true}, options: options ) end @@ -56,6 +54,7 @@ def retrieve(job_id, params = {}) method: :get, path: ["jobs/automated/%1$s", job_id], model: FinchAPI::Jobs::AutomatedAsyncJob, + security: {bearer_auth: true}, options: params[:request_options] ) end @@ -77,11 +76,13 @@ def retrieve(job_id, params = {}) # @see FinchAPI::Models::Jobs::AutomatedListParams def list(params = {}) parsed, options = FinchAPI::Jobs::AutomatedListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "jobs/automated", - query: parsed, + query: query, model: FinchAPI::Models::Jobs::AutomatedListResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/jobs/manual.rb b/lib/finch_api/resources/jobs/manual.rb index fa482da0..a0cafef7 100644 --- a/lib/finch_api/resources/jobs/manual.rb +++ b/lib/finch_api/resources/jobs/manual.rb @@ -20,6 +20,7 @@ def retrieve(job_id, params = {}) method: :get, path: ["jobs/manual/%1$s", job_id], model: FinchAPI::Jobs::ManualAsyncJob, + security: {bearer_auth: true}, options: params[:request_options] ) end diff --git a/lib/finch_api/resources/payroll/pay_groups.rb b/lib/finch_api/resources/payroll/pay_groups.rb index da14ff13..f887f8ac 100644 --- a/lib/finch_api/resources/payroll/pay_groups.rb +++ b/lib/finch_api/resources/payroll/pay_groups.rb @@ -19,11 +19,13 @@ class PayGroups # @see FinchAPI::Models::Payroll::PayGroupRetrieveParams def retrieve(pay_group_id, params = {}) parsed, options = FinchAPI::Payroll::PayGroupRetrieveParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["employer/pay-groups/%1$s", pay_group_id], - query: parsed, + query: query, model: FinchAPI::Models::Payroll::PayGroupRetrieveResponse, + security: {bearer_auth: true}, options: options ) end @@ -45,12 +47,14 @@ def retrieve(pay_group_id, params = {}) # @see FinchAPI::Models::Payroll::PayGroupListParams def list(params = {}) parsed, options = FinchAPI::Payroll::PayGroupListParams.dump_request(params) + query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/pay-groups", - query: parsed, + query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::Payroll::PayGroupListResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/providers.rb b/lib/finch_api/resources/providers.rb index 7c278011..d4bf5071 100644 --- a/lib/finch_api/resources/providers.rb +++ b/lib/finch_api/resources/providers.rb @@ -18,6 +18,7 @@ def list(params = {}) path: "providers", page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::ProviderListResponse, + security: {bearer_auth: true}, options: params[:request_options] ) end diff --git a/lib/finch_api/resources/request_forwarding.rb b/lib/finch_api/resources/request_forwarding.rb index 44222145..715a0a8d 100644 --- a/lib/finch_api/resources/request_forwarding.rb +++ b/lib/finch_api/resources/request_forwarding.rb @@ -35,6 +35,7 @@ def forward(params) path: "forward", body: parsed, model: FinchAPI::Models::RequestForwardingForwardResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/company.rb b/lib/finch_api/resources/sandbox/company.rb index 34f959df..68431a86 100644 --- a/lib/finch_api/resources/sandbox/company.rb +++ b/lib/finch_api/resources/sandbox/company.rb @@ -39,6 +39,7 @@ def update(params) path: "sandbox/company", body: parsed, model: FinchAPI::Models::Sandbox::CompanyUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/connections.rb b/lib/finch_api/resources/sandbox/connections.rb index a6c7389f..f8653157 100644 --- a/lib/finch_api/resources/sandbox/connections.rb +++ b/lib/finch_api/resources/sandbox/connections.rb @@ -34,6 +34,7 @@ def create(params) path: "sandbox/connections", body: parsed, model: FinchAPI::Models::Sandbox::ConnectionCreateResponse, + security: {basic_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/connections/accounts.rb b/lib/finch_api/resources/sandbox/connections/accounts.rb index e769c1dc..4b5e7028 100644 --- a/lib/finch_api/resources/sandbox/connections/accounts.rb +++ b/lib/finch_api/resources/sandbox/connections/accounts.rb @@ -32,6 +32,7 @@ def create(params) path: "sandbox/connections/accounts", body: parsed, model: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse, + security: {basic_auth: true}, options: options ) end @@ -54,6 +55,7 @@ def update(params = {}) path: "sandbox/connections/accounts", body: parsed, model: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/directory.rb b/lib/finch_api/resources/sandbox/directory.rb index 1589a91f..d046b784 100644 --- a/lib/finch_api/resources/sandbox/directory.rb +++ b/lib/finch_api/resources/sandbox/directory.rb @@ -25,6 +25,7 @@ def create(params = {}) path: "sandbox/directory", body: parsed[:body], model: FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown], + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/employment.rb b/lib/finch_api/resources/sandbox/employment.rb index 2a6b351c..7e7ba659 100644 --- a/lib/finch_api/resources/sandbox/employment.rb +++ b/lib/finch_api/resources/sandbox/employment.rb @@ -9,7 +9,7 @@ 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: {}) + # @overload update(individual_id, class_code: nil, custom_fields: nil, department: nil, employment: nil, employment_status: nil, end_date: nil, first_name: nil, flsa_status: 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] # @@ -27,6 +27,8 @@ class Employment # # @param first_name [String, nil] The legal first name of the individual. # + # @param flsa_status [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::FlsaStatus, nil] The FLSA status of the individual. Available options: `exempt`, `non_exempt`, `u + # # @param income [FinchAPI::Models::Income, nil] The employee's income as reported by the provider. This may not always be annual # # @param income_history [Array, nil] The array of income history. @@ -61,6 +63,7 @@ def update(individual_id, params = {}) path: ["sandbox/employment/%1$s", individual_id], body: parsed, model: FinchAPI::Models::Sandbox::EmploymentUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/individual.rb b/lib/finch_api/resources/sandbox/individual.rb index 37b0ab55..d7cf1b0c 100644 --- a/lib/finch_api/resources/sandbox/individual.rb +++ b/lib/finch_api/resources/sandbox/individual.rb @@ -49,6 +49,7 @@ def update(individual_id, params = {}) path: ["sandbox/individual/%1$s", individual_id], body: parsed, model: FinchAPI::Models::Sandbox::IndividualUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/jobs.rb b/lib/finch_api/resources/sandbox/jobs.rb index ee2b236f..0d7de510 100644 --- a/lib/finch_api/resources/sandbox/jobs.rb +++ b/lib/finch_api/resources/sandbox/jobs.rb @@ -25,6 +25,7 @@ def create(params) path: "sandbox/jobs", body: parsed, model: FinchAPI::Models::Sandbox::JobCreateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/jobs/configuration.rb b/lib/finch_api/resources/sandbox/jobs/configuration.rb index 6e21c45e..c9a5800c 100644 --- a/lib/finch_api/resources/sandbox/jobs/configuration.rb +++ b/lib/finch_api/resources/sandbox/jobs/configuration.rb @@ -19,6 +19,7 @@ def retrieve(params = {}) method: :get, path: "sandbox/jobs/configuration", model: FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::Jobs::SandboxJobConfiguration], + security: {bearer_auth: true}, options: params[:request_options] ) end @@ -41,6 +42,7 @@ def update(params) path: "sandbox/jobs/configuration", body: parsed, model: FinchAPI::Sandbox::Jobs::SandboxJobConfiguration, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/payment.rb b/lib/finch_api/resources/sandbox/payment.rb index ab0edb7d..e6e97027 100644 --- a/lib/finch_api/resources/sandbox/payment.rb +++ b/lib/finch_api/resources/sandbox/payment.rb @@ -26,6 +26,7 @@ def create(params = {}) path: "sandbox/payment", body: parsed, model: FinchAPI::Models::Sandbox::PaymentCreateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/version.rb b/lib/finch_api/version.rb index b6329508..d0a78b57 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.pre.alpha.42" + VERSION = "0.1.0.pre.alpha.43" end diff --git a/rbi/finch_api/client.rbi b/rbi/finch_api/client.rbi index 4c795423..61746386 100644 --- a/rbi/finch_api/client.rbi +++ b/rbi/finch_api/client.rbi @@ -19,6 +19,9 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_reader :client_secret + sig { returns(T.nilable(String)) } + attr_reader :webhook_secret + sig { returns(FinchAPI::Resources::AccessTokens) } attr_reader :access_tokens @@ -50,8 +53,12 @@ module FinchAPI attr_reader :connect # @api private - sig { override.returns(T::Hash[String, String]) } - private def auth_headers + sig do + override + .params(security: { bearer_auth: T::Boolean, basic_auth: T::Boolean }) + .returns(T::Hash[String, String]) + end + private def auth_headers(security:) end # @api private @@ -70,6 +77,7 @@ module FinchAPI client_id: T.nilable(String), client_secret: T.nilable(String), access_token: T.nilable(String), + webhook_secret: T.nilable(String), base_url: T.nilable(String), max_retries: Integer, timeout: Float, @@ -83,6 +91,8 @@ module FinchAPI # Defaults to `ENV["FINCH_CLIENT_SECRET"]` client_secret: ENV["FINCH_CLIENT_SECRET"], access_token: nil, + # Defaults to `ENV["FINCH_WEBHOOK_SECRET"]` + webhook_secret: ENV["FINCH_WEBHOOK_SECRET"], # Override the default base URL for the API, e.g., # `"https://api.example.com/v2/"`. Defaults to `ENV["FINCH_BASE_URL"]` base_url: ENV["FINCH_BASE_URL"], diff --git a/rbi/finch_api/internal/transport/base_client.rbi b/rbi/finch_api/internal/transport/base_client.rbi index 3f33b2f5..4f5573a1 100644 --- a/rbi/finch_api/internal/transport/base_client.rbi +++ b/rbi/finch_api/internal/transport/base_client.rbi @@ -51,6 +51,8 @@ module FinchAPI ), stream: T.nilable(T::Class[T.anything]), model: T.nilable(FinchAPI::Internal::Type::Converter::Input), + security: + T.nilable({ bearer_auth: T::Boolean, basic_auth: T::Boolean }), options: T.nilable(FinchAPI::RequestOptions::OrHash) } end @@ -228,7 +230,7 @@ module FinchAPI # 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: {}) + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, security: {bearer_auth: true, basic_auth: true}, options: {}) sig do params( method: Symbol, @@ -270,6 +272,8 @@ module FinchAPI ), stream: T.nilable(T::Class[T.anything]), model: T.nilable(FinchAPI::Internal::Type::Converter::Input), + security: + T.nilable({ bearer_auth: T::Boolean, basic_auth: T::Boolean }), options: T.nilable(FinchAPI::RequestOptions::OrHash) ).returns(T.anything) end @@ -283,6 +287,7 @@ module FinchAPI page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, + security: { bearer_auth: true, basic_auth: true }, options: {} ) end diff --git a/rbi/finch_api/internal/util.rbi b/rbi/finch_api/internal/util.rbi index 0bccd650..f49c2164 100644 --- a/rbi/finch_api/internal/util.rbi +++ b/rbi/finch_api/internal/util.rbi @@ -148,12 +148,20 @@ module FinchAPI end end + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp) + class << self # @api private sig { params(uri: URI::Generic).returns(String) } def uri_origin(uri) end + # @api private + sig { params(path: T.any(String, Integer)).returns(String) } + def encode_path(path) + end + # @api private sig { params(path: T.any(String, T::Array[String])).returns(String) } def interpolate_path(path) @@ -296,11 +304,31 @@ module FinchAPI end JSON_CONTENT = - T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp) + T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp) JSONL_CONTENT = T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp) class << self + # @api private + sig do + params(query: FinchAPI::Internal::AnyHash).returns( + FinchAPI::Internal::AnyHash + ) + end + def encode_query_params(query) + end + + # @api private + sig do + params( + collection: FinchAPI::Internal::AnyHash, + key: String, + element: T.anything + ).void + end + private def write_query_param_element!(collection, key, element) + end + # @api private sig do params( diff --git a/rbi/finch_api/models/create_access_token_response.rbi b/rbi/finch_api/models/create_access_token_response.rbi index c2e95d72..42c8950c 100644 --- a/rbi/finch_api/models/create_access_token_response.rbi +++ b/rbi/finch_api/models/create_access_token_response.rbi @@ -73,6 +73,11 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_accessor :customer_id + # The name of your customer you provided to Finch when a connect session was + # created for this connection + sig { returns(T.nilable(String)) } + attr_accessor :customer_name + sig do params( access_token: String, @@ -87,7 +92,8 @@ module FinchAPI token_type: String, account_id: String, company_id: String, - customer_id: T.nilable(String) + customer_id: T.nilable(String), + customer_name: T.nilable(String) ).returns(T.attached_class) end def self.new( @@ -118,7 +124,10 @@ module FinchAPI company_id: nil, # The ID of your customer you provided to Finch when a connect session was created # for this connection - customer_id: nil + customer_id: nil, + # The name of your customer you provided to Finch when a connect session was + # created for this connection + customer_name: nil ) end @@ -137,7 +146,8 @@ module FinchAPI token_type: String, account_id: String, company_id: String, - customer_id: T.nilable(String) + customer_id: T.nilable(String), + customer_name: T.nilable(String) } ) end diff --git a/rbi/finch_api/models/hris/benefit_retrieve_params.rbi b/rbi/finch_api/models/hris/benefit_retrieve_params.rbi index 4d603cc8..35fbf017 100644 --- a/rbi/finch_api/models/hris/benefit_retrieve_params.rbi +++ b/rbi/finch_api/models/hris/benefit_retrieve_params.rbi @@ -15,6 +15,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :benefit_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -24,11 +27,13 @@ module FinchAPI sig do params( + benefit_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + benefit_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, request_options: {} @@ -38,6 +43,7 @@ module FinchAPI sig do override.returns( { + benefit_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/rbi/finch_api/models/hris/benefit_update_params.rbi b/rbi/finch_api/models/hris/benefit_update_params.rbi index abd51115..5fa0d03f 100644 --- a/rbi/finch_api/models/hris/benefit_update_params.rbi +++ b/rbi/finch_api/models/hris/benefit_update_params.rbi @@ -15,6 +15,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :benefit_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -31,12 +34,14 @@ module FinchAPI sig do params( + benefit_id: String, entity_ids: T::Array[String], description: String, request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + benefit_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, # Updated name or description. @@ -48,6 +53,7 @@ module FinchAPI sig do override.returns( { + benefit_id: String, entity_ids: T::Array[String], description: String, request_options: FinchAPI::RequestOptions diff --git a/rbi/finch_api/models/hris/benefits/individual_enroll_many_params.rbi b/rbi/finch_api/models/hris/benefits/individual_enroll_many_params.rbi index 40c6886d..4686034c 100644 --- a/rbi/finch_api/models/hris/benefits/individual_enroll_many_params.rbi +++ b/rbi/finch_api/models/hris/benefits/individual_enroll_many_params.rbi @@ -16,6 +16,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :benefit_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -47,6 +50,7 @@ module FinchAPI sig do params( + benefit_id: String, entity_ids: T::Array[String], individuals: T::Array[ @@ -56,6 +60,7 @@ module FinchAPI ).returns(T.attached_class) end def self.new( + benefit_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, # Array of the individual_id to enroll and a configuration object. @@ -67,6 +72,7 @@ module FinchAPI sig do override.returns( { + benefit_id: String, entity_ids: T::Array[String], individuals: T::Array[ diff --git a/rbi/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi b/rbi/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi index cbca21d2..db6afa40 100644 --- a/rbi/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi +++ b/rbi/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbi @@ -16,6 +16,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :benefit_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -25,11 +28,13 @@ module FinchAPI sig do params( + benefit_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + benefit_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, request_options: {} @@ -39,6 +44,7 @@ module FinchAPI sig do override.returns( { + benefit_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/rbi/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi b/rbi/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi index 0f0252b0..c6c49169 100644 --- a/rbi/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi +++ b/rbi/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi @@ -16,6 +16,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :benefit_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -33,12 +36,14 @@ module FinchAPI sig do params( + benefit_id: String, entity_ids: T::Array[String], individual_ids: String, request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + benefit_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, # comma-delimited list of stable Finch uuids for each individual. If empty, @@ -51,6 +56,7 @@ module FinchAPI sig do override.returns( { + benefit_id: String, entity_ids: T::Array[String], individual_ids: String, request_options: FinchAPI::RequestOptions diff --git a/rbi/finch_api/models/hris/benefits/individual_unenroll_many_params.rbi b/rbi/finch_api/models/hris/benefits/individual_unenroll_many_params.rbi index d578e596..c284593f 100644 --- a/rbi/finch_api/models/hris/benefits/individual_unenroll_many_params.rbi +++ b/rbi/finch_api/models/hris/benefits/individual_unenroll_many_params.rbi @@ -16,6 +16,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :benefit_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -32,12 +35,14 @@ module FinchAPI sig do params( + benefit_id: String, entity_ids: T::Array[String], individual_ids: T::Array[String], request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + benefit_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, # Array of individual_ids to unenroll. @@ -49,6 +54,7 @@ module FinchAPI sig do override.returns( { + benefit_id: String, entity_ids: T::Array[String], individual_ids: T::Array[String], request_options: FinchAPI::RequestOptions diff --git a/rbi/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi b/rbi/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi index 82b4a4f4..76a72572 100644 --- a/rbi/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi +++ b/rbi/finch_api/models/hris/company/pay_statement_item/rule_delete_params.rbi @@ -17,6 +17,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :rule_id + # The entity IDs to delete the rule for. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -26,11 +29,13 @@ module FinchAPI sig do params( + rule_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + rule_id:, # The entity IDs to delete the rule for. entity_ids: nil, request_options: {} @@ -40,6 +45,7 @@ module FinchAPI sig do override.returns( { + rule_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/rbi/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi b/rbi/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi index 49c1c0cf..9995fad7 100644 --- a/rbi/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi +++ b/rbi/finch_api/models/hris/company/pay_statement_item/rule_update_params.rbi @@ -17,6 +17,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :rule_id + # The entity IDs to update the rule for. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -32,12 +35,14 @@ module FinchAPI sig do params( + rule_id: String, entity_ids: T::Array[String], optional_property: T.anything, request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + rule_id:, # The entity IDs to update the rule for. entity_ids: nil, optional_property: nil, @@ -48,6 +53,7 @@ module FinchAPI sig do override.returns( { + rule_id: String, entity_ids: T::Array[String], optional_property: T.anything, request_options: FinchAPI::RequestOptions diff --git a/rbi/finch_api/models/hris/document_retreive_params.rbi b/rbi/finch_api/models/hris/document_retreive_params.rbi index a4245901..b9d28283 100644 --- a/rbi/finch_api/models/hris/document_retreive_params.rbi +++ b/rbi/finch_api/models/hris/document_retreive_params.rbi @@ -15,6 +15,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :document_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -24,11 +27,13 @@ module FinchAPI sig do params( + document_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + document_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, request_options: {} @@ -38,6 +43,7 @@ module FinchAPI sig do override.returns( { + document_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/rbi/finch_api/models/hris/employment_data.rbi b/rbi/finch_api/models/hris/employment_data.rbi index e8b8f715..ac9c8874 100644 --- a/rbi/finch_api/models/hris/employment_data.rbi +++ b/rbi/finch_api/models/hris/employment_data.rbi @@ -88,6 +88,17 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_accessor :first_name + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + sig do + returns( + T.nilable( + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::TaggedSymbol + ) + ) + end + attr_accessor :flsa_status + # `true` if the individual an an active employee or contractor at the company. sig { returns(T.nilable(T::Boolean)) } attr_accessor :is_active @@ -187,6 +198,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::OrSymbol + ), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), @@ -225,6 +240,9 @@ module FinchAPI end_date:, # The legal first name of the individual. first_name:, + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + flsa_status:, # `true` if the individual an an active employee or contractor at the company. is_active:, # The legal last name of the individual. @@ -274,6 +292,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::TaggedSymbol + ), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), latest_rehire_date: T.nilable(String), @@ -549,6 +571,47 @@ module FinchAPI end end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXEMPT = + T.let( + :exempt, + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::TaggedSymbol + ) + NON_EXEMPT = + T.let( + :non_exempt, + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + FinchAPI::HRIS::EmploymentData::UnionMember0::FlsaStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + class Manager < FinchAPI::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/finch_api/models/introspection.rbi b/rbi/finch_api/models/introspection.rbi index 69347887..c3202d56 100644 --- a/rbi/finch_api/models/introspection.rbi +++ b/rbi/finch_api/models/introspection.rbi @@ -578,11 +578,16 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_accessor :source_id + # The status of the entity connection + sig { returns(FinchAPI::Introspection::Entity::Status::TaggedSymbol) } + attr_accessor :status + sig do params( id: String, name: T.nilable(String), - source_id: T.nilable(String) + source_id: T.nilable(String), + status: FinchAPI::Introspection::Entity::Status::OrSymbol ).returns(T.attached_class) end def self.new( @@ -591,7 +596,9 @@ module FinchAPI # The name of the entity (payroll provider company name) name:, # The source ID of the entity - source_id: + source_id:, + # The status of the entity connection + status: ) end @@ -600,12 +607,68 @@ module FinchAPI { id: String, name: T.nilable(String), - source_id: T.nilable(String) + source_id: T.nilable(String), + status: FinchAPI::Introspection::Entity::Status::TaggedSymbol } ) end def to_hash end + + # The status of the entity connection + module Status + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Introspection::Entity::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + PROCESSING = + T.let( + :processing, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + CONNECTED = + T.let( + :connected, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + ERROR_NO_ACCOUNT_SETUP = + T.let( + :error_no_account_setup, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + ERROR_PERMISSIONS = + T.let( + :error_permissions, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + REAUTH = + T.let( + :reauth, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + DISCONNECTED = + T.let( + :disconnected, + FinchAPI::Introspection::Entity::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[FinchAPI::Introspection::Entity::Status::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/finch_api/models/jobs/automated_create_params.rbi b/rbi/finch_api/models/jobs/automated_create_params.rbi index 1b0c03a1..04cacd82 100644 --- a/rbi/finch_api/models/jobs/automated_create_params.rbi +++ b/rbi/finch_api/models/jobs/automated_create_params.rbi @@ -15,40 +15,37 @@ module FinchAPI ) end - # The type of job to start. - sig { returns(FinchAPI::Jobs::AutomatedCreateParams::Type::OrSymbol) } - attr_accessor :type - - sig { returns(FinchAPI::Jobs::AutomatedCreateParams::Params) } - attr_reader :params - sig do - params( - params: FinchAPI::Jobs::AutomatedCreateParams::Params::OrHash - ).void + returns( + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll, + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync + ) + ) end - attr_writer :params + attr_accessor :body sig do params( - type: FinchAPI::Jobs::AutomatedCreateParams::Type::OrSymbol, - params: FinchAPI::Jobs::AutomatedCreateParams::Params::OrHash, + body: + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll::OrHash, + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::OrHash + ), request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new( - # The type of job to start. - type:, - params:, - request_options: {} - ) + def self.new(body:, request_options: {}) end sig do override.returns( { - type: FinchAPI::Jobs::AutomatedCreateParams::Type::OrSymbol, - params: FinchAPI::Jobs::AutomatedCreateParams::Params, + body: + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll, + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync + ), request_options: FinchAPI::RequestOptions } ) @@ -56,55 +53,128 @@ module FinchAPI def to_hash end - # The type of job to start. - module Type - extend FinchAPI::Internal::Type::Enum + module Body + extend FinchAPI::Internal::Type::Union - TaggedSymbol = + Variants = T.type_alias do - T.all(Symbol, FinchAPI::Jobs::AutomatedCreateParams::Type) + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll, + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync + ) end - OrSymbol = T.type_alias { T.any(Symbol, String) } - W4_FORM_EMPLOYEE_SYNC = - T.let( - :w4_form_employee_sync, - FinchAPI::Jobs::AutomatedCreateParams::Type::TaggedSymbol - ) + class DataSyncAll < FinchAPI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll, + FinchAPI::Internal::AnyHash + ) + end - sig do - override.returns( - T::Array[ - FinchAPI::Jobs::AutomatedCreateParams::Type::TaggedSymbol - ] + # The type of job to start. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(type: Symbol).returns(T.attached_class) } + def self.new( + # The type of job to start. + type: :data_sync_all ) + end + + sig { override.returns({ type: Symbol }) } + def to_hash + end end - def self.values - end - end - class Params < FinchAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - FinchAPI::Jobs::AutomatedCreateParams::Params, - FinchAPI::Internal::AnyHash + class W4FormEmployeeSync < FinchAPI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync, + FinchAPI::Internal::AnyHash + ) + end + + sig do + returns( + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params ) end + attr_reader :params - # The unique ID of the individual for W-4 data sync. - sig { returns(String) } - attr_accessor :individual_id + sig do + params( + params: + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params::OrHash + ).void + end + attr_writer :params - sig { params(individual_id: String).returns(T.attached_class) } - def self.new( - # The unique ID of the individual for W-4 data sync. - individual_id: - ) + # The type of job to start. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + params: + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + params:, + # The type of job to start. + type: :w4_form_employee_sync + ) + end + + sig do + override.returns( + { + params: + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params, + type: Symbol + } + ) + end + def to_hash + end + + class Params < FinchAPI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params, + FinchAPI::Internal::AnyHash + ) + end + + # The unique ID of the individual for W-4 data sync. + sig { returns(String) } + attr_accessor :individual_id + + sig { params(individual_id: String).returns(T.attached_class) } + def self.new( + # The unique ID of the individual for W-4 data sync. + individual_id: + ) + end + + sig { override.returns({ individual_id: String }) } + def to_hash + end + end end - sig { override.returns({ individual_id: String }) } - def to_hash + sig do + override.returns( + T::Array[FinchAPI::Jobs::AutomatedCreateParams::Body::Variants] + ) + end + def self.variants end end end diff --git a/rbi/finch_api/models/jobs/automated_retrieve_params.rbi b/rbi/finch_api/models/jobs/automated_retrieve_params.rbi index daa429b3..ce029055 100644 --- a/rbi/finch_api/models/jobs/automated_retrieve_params.rbi +++ b/rbi/finch_api/models/jobs/automated_retrieve_params.rbi @@ -15,15 +15,23 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :job_id + sig do - params(request_options: FinchAPI::RequestOptions::OrHash).returns( - T.attached_class - ) + params( + job_id: String, + request_options: FinchAPI::RequestOptions::OrHash + ).returns(T.attached_class) end - def self.new(request_options: {}) + def self.new(job_id:, request_options: {}) end - sig { override.returns({ request_options: FinchAPI::RequestOptions }) } + sig do + override.returns( + { job_id: String, request_options: FinchAPI::RequestOptions } + ) + end def to_hash end end diff --git a/rbi/finch_api/models/jobs/manual_retrieve_params.rbi b/rbi/finch_api/models/jobs/manual_retrieve_params.rbi index 1b6a3dad..a6fb70bb 100644 --- a/rbi/finch_api/models/jobs/manual_retrieve_params.rbi +++ b/rbi/finch_api/models/jobs/manual_retrieve_params.rbi @@ -15,15 +15,23 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :job_id + sig do - params(request_options: FinchAPI::RequestOptions::OrHash).returns( - T.attached_class - ) + params( + job_id: String, + request_options: FinchAPI::RequestOptions::OrHash + ).returns(T.attached_class) end - def self.new(request_options: {}) + def self.new(job_id:, request_options: {}) end - sig { override.returns({ request_options: FinchAPI::RequestOptions }) } + sig do + override.returns( + { job_id: String, request_options: FinchAPI::RequestOptions } + ) + end def to_hash end end diff --git a/rbi/finch_api/models/payroll/pay_group_retrieve_params.rbi b/rbi/finch_api/models/payroll/pay_group_retrieve_params.rbi index 65fea4af..1ba66d74 100644 --- a/rbi/finch_api/models/payroll/pay_group_retrieve_params.rbi +++ b/rbi/finch_api/models/payroll/pay_group_retrieve_params.rbi @@ -15,6 +15,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :pay_group_id + # The entity IDs to specify which entities' data to access. sig { returns(T.nilable(T::Array[String])) } attr_reader :entity_ids @@ -24,11 +27,13 @@ module FinchAPI sig do params( + pay_group_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + pay_group_id:, # The entity IDs to specify which entities' data to access. entity_ids: nil, request_options: {} @@ -38,6 +43,7 @@ module FinchAPI sig do override.returns( { + pay_group_id: String, entity_ids: T::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/rbi/finch_api/models/sandbox/directory_create_params.rbi b/rbi/finch_api/models/sandbox/directory_create_params.rbi index 6965cd51..9c95fac7 100644 --- a/rbi/finch_api/models/sandbox/directory_create_params.rbi +++ b/rbi/finch_api/models/sandbox/directory_create_params.rbi @@ -170,6 +170,17 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_accessor :first_name + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + sig do + returns( + T.nilable( + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::OrSymbol + ) + ) + end + attr_accessor :flsa_status + # The gender of the individual. sig do returns( @@ -308,6 +319,10 @@ module FinchAPI FinchAPI::Sandbox::DirectoryCreateParams::Body::Ethnicity::OrSymbol ), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::OrSymbol + ), gender: T.nilable( FinchAPI::Sandbox::DirectoryCreateParams::Body::Gender::OrSymbol @@ -364,6 +379,9 @@ module FinchAPI ethnicity: nil, # The legal first name of the individual. first_name: nil, + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + flsa_status: nil, # The gender of the individual. gender: nil, # The employee's income as reported by the provider. This may not always be @@ -435,6 +453,10 @@ module FinchAPI FinchAPI::Sandbox::DirectoryCreateParams::Body::Ethnicity::OrSymbol ), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::OrSymbol + ), gender: T.nilable( FinchAPI::Sandbox::DirectoryCreateParams::Body::Gender::OrSymbol @@ -901,6 +923,47 @@ module FinchAPI end end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXEMPT = + T.let( + :exempt, + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::TaggedSymbol + ) + NON_EXEMPT = + T.let( + :non_exempt, + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + FinchAPI::Sandbox::DirectoryCreateParams::Body::FlsaStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + # The gender of the individual. module Gender extend FinchAPI::Internal::Type::Enum diff --git a/rbi/finch_api/models/sandbox/employment_update_params.rbi b/rbi/finch_api/models/sandbox/employment_update_params.rbi index b190a9e5..837e4368 100644 --- a/rbi/finch_api/models/sandbox/employment_update_params.rbi +++ b/rbi/finch_api/models/sandbox/employment_update_params.rbi @@ -15,6 +15,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :individual_id + # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } attr_accessor :class_code @@ -84,6 +87,17 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_accessor :first_name + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + sig do + returns( + T.nilable( + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::OrSymbol + ) + ) + end + attr_accessor :flsa_status + # 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. @@ -147,6 +161,7 @@ module FinchAPI sig do params( + individual_id: String, class_code: T.nilable(String), custom_fields: T.nilable( @@ -168,6 +183,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::OrSymbol + ), income: T.nilable(FinchAPI::Income::OrHash), income_history: T.nilable(T::Array[T.nilable(FinchAPI::Income::OrHash)]), @@ -187,6 +206,7 @@ module FinchAPI ).returns(T.attached_class) end def self.new( + individual_id:, # Worker's compensation classification code for this employee class_code: nil, # Custom fields for the individual. These are fields which are defined by the @@ -202,6 +222,9 @@ module FinchAPI end_date: nil, # The legal first name of the individual. first_name: nil, + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + flsa_status: nil, # The employee's income as reported by the provider. This may not always be # annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, # depending on what information the provider returns. @@ -230,6 +253,7 @@ module FinchAPI sig do override.returns( { + individual_id: String, class_code: T.nilable(String), custom_fields: T.nilable( @@ -251,6 +275,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::OrSymbol + ), income: T.nilable(FinchAPI::Income), income_history: T.nilable(T::Array[T.nilable(FinchAPI::Income)]), is_active: T.nilable(T::Boolean), @@ -550,6 +578,47 @@ module FinchAPI end end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXEMPT = + T.let( + :exempt, + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::TaggedSymbol + ) + NON_EXEMPT = + T.let( + :non_exempt, + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + class Manager < FinchAPI::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/finch_api/models/sandbox/employment_update_response.rbi b/rbi/finch_api/models/sandbox/employment_update_response.rbi index 62b5ff9a..094f3079 100644 --- a/rbi/finch_api/models/sandbox/employment_update_response.rbi +++ b/rbi/finch_api/models/sandbox/employment_update_response.rbi @@ -94,6 +94,17 @@ module FinchAPI sig { returns(T.nilable(String)) } attr_accessor :first_name + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + sig do + returns( + T.nilable( + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::TaggedSymbol + ) + ) + end + attr_accessor :flsa_status + # 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. @@ -183,6 +194,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::OrSymbol + ), income: T.nilable(FinchAPI::Income::OrHash), income_history: T.nilable(T::Array[T.nilable(FinchAPI::Income::OrHash)]), @@ -218,6 +233,9 @@ module FinchAPI end_date: nil, # The legal first name of the individual. first_name: nil, + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + flsa_status: nil, # The employee's income as reported by the provider. This may not always be # annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, # depending on what information the provider returns. @@ -267,6 +285,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::TaggedSymbol + ), income: T.nilable(FinchAPI::Income), income_history: T.nilable(T::Array[T.nilable(FinchAPI::Income)]), is_active: T.nilable(T::Boolean), @@ -567,6 +589,47 @@ module FinchAPI end end + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXEMPT = + T.let( + :exempt, + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::TaggedSymbol + ) + NON_EXEMPT = + T.let( + :non_exempt, + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + class Manager < FinchAPI::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/finch_api/models/sandbox/individual_update_params.rbi b/rbi/finch_api/models/sandbox/individual_update_params.rbi index 76c3b06c..11aad873 100644 --- a/rbi/finch_api/models/sandbox/individual_update_params.rbi +++ b/rbi/finch_api/models/sandbox/individual_update_params.rbi @@ -15,6 +15,9 @@ module FinchAPI ) end + sig { returns(String) } + attr_accessor :individual_id + sig { returns(T.nilable(String)) } attr_accessor :dob @@ -97,6 +100,7 @@ module FinchAPI sig do params( + individual_id: String, dob: T.nilable(String), emails: T.nilable( @@ -131,6 +135,7 @@ module FinchAPI ).returns(T.attached_class) end def self.new( + individual_id:, dob: nil, emails: nil, # Social Security Number of the individual in **encrypted** format. This field is @@ -163,6 +168,7 @@ module FinchAPI sig do override.returns( { + individual_id: String, dob: T.nilable(String), emails: T.nilable( diff --git a/rbi/finch_api/resources/jobs/automated.rbi b/rbi/finch_api/resources/jobs/automated.rbi index 8a14e34f..9abf0489 100644 --- a/rbi/finch_api/resources/jobs/automated.rbi +++ b/rbi/finch_api/resources/jobs/automated.rbi @@ -20,17 +20,15 @@ module FinchAPI # access to this endpoint, please contact your Finch account manager. sig do params( - type: FinchAPI::Jobs::AutomatedCreateParams::Type::OrSymbol, - params: FinchAPI::Jobs::AutomatedCreateParams::Params::OrHash, + body: + T.any( + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll::OrHash, + FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::OrHash + ), request_options: FinchAPI::RequestOptions::OrHash ).returns(FinchAPI::Models::Jobs::AutomatedCreateResponse) end - def create( - # The type of job to start. - type:, - params:, - request_options: {} - ) + def create(body:, request_options: {}) end # Get an automated job by `job_id`. diff --git a/rbi/finch_api/resources/sandbox/employment.rbi b/rbi/finch_api/resources/sandbox/employment.rbi index df6a71dc..f501c8f0 100644 --- a/rbi/finch_api/resources/sandbox/employment.rbi +++ b/rbi/finch_api/resources/sandbox/employment.rbi @@ -29,6 +29,10 @@ module FinchAPI ), end_date: T.nilable(String), first_name: T.nilable(String), + flsa_status: + T.nilable( + FinchAPI::Sandbox::EmploymentUpdateParams::FlsaStatus::OrSymbol + ), income: T.nilable(FinchAPI::Income::OrHash), income_history: T.nilable(T::Array[T.nilable(FinchAPI::Income::OrHash)]), @@ -64,6 +68,9 @@ module FinchAPI end_date: nil, # The legal first name of the individual. first_name: nil, + # The FLSA status of the individual. Available options: `exempt`, `non_exempt`, + # `unknown`. + flsa_status: nil, # The employee's income as reported by the provider. This may not always be # annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, # depending on what information the provider returns. diff --git a/scripts/mock b/scripts/mock index 0b28f6ea..886f2ffc 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,23 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.20.2 -- steady --version - # Wait for server to come online + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index e0dc1374..9fc2510b 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 00000000..4287939e --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# ANSI Color Codes +GREEN='\033[32m' +RED='\033[31m' +NC='\033[0m' # No Color + +DIST_DIR="dist" + +log_error() { + local msg="$1" + local headers="$2" + local body="$3" + echo -e "${RED}${msg}${NC}" + [[ -f "$headers" ]] && echo -e "${RED}Headers:$(cat "$headers")${NC}" + echo -e "${RED}Body: ${body}${NC}" + exit 1 +} + +upload_file() { + local file_name="$1" + local tmp_headers + tmp_headers=$(mktemp) + + if [ -f "$file_name" ]; then + echo -e "${GREEN}Processing file: $file_name${NC}" + pkg_file_name="${file_name#"${DIST_DIR}/"}" + + # Get signed URL for uploading artifact file + signed_url_response=$(curl -X POST -G "$URL" \ + -sS --retry 5 \ + -D "$tmp_headers" \ + --data-urlencode "filename=$pkg_file_name" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + + # Validate JSON and extract URL + if ! signed_url=$(echo "$signed_url_response" | jq -e -r '.url' 2>/dev/null) || [[ "$signed_url" == "null" ]]; then + log_error "Failed to get valid signed URL" "$tmp_headers" "$signed_url_response" + fi + + # Set content-type based on file extension + local extension="${file_name##*.}" + local content_type + case "$extension" in + gem) content_type="application/octet-stream" ;; + gz) content_type="application/gzip" ;; + rz) content_type="application/octet-stream" ;; + html) content_type="text/html" ;; + *) content_type="application/octet-stream" ;; + esac + + # Upload file + upload_response=$(curl -v -X PUT \ + --retry 5 \ + --retry-all-errors \ + -D "$tmp_headers" \ + -H "Content-Type: $content_type" \ + --data-binary "@${file_name}" "$signed_url" 2>&1) + + if ! echo "$upload_response" | grep -q "HTTP/[0-9.]* 200"; then + log_error "Failed to upload artifact file" "$tmp_headers" "$upload_response" + fi + + # Insert small throttle to reduce rate limiting risk + sleep 0.1 + fi +} + +walk_tree() { + local current_dir="$1" + + for entry in "$current_dir"/*; do + # Check that entry is valid + [ -e "$entry" ] || [ -h "$entry" ] || continue + + if [ -d "$entry" ]; then + walk_tree "$entry" + else + upload_file "$entry" + fi + done +} + +cd "$(dirname "$0")/../.." + +echo "::group::Building gem" +VERSION_FILE="lib/${PACKAGE_NAME}/version.rb" +if [[ ! -f "$VERSION_FILE" ]]; then + echo -e "${RED}Version file not found: ${VERSION_FILE}${NC}" + exit 1 +fi +SHORT_SHA="${SHA:0:7}" +sed -i.bak -E "s/(VERSION = \"[^\"]+)\"/\1.beta.${SHORT_SHA}\"/" "$VERSION_FILE" +rm -f "${VERSION_FILE}.bak" + +gem build +mkdir -p "${DIST_DIR}/gems" +mv ./*.gem "${DIST_DIR}/gems/" +echo "::endgroup::" + +echo "::group::Generating gem index" +gem generate_index --directory "$DIST_DIR" +echo "::endgroup::" + +echo "::group::Uploading to pkg.stainless.com" +walk_tree "$DIST_DIR" +echo "::endgroup::" + +echo -e "${GREEN}Gem artifacts uploaded to Stainless storage.${NC}" +echo -e "\033[32mInstallation: bundle remove finch-api && bundle add finch-api --source 'https://pkg.stainless.com/s/finch-ruby/$SHA'\033[0m" diff --git a/sig/finch_api/client.rbs b/sig/finch_api/client.rbs index f7350df8..b615cf9b 100644 --- a/sig/finch_api/client.rbs +++ b/sig/finch_api/client.rbs @@ -14,6 +14,8 @@ module FinchAPI attr_reader client_secret: String? + attr_reader webhook_secret: String? + attr_reader access_tokens: FinchAPI::Resources::AccessTokens attr_reader hris: FinchAPI::Resources::HRIS @@ -34,7 +36,9 @@ module FinchAPI attr_reader connect: FinchAPI::Resources::Connect - private def auth_headers: -> ::Hash[String, String] + private def auth_headers: ( + security: { bearer_auth: bool, basic_auth: bool } + ) -> ::Hash[String, String] private def bearer_auth: -> ::Hash[String, String] @@ -44,6 +48,7 @@ module FinchAPI ?client_id: String?, ?client_secret: String?, ?access_token: String?, + ?webhook_secret: String?, ?base_url: String?, ?max_retries: Integer, ?timeout: Float, diff --git a/sig/finch_api/internal/transport/base_client.rbs b/sig/finch_api/internal/transport/base_client.rbs index 70cd492e..ac0445bf 100644 --- a/sig/finch_api/internal/transport/base_client.rbs +++ b/sig/finch_api/internal/transport/base_client.rbs @@ -20,6 +20,7 @@ module FinchAPI page: Class?, stream: Class?, model: FinchAPI::Internal::Type::Converter::input?, + security: { bearer_auth: bool, basic_auth: bool }?, options: FinchAPI::request_opts? } type request_input = @@ -123,6 +124,7 @@ module FinchAPI ?page: Class?, ?stream: Class?, ?model: FinchAPI::Internal::Type::Converter::input?, + ?security: { bearer_auth: bool, basic_auth: bool }?, ?options: FinchAPI::request_opts? ) -> top diff --git a/sig/finch_api/internal/util.rbs b/sig/finch_api/internal/util.rbs index b577edac..cf6dc272 100644 --- a/sig/finch_api/internal/util.rbs +++ b/sig/finch_api/internal/util.rbs @@ -45,8 +45,12 @@ module FinchAPI -> top? } -> top? + RFC_3986_NOT_PCHARS: Regexp + def self?.uri_origin: (URI::Generic uri) -> String + def self?.encode_path: (String | Integer path) -> String + def self?.interpolate_path: (String | ::Array[String] path) -> String def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] @@ -106,6 +110,16 @@ module FinchAPI JSON_CONTENT: Regexp JSONL_CONTENT: Regexp + def encode_query_params: ( + ::Hash[Symbol, top] query + ) -> ::Hash[Symbol, top] + + private def write_query_param_element!: ( + ::Hash[Symbol, top] collection, + String key, + top element + ) -> nil + def self?.write_multipart_content: ( Enumerator::Yielder y, val: top, diff --git a/sig/finch_api/models/create_access_token_response.rbs b/sig/finch_api/models/create_access_token_response.rbs index ee20e257..8ea51c5a 100644 --- a/sig/finch_api/models/create_access_token_response.rbs +++ b/sig/finch_api/models/create_access_token_response.rbs @@ -12,7 +12,8 @@ module FinchAPI token_type: String, account_id: String, company_id: String, - customer_id: String? + customer_id: String?, + customer_name: String? } class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel @@ -42,6 +43,8 @@ module FinchAPI attr_accessor customer_id: String? + attr_accessor customer_name: String? + def initialize: ( access_token: String, client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type, @@ -53,7 +56,8 @@ module FinchAPI token_type: String, ?account_id: String, ?company_id: String, - ?customer_id: String? + ?customer_id: String?, + ?customer_name: String? ) -> void def to_hash: -> { @@ -67,7 +71,8 @@ module FinchAPI token_type: String, account_id: String, company_id: String, - customer_id: String? + customer_id: String?, + customer_name: String? } type client_type = :development | :production | :sandbox diff --git a/sig/finch_api/models/hris/benefit_retrieve_params.rbs b/sig/finch_api/models/hris/benefit_retrieve_params.rbs index ac88c4be..2bf7c3cd 100644 --- a/sig/finch_api/models/hris/benefit_retrieve_params.rbs +++ b/sig/finch_api/models/hris/benefit_retrieve_params.rbs @@ -2,23 +2,27 @@ module FinchAPI module Models module HRIS type benefit_retrieve_params = - { entity_ids: ::Array[String] } + { benefit_id: String, entity_ids: ::Array[String] } & FinchAPI::Internal::Type::request_parameters class BenefitRetrieveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor benefit_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] def initialize: ( + benefit_id: String, ?entity_ids: ::Array[String], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + benefit_id: String, entity_ids: ::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/sig/finch_api/models/hris/benefit_update_params.rbs b/sig/finch_api/models/hris/benefit_update_params.rbs index 44536449..c0529a0e 100644 --- a/sig/finch_api/models/hris/benefit_update_params.rbs +++ b/sig/finch_api/models/hris/benefit_update_params.rbs @@ -2,13 +2,15 @@ module FinchAPI module Models module HRIS type benefit_update_params = - { entity_ids: ::Array[String], description: String } + { benefit_id: String, entity_ids: ::Array[String], description: String } & FinchAPI::Internal::Type::request_parameters class BenefitUpdateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor benefit_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] @@ -18,12 +20,14 @@ module FinchAPI def description=: (String) -> String def initialize: ( + benefit_id: String, ?entity_ids: ::Array[String], ?description: String, ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + benefit_id: String, entity_ids: ::Array[String], description: String, request_options: FinchAPI::RequestOptions diff --git a/sig/finch_api/models/hris/benefits/individual_enroll_many_params.rbs b/sig/finch_api/models/hris/benefits/individual_enroll_many_params.rbs index b6c848e6..7e6e032a 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 @@ -4,6 +4,7 @@ module FinchAPI module Benefits type individual_enroll_many_params = { + benefit_id: String, entity_ids: ::Array[String], individuals: ::Array[FinchAPI::HRIS::Benefits::IndividualEnrollManyParams::Individual] } @@ -13,6 +14,8 @@ module FinchAPI extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor benefit_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] @@ -24,12 +27,14 @@ module FinchAPI ) -> ::Array[FinchAPI::HRIS::Benefits::IndividualEnrollManyParams::Individual] def initialize: ( + benefit_id: String, ?entity_ids: ::Array[String], ?individuals: ::Array[FinchAPI::HRIS::Benefits::IndividualEnrollManyParams::Individual], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + benefit_id: String, entity_ids: ::Array[String], individuals: ::Array[FinchAPI::HRIS::Benefits::IndividualEnrollManyParams::Individual], request_options: FinchAPI::RequestOptions diff --git a/sig/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbs b/sig/finch_api/models/hris/benefits/individual_enrolled_ids_params.rbs index 72e3b890..59621bfe 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,23 +3,27 @@ module FinchAPI module HRIS module Benefits type individual_enrolled_ids_params = - { entity_ids: ::Array[String] } + { benefit_id: String, entity_ids: ::Array[String] } & FinchAPI::Internal::Type::request_parameters class IndividualEnrolledIDsParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor benefit_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] def initialize: ( + benefit_id: String, ?entity_ids: ::Array[String], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + benefit_id: String, entity_ids: ::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/sig/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs b/sig/finch_api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs index 5f3fa7b0..387335cb 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,13 +3,19 @@ module FinchAPI module HRIS module Benefits type individual_retrieve_many_benefits_params = - { entity_ids: ::Array[String], individual_ids: String } + { + benefit_id: String, + entity_ids: ::Array[String], + individual_ids: String + } & FinchAPI::Internal::Type::request_parameters class IndividualRetrieveManyBenefitsParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor benefit_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] @@ -19,12 +25,14 @@ module FinchAPI def individual_ids=: (String) -> String def initialize: ( + benefit_id: String, ?entity_ids: ::Array[String], ?individual_ids: String, ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + benefit_id: String, entity_ids: ::Array[String], individual_ids: String, request_options: FinchAPI::RequestOptions diff --git a/sig/finch_api/models/hris/benefits/individual_unenroll_many_params.rbs b/sig/finch_api/models/hris/benefits/individual_unenroll_many_params.rbs index 43a8589e..55f2e959 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,13 +3,19 @@ module FinchAPI module HRIS module Benefits type individual_unenroll_many_params = - { entity_ids: ::Array[String], individual_ids: ::Array[String] } + { + benefit_id: String, + entity_ids: ::Array[String], + individual_ids: ::Array[String] + } & FinchAPI::Internal::Type::request_parameters class IndividualUnenrollManyParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor benefit_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] @@ -19,12 +25,14 @@ module FinchAPI def individual_ids=: (::Array[String]) -> ::Array[String] def initialize: ( + benefit_id: String, ?entity_ids: ::Array[String], ?individual_ids: ::Array[String], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + benefit_id: String, entity_ids: ::Array[String], individual_ids: ::Array[String], request_options: FinchAPI::RequestOptions 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 index 72499010..384109e7 100644 --- 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 @@ -4,23 +4,27 @@ module FinchAPI module Company module PayStatementItem type rule_delete_params = - { entity_ids: ::Array[String] } + { rule_id: String, entity_ids: ::Array[String] } & FinchAPI::Internal::Type::request_parameters class RuleDeleteParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor rule_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] def initialize: ( + rule_id: String, ?entity_ids: ::Array[String], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + rule_id: String, entity_ids: ::Array[String], request_options: FinchAPI::RequestOptions } 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 index 67658acf..a2532ccd 100644 --- 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 @@ -4,13 +4,19 @@ module FinchAPI module Company module PayStatementItem type rule_update_params = - { entity_ids: ::Array[String], optional_property: top } + { + rule_id: String, + entity_ids: ::Array[String], + 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_accessor rule_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] @@ -20,12 +26,14 @@ module FinchAPI def optional_property=: (top) -> top def initialize: ( + rule_id: String, ?entity_ids: ::Array[String], ?optional_property: top, ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + rule_id: String, entity_ids: ::Array[String], optional_property: top, request_options: FinchAPI::RequestOptions diff --git a/sig/finch_api/models/hris/document_retreive_params.rbs b/sig/finch_api/models/hris/document_retreive_params.rbs index e757fc2e..d97b7380 100644 --- a/sig/finch_api/models/hris/document_retreive_params.rbs +++ b/sig/finch_api/models/hris/document_retreive_params.rbs @@ -2,23 +2,27 @@ module FinchAPI module Models module HRIS type document_retreive_params = - { entity_ids: ::Array[String] } + { document_id: String, entity_ids: ::Array[String] } & FinchAPI::Internal::Type::request_parameters class DocumentRetreiveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor document_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] def initialize: ( + document_id: String, ?entity_ids: ::Array[String], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + document_id: String, entity_ids: ::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/sig/finch_api/models/hris/employment_data.rbs b/sig/finch_api/models/hris/employment_data.rbs index 515184e8..5705b8a1 100644 --- a/sig/finch_api/models/hris/employment_data.rbs +++ b/sig/finch_api/models/hris/employment_data.rbs @@ -17,6 +17,7 @@ module FinchAPI employment_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::flsa_status?, is_active: bool?, last_name: String?, latest_rehire_date: String?, @@ -47,6 +48,8 @@ module FinchAPI attr_accessor first_name: String? + attr_accessor flsa_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::flsa_status? + attr_accessor is_active: bool? attr_accessor last_name: String? @@ -81,6 +84,7 @@ module FinchAPI employment_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::flsa_status?, is_active: bool?, last_name: String?, latest_rehire_date: String?, @@ -104,6 +108,7 @@ module FinchAPI employment_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::HRIS::EmploymentData::UnionMember0::flsa_status?, is_active: bool?, last_name: String?, latest_rehire_date: String?, @@ -206,6 +211,18 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::UnionMember0::employment_status] end + type flsa_status = :exempt | :non_exempt | :unknown + + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT: :exempt + NON_EXEMPT: :non_exempt + UNKNOWN: :unknown + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::UnionMember0::flsa_status] + end + type manager = { id: String } class Manager < FinchAPI::Internal::Type::BaseModel diff --git a/sig/finch_api/models/introspection.rbs b/sig/finch_api/models/introspection.rbs index 67b250ee..0bc6aeca 100644 --- a/sig/finch_api/models/introspection.rbs +++ b/sig/finch_api/models/introspection.rbs @@ -262,7 +262,13 @@ module FinchAPI end end - type entity = { id: String, name: String?, source_id: String? } + type entity = + { + id: String, + name: String?, + source_id: String?, + status: FinchAPI::Models::Introspection::Entity::status + } class Entity < FinchAPI::Internal::Type::BaseModel attr_accessor id: String @@ -271,9 +277,44 @@ module FinchAPI attr_accessor source_id: String? - def initialize: (id: String, name: String?, source_id: String?) -> void + attr_accessor status: FinchAPI::Models::Introspection::Entity::status - def to_hash: -> { id: String, name: String?, source_id: String? } + def initialize: ( + id: String, + name: String?, + source_id: String?, + status: FinchAPI::Models::Introspection::Entity::status + ) -> void + + def to_hash: -> { + id: String, + name: String?, + source_id: String?, + status: FinchAPI::Models::Introspection::Entity::status + } + + type status = + :pending + | :processing + | :connected + | :error_no_account_setup + | :error_permissions + | :reauth + | :disconnected + + module Status + extend FinchAPI::Internal::Type::Enum + + PENDING: :pending + PROCESSING: :processing + CONNECTED: :connected + ERROR_NO_ACCOUNT_SETUP: :error_no_account_setup + ERROR_PERMISSIONS: :error_permissions + REAUTH: :reauth + DISCONNECTED: :disconnected + + def self?.values: -> ::Array[FinchAPI::Models::Introspection::Entity::status] + end end end end diff --git a/sig/finch_api/models/jobs/automated_create_params.rbs b/sig/finch_api/models/jobs/automated_create_params.rbs index 5cfcf052..12e8a49b 100644 --- a/sig/finch_api/models/jobs/automated_create_params.rbs +++ b/sig/finch_api/models/jobs/automated_create_params.rbs @@ -2,50 +2,75 @@ module FinchAPI module Models module Jobs type automated_create_params = - { - type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, - params: FinchAPI::Jobs::AutomatedCreateParams::Params - } + { body: FinchAPI::Models::Jobs::AutomatedCreateParams::body } & FinchAPI::Internal::Type::request_parameters 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_ - - attr_accessor params: FinchAPI::Jobs::AutomatedCreateParams::Params + attr_accessor body: FinchAPI::Models::Jobs::AutomatedCreateParams::body def initialize: ( - type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, - params: FinchAPI::Jobs::AutomatedCreateParams::Params, + body: FinchAPI::Models::Jobs::AutomatedCreateParams::body, ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { - type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, - params: FinchAPI::Jobs::AutomatedCreateParams::Params, + body: FinchAPI::Models::Jobs::AutomatedCreateParams::body, request_options: FinchAPI::RequestOptions } - type type_ = :w4_form_employee_sync + type body = + FinchAPI::Jobs::AutomatedCreateParams::Body::DataSyncAll + | FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync - module Type - extend FinchAPI::Internal::Type::Enum + module Body + extend FinchAPI::Internal::Type::Union - W4_FORM_EMPLOYEE_SYNC: :w4_form_employee_sync + type data_sync_all = { type: :data_sync_all } - def self?.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedCreateParams::type_] - end + class DataSyncAll < FinchAPI::Internal::Type::BaseModel + attr_accessor type: :data_sync_all + + def initialize: (?type: :data_sync_all) -> void + + def to_hash: -> { type: :data_sync_all } + end + + type w4_form_employee_sync = + { + params: FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params, + type: :w4_form_employee_sync + } + + class W4FormEmployeeSync < FinchAPI::Internal::Type::BaseModel + attr_accessor params: FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params + + attr_accessor type: :w4_form_employee_sync + + def initialize: ( + params: FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params, + ?type: :w4_form_employee_sync + ) -> void + + def to_hash: -> { + params: FinchAPI::Jobs::AutomatedCreateParams::Body::W4FormEmployeeSync::Params, + type: :w4_form_employee_sync + } + + type params = { individual_id: String } - type params = { individual_id: String } + class Params < FinchAPI::Internal::Type::BaseModel + attr_accessor individual_id: String - class Params < FinchAPI::Internal::Type::BaseModel - attr_accessor individual_id: String + def initialize: (individual_id: String) -> void - def initialize: (individual_id: String) -> void + def to_hash: -> { individual_id: String } + end + end - def to_hash: -> { individual_id: String } + def self?.variants: -> ::Array[FinchAPI::Models::Jobs::AutomatedCreateParams::body] end end end diff --git a/sig/finch_api/models/jobs/automated_retrieve_params.rbs b/sig/finch_api/models/jobs/automated_retrieve_params.rbs index f7c8cfa0..a83dfbb9 100644 --- a/sig/finch_api/models/jobs/automated_retrieve_params.rbs +++ b/sig/finch_api/models/jobs/automated_retrieve_params.rbs @@ -2,15 +2,23 @@ module FinchAPI module Models module Jobs type automated_retrieve_params = - { } & FinchAPI::Internal::Type::request_parameters + { job_id: String } & 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 + attr_accessor job_id: String - def to_hash: -> { request_options: FinchAPI::RequestOptions } + def initialize: ( + job_id: String, + ?request_options: FinchAPI::request_opts + ) -> void + + def to_hash: -> { + job_id: String, + request_options: FinchAPI::RequestOptions + } end end end diff --git a/sig/finch_api/models/jobs/manual_retrieve_params.rbs b/sig/finch_api/models/jobs/manual_retrieve_params.rbs index 0a765cf5..86ccd61e 100644 --- a/sig/finch_api/models/jobs/manual_retrieve_params.rbs +++ b/sig/finch_api/models/jobs/manual_retrieve_params.rbs @@ -2,15 +2,23 @@ module FinchAPI module Models module Jobs type manual_retrieve_params = - { } & FinchAPI::Internal::Type::request_parameters + { job_id: String } & 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 + attr_accessor job_id: String - def to_hash: -> { request_options: FinchAPI::RequestOptions } + def initialize: ( + job_id: String, + ?request_options: FinchAPI::request_opts + ) -> void + + def to_hash: -> { + job_id: String, + request_options: FinchAPI::RequestOptions + } end end end diff --git a/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs b/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs index 771d2b07..34c5908f 100644 --- a/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs +++ b/sig/finch_api/models/payroll/pay_group_retrieve_params.rbs @@ -2,23 +2,27 @@ module FinchAPI module Models module Payroll type pay_group_retrieve_params = - { entity_ids: ::Array[String] } + { pay_group_id: String, entity_ids: ::Array[String] } & FinchAPI::Internal::Type::request_parameters class PayGroupRetrieveParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor pay_group_id: String + attr_reader entity_ids: ::Array[String]? def entity_ids=: (::Array[String]) -> ::Array[String] def initialize: ( + pay_group_id: String, ?entity_ids: ::Array[String], ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + pay_group_id: String, entity_ids: ::Array[String], request_options: FinchAPI::RequestOptions } diff --git a/sig/finch_api/models/sandbox/directory_create_params.rbs b/sig/finch_api/models/sandbox/directory_create_params.rbs index a5222df7..bdbac88e 100644 --- a/sig/finch_api/models/sandbox/directory_create_params.rbs +++ b/sig/finch_api/models/sandbox/directory_create_params.rbs @@ -38,6 +38,7 @@ module FinchAPI end_date: String?, ethnicity: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity?, first_name: String?, + flsa_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::flsa_status?, gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender?, income: FinchAPI::Income?, income_history: ::Array[FinchAPI::Income?]?, @@ -79,6 +80,8 @@ module FinchAPI attr_accessor first_name: String? + attr_accessor flsa_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::flsa_status? + attr_accessor gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender? attr_accessor income: FinchAPI::Income? @@ -123,6 +126,7 @@ module FinchAPI ?end_date: String?, ?ethnicity: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity?, ?first_name: String?, + ?flsa_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::flsa_status?, ?gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender?, ?income: FinchAPI::Income?, ?income_history: ::Array[FinchAPI::Income?]?, @@ -153,6 +157,7 @@ module FinchAPI end_date: String?, ethnicity: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity?, first_name: String?, + flsa_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::flsa_status?, gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender?, income: FinchAPI::Income?, income_history: ::Array[FinchAPI::Income?]?, @@ -332,6 +337,18 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity] end + type flsa_status = :exempt | :non_exempt | :unknown + + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT: :exempt + NON_EXEMPT: :non_exempt + UNKNOWN: :unknown + + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::flsa_status] + end + type gender = :female | :male | :other | :decline_to_specify module Gender diff --git a/sig/finch_api/models/sandbox/employment_update_params.rbs b/sig/finch_api/models/sandbox/employment_update_params.rbs index aee83ffe..8e710b1d 100644 --- a/sig/finch_api/models/sandbox/employment_update_params.rbs +++ b/sig/finch_api/models/sandbox/employment_update_params.rbs @@ -3,6 +3,7 @@ module FinchAPI module Sandbox type employment_update_params = { + individual_id: String, class_code: String?, custom_fields: ::Array[FinchAPI::Sandbox::EmploymentUpdateParams::CustomField]?, department: FinchAPI::Sandbox::EmploymentUpdateParams::Department?, @@ -10,6 +11,7 @@ module FinchAPI employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::flsa_status?, income: FinchAPI::Income?, income_history: ::Array[FinchAPI::Income?]?, is_active: bool?, @@ -28,6 +30,8 @@ module FinchAPI extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor individual_id: String + attr_accessor class_code: String? attr_accessor custom_fields: ::Array[FinchAPI::Sandbox::EmploymentUpdateParams::CustomField]? @@ -42,6 +46,8 @@ module FinchAPI attr_accessor first_name: String? + attr_accessor flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::flsa_status? + attr_accessor income: FinchAPI::Income? attr_accessor income_history: ::Array[FinchAPI::Income?]? @@ -65,6 +71,7 @@ module FinchAPI attr_accessor title: String? def initialize: ( + individual_id: String, ?class_code: String?, ?custom_fields: ::Array[FinchAPI::Sandbox::EmploymentUpdateParams::CustomField]?, ?department: FinchAPI::Sandbox::EmploymentUpdateParams::Department?, @@ -72,6 +79,7 @@ module FinchAPI ?employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, ?end_date: String?, ?first_name: String?, + ?flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::flsa_status?, ?income: FinchAPI::Income?, ?income_history: ::Array[FinchAPI::Income?]?, ?is_active: bool?, @@ -87,6 +95,7 @@ module FinchAPI ) -> void def to_hash: -> { + individual_id: String, class_code: String?, custom_fields: ::Array[FinchAPI::Sandbox::EmploymentUpdateParams::CustomField]?, department: FinchAPI::Sandbox::EmploymentUpdateParams::Department?, @@ -94,6 +103,7 @@ module FinchAPI employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::flsa_status?, income: FinchAPI::Income?, income_history: ::Array[FinchAPI::Income?]?, is_active: bool?, @@ -209,6 +219,18 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status] end + type flsa_status = :exempt | :non_exempt | :unknown + + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT: :exempt + NON_EXEMPT: :non_exempt + UNKNOWN: :unknown + + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::flsa_status] + end + type manager = { id: String } class Manager < FinchAPI::Internal::Type::BaseModel diff --git a/sig/finch_api/models/sandbox/employment_update_response.rbs b/sig/finch_api/models/sandbox/employment_update_response.rbs index 77658df7..c3a0b4b1 100644 --- a/sig/finch_api/models/sandbox/employment_update_response.rbs +++ b/sig/finch_api/models/sandbox/employment_update_response.rbs @@ -11,6 +11,7 @@ module FinchAPI employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::flsa_status?, income: FinchAPI::Income?, income_history: ::Array[FinchAPI::Income?]?, is_active: bool?, @@ -43,6 +44,8 @@ module FinchAPI attr_accessor first_name: String? + attr_accessor flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::flsa_status? + attr_accessor income: FinchAPI::Income? attr_accessor income_history: ::Array[FinchAPI::Income?]? @@ -74,6 +77,7 @@ module FinchAPI ?employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status?, ?end_date: String?, ?first_name: String?, + ?flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::flsa_status?, ?income: FinchAPI::Income?, ?income_history: ::Array[FinchAPI::Income?]?, ?is_active: bool?, @@ -96,6 +100,7 @@ module FinchAPI employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status?, end_date: String?, first_name: String?, + flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::flsa_status?, income: FinchAPI::Income?, income_history: ::Array[FinchAPI::Income?]?, is_active: bool?, @@ -210,6 +215,18 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status] end + type flsa_status = :exempt | :non_exempt | :unknown + + module FlsaStatus + extend FinchAPI::Internal::Type::Enum + + EXEMPT: :exempt + NON_EXEMPT: :non_exempt + UNKNOWN: :unknown + + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::flsa_status] + end + type manager = { id: String } class Manager < FinchAPI::Internal::Type::BaseModel diff --git a/sig/finch_api/models/sandbox/individual_update_params.rbs b/sig/finch_api/models/sandbox/individual_update_params.rbs index 042c0661..fdb93cd9 100644 --- a/sig/finch_api/models/sandbox/individual_update_params.rbs +++ b/sig/finch_api/models/sandbox/individual_update_params.rbs @@ -3,6 +3,7 @@ module FinchAPI module Sandbox type individual_update_params = { + individual_id: String, dob: String?, emails: ::Array[FinchAPI::Sandbox::IndividualUpdateParams::Email]?, encrypted_ssn: String?, @@ -22,6 +23,8 @@ module FinchAPI extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + attr_accessor individual_id: String + attr_accessor dob: String? attr_accessor emails: ::Array[FinchAPI::Sandbox::IndividualUpdateParams::Email]? @@ -47,6 +50,7 @@ module FinchAPI attr_accessor ssn: String? def initialize: ( + individual_id: String, ?dob: String?, ?emails: ::Array[FinchAPI::Sandbox::IndividualUpdateParams::Email]?, ?encrypted_ssn: String?, @@ -63,6 +67,7 @@ module FinchAPI ) -> void def to_hash: -> { + individual_id: String, dob: String?, emails: ::Array[FinchAPI::Sandbox::IndividualUpdateParams::Email]?, encrypted_ssn: String?, diff --git a/sig/finch_api/resources/jobs/automated.rbs b/sig/finch_api/resources/jobs/automated.rbs index f23f755c..32ee669d 100644 --- a/sig/finch_api/resources/jobs/automated.rbs +++ b/sig/finch_api/resources/jobs/automated.rbs @@ -3,8 +3,7 @@ module FinchAPI class Jobs class Automated def create: ( - type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, - params: FinchAPI::Jobs::AutomatedCreateParams::Params, + body: FinchAPI::Models::Jobs::AutomatedCreateParams::body, ?request_options: FinchAPI::request_opts ) -> FinchAPI::Models::Jobs::AutomatedCreateResponse diff --git a/sig/finch_api/resources/sandbox/employment.rbs b/sig/finch_api/resources/sandbox/employment.rbs index d0db36dd..2ce56e7f 100644 --- a/sig/finch_api/resources/sandbox/employment.rbs +++ b/sig/finch_api/resources/sandbox/employment.rbs @@ -11,6 +11,7 @@ module FinchAPI ?employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, ?end_date: String?, ?first_name: String?, + ?flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::flsa_status?, ?income: FinchAPI::Income?, ?income_history: ::Array[FinchAPI::Income?]?, ?is_active: bool?, diff --git a/test/finch_api/client_test.rb b/test/finch_api/client_test.rb index 5208163f..89eb7623 100644 --- a/test/finch_api/client_test.rb +++ b/test/finch_api/client_test.rb @@ -30,7 +30,13 @@ def after_all def test_client_default_request_default_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -43,7 +49,13 @@ def test_client_given_request_default_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 3) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 3 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -55,7 +67,13 @@ def test_client_given_request_default_retry_attempts def test_client_default_request_given_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {max_retries: 3}) @@ -68,7 +86,13 @@ def test_client_given_request_given_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 3) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 3 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {max_retries: 4}) @@ -85,7 +109,13 @@ def test_client_retry_after_seconds ) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 1) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 1 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -96,20 +126,28 @@ def test_client_retry_after_seconds end def test_client_retry_after_date + time_now = Time.now + stub_request(:get, "http://localhost/employer/directory").to_return_json( status: 500, - headers: {"retry-after" => (Time.now + 10).httpdate}, + headers: {"retry-after" => (time_now + 10).httpdate}, body: {} ) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 1) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 1 + ) + Thread.current.thread_variable_set(:time_now, time_now) 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) end + Thread.current.thread_variable_set(:time_now, nil) assert_requested(:any, /./, times: 2) assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) @@ -123,7 +161,13 @@ def test_client_retry_after_ms ) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 1) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 1 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -136,7 +180,13 @@ def test_client_retry_after_ms def test_retry_count_header stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -150,7 +200,13 @@ def test_retry_count_header def test_omit_retry_count_header stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) @@ -164,7 +220,13 @@ def test_omit_retry_count_header def test_overwrite_retry_count_header stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => "42"}}) @@ -184,7 +246,13 @@ def test_client_redirect_307 headers: {"location" => "/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {}}) @@ -213,7 +281,13 @@ def test_client_redirect_303 headers: {"location" => "/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {}}) @@ -237,7 +311,13 @@ def test_client_redirect_auth_keep_same_origin headers: {"location" => "/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) @@ -264,7 +344,13 @@ def test_client_redirect_auth_strip_cross_origin headers: {"location" => "https://example.com/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) @@ -279,7 +365,13 @@ def test_client_redirect_auth_strip_cross_origin def test_default_headers stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 200, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) finch.hris.directory.list diff --git a/test/finch_api/internal/util_test.rb b/test/finch_api/internal/util_test.rb index f3cd1297..c49c904d 100644 --- a/test/finch_api/internal/util_test.rb +++ b/test/finch_api/internal/util_test.rb @@ -171,6 +171,8 @@ def test_json_content cases = { "application/json" => true, "application/jsonl" => false, + "application/arbitrary+json" => true, + "application/ARBITRARY+json" => true, "application/vnd.github.v3+json" => true, "application/vnd.api+json" => true } diff --git a/test/finch_api/resources/access_tokens_test.rb b/test/finch_api/resources/access_tokens_test.rb index ecc07d83..37cf96ff 100644 --- a/test/finch_api/resources/access_tokens_test.rb +++ b/test/finch_api/resources/access_tokens_test.rb @@ -4,6 +4,8 @@ class FinchAPI::Test::Resources::AccessTokensTest < FinchAPI::Test::ResourceTest def test_create_required_params + skip("prism doesnt like the format for the API-Version header") + response = @finch.access_tokens.create(code: "code") assert_pattern do @@ -22,7 +24,8 @@ def test_create_required_params token_type: String, account_id: String | nil, company_id: String | nil, - customer_id: String | nil + customer_id: String | nil, + customer_name: String | nil } end end diff --git a/test/finch_api/resources/hris/directory_test.rb b/test/finch_api/resources/hris/directory_test.rb index 07b3310d..95bbda88 100644 --- a/test/finch_api/resources/hris/directory_test.rb +++ b/test/finch_api/resources/hris/directory_test.rb @@ -34,25 +34,13 @@ def test_list_individuals response = @finch.hris.directory.list_individuals assert_pattern do - response => FinchAPI::Internal::IndividualsPage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => FinchAPI::HRIS::IndividualInDirectory + response => FinchAPI::UnnamedTypeWithNoPropertyInfoOrParent0 end assert_pattern do - row => { - id: String, - department: FinchAPI::HRIS::IndividualInDirectory::Department | nil, - first_name: String | nil, - is_active: FinchAPI::Internal::Type::Boolean | nil, - last_name: String | nil, - manager: FinchAPI::HRIS::IndividualInDirectory::Manager | nil, - middle_name: String | nil + response => { + individuals: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::HRIS::IndividualInDirectory]), + paging: FinchAPI::Paging } end end diff --git a/test/finch_api/resources/jobs/automated_test.rb b/test/finch_api/resources/jobs/automated_test.rb index 9398dd98..0b15031c 100644 --- a/test/finch_api/resources/jobs/automated_test.rb +++ b/test/finch_api/resources/jobs/automated_test.rb @@ -4,8 +4,7 @@ class FinchAPI::Test::Resources::Jobs::AutomatedTest < FinchAPI::Test::ResourceTest def test_create_required_params - response = - @finch.jobs.automated.create(params: {individual_id: "individual_id"}, type: :w4_form_employee_sync) + response = @finch.jobs.automated.create(body: {type: :data_sync_all}) assert_pattern do response => FinchAPI::Models::Jobs::AutomatedCreateResponse diff --git a/test/finch_api/resources/sandbox/employment_test.rb b/test/finch_api/resources/sandbox/employment_test.rb index 6ce72f34..31177729 100644 --- a/test/finch_api/resources/sandbox/employment_test.rb +++ b/test/finch_api/resources/sandbox/employment_test.rb @@ -20,6 +20,7 @@ def test_update employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus | nil, end_date: String | nil, first_name: String | nil, + flsa_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::FlsaStatus | nil, income: FinchAPI::Income | nil, income_history: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::Income, nil?: true]) | nil, is_active: FinchAPI::Internal::Type::Boolean | nil, diff --git a/test/finch_api/test_helper.rb b/test/finch_api/test_helper.rb index 2f623e3b..825bb0cf 100644 --- a/test/finch_api/test_helper.rb +++ b/test/finch_api/test_helper.rb @@ -48,7 +48,12 @@ class FinchAPI::Test::SingletonClient < FinchAPI::Client TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") def initialize - super(base_url: FinchAPI::Test::SingletonClient::TEST_API_BASE_URL, access_token: "My Access Token") + super( + base_url: FinchAPI::Test::SingletonClient::TEST_API_BASE_URL, + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) end end