diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1c0bb885..380b6f91 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.23" + ".": "0.1.0-alpha.24" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index f1c7d32b..3fe8a845 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-f7e741bc6e0175fd96a9db5348092b90a77b0985154c0814bb681ad5dccdf19a.yml -openapi_spec_hash: b348a9ef407a8e91dd770fcb219d4ac5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-73c284d36c1ed2d9963fc733e421005fad76e559de8efe9baa6511a43dd72668.yml +openapi_spec_hash: 1e58c4445919b71c77e5c7f16bd6fa7d config_hash: 5146b12344dae76238940989dac1e8a0 diff --git a/CHANGELOG.md b/CHANGELOG.md index ff1ccde4..5c0201f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.1.0-alpha.24 (2025-07-23) + +Full Changelog: [v0.1.0-alpha.23...v0.1.0-alpha.24](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.23...v0.1.0-alpha.24) + +### Features + +* **api:** api update ([c07a9d2](https://github.com/Finch-API/finch-api-ruby/commit/c07a9d2fb3488ebec525699f3b81ba70ffc903a2)) +* **api:** api update ([bd3b67a](https://github.com/Finch-API/finch-api-ruby/commit/bd3b67adfa1d4f9d507dcf6d604b0476955e38d7)) + + +### Chores + +* **internal:** version bump ([5d0dfc8](https://github.com/Finch-API/finch-api-ruby/commit/5d0dfc87e18fe72623ce1ff8154b8614e228611e)) + ## 0.1.0-alpha.23 (2025-07-02) Full Changelog: [v0.1.0-alpha.22...v0.1.0-alpha.23](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.22...v0.1.0-alpha.23) diff --git a/Gemfile.lock b/Gemfile.lock index d805320f..2a7f21ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - finch-api (0.1.0.pre.alpha.22) + finch-api (0.1.0.pre.alpha.23) connection_pool GEM diff --git a/README.md b/README.md index b0d0ba72..4cac9399 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "finch-api", "~> 0.1.0.pre.alpha.23" +gem "finch-api", "~> 0.1.0.pre.alpha.24" ``` @@ -222,11 +222,11 @@ finch.hris.directory.list(**params) Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: ```ruby -# :one_time -puts(FinchAPI::HRIS::BenefitFrequency::ONE_TIME) +# :every_paycheck +puts(FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK) # Revealed type: `T.all(FinchAPI::HRIS::BenefitFrequency, Symbol)` -T.reveal_type(FinchAPI::HRIS::BenefitFrequency::ONE_TIME) +T.reveal_type(FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK) ``` Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: @@ -234,13 +234,13 @@ Enum parameters have a "relaxed" type, so you can either pass in enum constants ```ruby # Using the enum constants preserves the tagged type information: finch.hris.benefits.create( - frequency: FinchAPI::HRIS::BenefitFrequency::ONE_TIME, + frequency: FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK, # … ) # Literal values are also permissible: finch.hris.benefits.create( - frequency: :one_time, + frequency: :every_paycheck, # … ) ``` diff --git a/lib/finch_api/models/hris/benefit_contribution.rb b/lib/finch_api/models/hris/benefit_contribution.rb index fafb1cd7..0b35eb4d 100644 --- a/lib/finch_api/models/hris/benefit_contribution.rb +++ b/lib/finch_api/models/hris/benefit_contribution.rb @@ -8,15 +8,15 @@ class BenefitContribution < FinchAPI::Internal::Type::BaseModel # Contribution amount in cents (if `fixed`) or basis points (if `percent`). # # @return [Integer, nil] - optional :amount, Integer, nil?: true + required :amount, Integer, nil?: true # @!attribute type # Contribution type. # # @return [Symbol, FinchAPI::Models::HRIS::BenefitContribution::Type, nil] - optional :type, enum: -> { FinchAPI::HRIS::BenefitContribution::Type }, nil?: true + required :type, enum: -> { FinchAPI::HRIS::BenefitContribution::Type }, nil?: true - # @!method initialize(amount: nil, type: nil) + # @!method initialize(amount:, type:) # @param amount [Integer, nil] Contribution amount in cents (if `fixed`) or basis points (if `percent`). # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitContribution::Type, nil] Contribution type. diff --git a/lib/finch_api/models/hris/benefit_create_params.rb b/lib/finch_api/models/hris/benefit_create_params.rb index 1cf2f6fe..b8166356 100644 --- a/lib/finch_api/models/hris/benefit_create_params.rb +++ b/lib/finch_api/models/hris/benefit_create_params.rb @@ -53,18 +53,18 @@ class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel class CompanyContribution < FinchAPI::Internal::Type::BaseModel # @!attribute tiers # - # @return [Array, nil] - optional :tiers, + # @return [Array] + required :tiers, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier] } # @!attribute type # - # @return [Symbol, FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type, nil] - optional :type, enum: -> { FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Type } + # @return [Symbol, FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type] + required :type, enum: -> { FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Type } - # @!method initialize(tiers: nil, type: nil) + # @!method initialize(tiers:, type:) # The company match for this benefit. # # @param tiers [Array] @@ -73,15 +73,15 @@ class CompanyContribution < FinchAPI::Internal::Type::BaseModel class Tier < FinchAPI::Internal::Type::BaseModel # @!attribute match # - # @return [Integer, nil] - optional :match, Integer + # @return [Integer] + required :match, Integer # @!attribute threshold # - # @return [Integer, nil] - optional :threshold, Integer + # @return [Integer] + required :threshold, Integer - # @!method initialize(match: nil, threshold: nil) + # @!method initialize(match:, threshold:) # @param match [Integer] # @param threshold [Integer] end diff --git a/lib/finch_api/models/hris/benefit_frequency.rb b/lib/finch_api/models/hris/benefit_frequency.rb index b81f385d..df6bc35e 100644 --- a/lib/finch_api/models/hris/benefit_frequency.rb +++ b/lib/finch_api/models/hris/benefit_frequency.rb @@ -7,9 +7,9 @@ module HRIS module BenefitFrequency extend FinchAPI::Internal::Type::Enum - ONE_TIME = :one_time EVERY_PAYCHECK = :every_paycheck MONTHLY = :monthly + ONE_TIME = :one_time # @!method self.values # @return [Array] diff --git a/lib/finch_api/models/hris/benefits/individual_benefit.rb b/lib/finch_api/models/hris/benefits/individual_benefit.rb index 4e090134..59b06c6a 100644 --- a/lib/finch_api/models/hris/benefits/individual_benefit.rb +++ b/lib/finch_api/models/hris/benefits/individual_benefit.rb @@ -8,83 +8,125 @@ module Benefits class IndividualBenefit < FinchAPI::Internal::Type::BaseModel # @!attribute body # - # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, nil] - optional :body, -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body } + # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::BatchError] + required :body, union: -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body } # @!attribute code # - # @return [Integer, nil] - optional :code, Integer + # @return [Integer] + required :code, Integer # @!attribute individual_id # - # @return [String, nil] - optional :individual_id, String + # @return [String] + required :individual_id, String - # @!method initialize(body: nil, code: nil, individual_id: nil) - # @param body [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body] + # @!method initialize(body:, code:, individual_id:) + # @param body [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::BatchError] # @param code [Integer] # @param individual_id [String] # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit#body - class Body < FinchAPI::Internal::Type::BaseModel - # @!attribute annual_maximum - # If the benefit supports annual maximum, the amount in cents for this individual. - # - # @return [Integer, nil] - optional :annual_maximum, Integer, nil?: true - - # @!attribute catch_up - # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled - # for this individual. - # - # @return [Boolean, nil] - optional :catch_up, FinchAPI::Internal::Type::Boolean, nil?: true - - # @!attribute company_contribution - # - # @return [FinchAPI::Models::HRIS::BenefitContribution, nil] - optional :company_contribution, -> { FinchAPI::HRIS::BenefitContribution }, nil?: true - - # @!attribute employee_deduction - # - # @return [FinchAPI::Models::HRIS::BenefitContribution, nil] - optional :employee_deduction, -> { FinchAPI::HRIS::BenefitContribution }, nil?: true - - # @!attribute hsa_contribution_limit - # Type for HSA contribution limit if the benefit is a HSA. - # - # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit, nil] - optional :hsa_contribution_limit, - enum: -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit }, - nil?: true - - # @!method initialize(annual_maximum: nil, catch_up: nil, company_contribution: nil, employee_deduction: nil, hsa_contribution_limit: nil) - # Some parameter documentations has been truncated, see - # {FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body} for more details. - # - # @param annual_maximum [Integer, nil] If the benefit supports annual maximum, the amount in cents for this individual. - # - # @param catch_up [Boolean, nil] If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled - # - # @param company_contribution [FinchAPI::Models::HRIS::BenefitContribution, nil] - # - # @param employee_deduction [FinchAPI::Models::HRIS::BenefitContribution, nil] - # - # @param hsa_contribution_limit [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit, nil] Type for HSA contribution limit if the benefit is a HSA. - - # Type for HSA contribution limit if the benefit is a HSA. - # - # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body#hsa_contribution_limit - module HsaContributionLimit - extend FinchAPI::Internal::Type::Enum - - INDIVIDUAL = :individual - FAMILY = :family - - # @!method self.values - # @return [Array] + module Body + extend FinchAPI::Internal::Type::Union + + variant -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0 } + + variant -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::BatchError } + + class UnionMember0 < FinchAPI::Internal::Type::BaseModel + # @!attribute annual_maximum + # If the benefit supports annual maximum, the amount in cents for this individual. + # + # @return [Integer, nil] + required :annual_maximum, Integer, nil?: true + + # @!attribute catch_up + # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled + # for this individual. + # + # @return [Boolean, nil] + required :catch_up, FinchAPI::Internal::Type::Boolean, nil?: true + + # @!attribute company_contribution + # + # @return [FinchAPI::Models::HRIS::BenefitContribution, nil] + required :company_contribution, -> { FinchAPI::HRIS::BenefitContribution }, nil?: true + + # @!attribute employee_deduction + # + # @return [FinchAPI::Models::HRIS::BenefitContribution, nil] + required :employee_deduction, -> { FinchAPI::HRIS::BenefitContribution }, nil?: true + + # @!attribute hsa_contribution_limit + # Type for HSA contribution limit if the benefit is a HSA. + # + # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit, nil] + optional :hsa_contribution_limit, + enum: -> { + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit + }, + nil?: true + + # @!method initialize(annual_maximum:, catch_up:, company_contribution:, employee_deduction:, hsa_contribution_limit: nil) + # Some parameter documentations has been truncated, see + # {FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0} for + # more details. + # + # @param annual_maximum [Integer, nil] If the benefit supports annual maximum, the amount in cents for this individual. + # + # @param catch_up [Boolean, nil] If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled + # + # @param company_contribution [FinchAPI::Models::HRIS::BenefitContribution, nil] + # + # @param employee_deduction [FinchAPI::Models::HRIS::BenefitContribution, nil] + # + # @param hsa_contribution_limit [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit, nil] Type for HSA contribution limit if the benefit is a HSA. + + # Type for HSA contribution limit if the benefit is a HSA. + # + # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0#hsa_contribution_limit + module HsaContributionLimit + extend FinchAPI::Internal::Type::Enum + + INDIVIDUAL = :individual + FAMILY = :family + + # @!method self.values + # @return [Array] + end end + + class BatchError < FinchAPI::Internal::Type::BaseModel + # @!attribute code + # + # @return [Float] + required :code, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute finch_code + # + # @return [String, nil] + optional :finch_code, String + + # @!method initialize(code:, message:, name:, finch_code: nil) + # @param code [Float] + # @param message [String] + # @param name [String] + # @param finch_code [String] + end + + # @!method self.variants + # @return [Array(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::BatchError)] end end end diff --git a/lib/finch_api/models/hris/company_benefit.rb b/lib/finch_api/models/hris/company_benefit.rb index e5062154..767a47e5 100644 --- a/lib/finch_api/models/hris/company_benefit.rb +++ b/lib/finch_api/models/hris/company_benefit.rb @@ -11,12 +11,6 @@ class CompanyBenefit < FinchAPI::Internal::Type::BaseModel # @return [String] required :benefit_id, String - # @!attribute company_contribution - # The company match for this benefit. - # - # @return [FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution, nil] - required :company_contribution, -> { FinchAPI::HRIS::CompanyBenefit::CompanyContribution }, nil?: true - # @!attribute description # # @return [String, nil] @@ -34,33 +28,39 @@ class CompanyBenefit < FinchAPI::Internal::Type::BaseModel # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] required :type, enum: -> { FinchAPI::HRIS::BenefitType }, nil?: true - # @!method initialize(benefit_id:, company_contribution:, description:, frequency:, type:) - # @param benefit_id [String] The id of the benefit. + # @!attribute company_contribution + # The company match for this benefit. # - # @param company_contribution [FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution, nil] The company match for this benefit. + # @return [FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution, nil] + optional :company_contribution, -> { FinchAPI::HRIS::CompanyBenefit::CompanyContribution }, nil?: true + + # @!method initialize(benefit_id:, description:, frequency:, type:, company_contribution: nil) + # @param benefit_id [String] The id of the benefit. # # @param description [String, nil] # # @param frequency [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] The frequency of the benefit deduction/contribution. # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] Type of benefit. + # + # @param company_contribution [FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution, nil] The company match for this benefit. # @see FinchAPI::Models::HRIS::CompanyBenefit#company_contribution class CompanyContribution < FinchAPI::Internal::Type::BaseModel # @!attribute tiers # - # @return [Array, nil] - optional :tiers, + # @return [Array] + required :tiers, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier] } # @!attribute type # - # @return [Symbol, FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::Type, nil] - optional :type, enum: -> { FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Type } + # @return [Symbol, FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::Type] + required :type, enum: -> { FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Type } - # @!method initialize(tiers: nil, type: nil) + # @!method initialize(tiers:, type:) # The company match for this benefit. # # @param tiers [Array] @@ -69,15 +69,15 @@ class CompanyContribution < FinchAPI::Internal::Type::BaseModel class Tier < FinchAPI::Internal::Type::BaseModel # @!attribute match # - # @return [Integer, nil] - optional :match, Integer + # @return [Integer] + required :match, Integer # @!attribute threshold # - # @return [Integer, nil] - optional :threshold, Integer + # @return [Integer] + required :threshold, Integer - # @!method initialize(match: nil, threshold: nil) + # @!method initialize(match:, threshold:) # @param match [Integer] # @param threshold [Integer] end diff --git a/lib/finch_api/models/hris/supported_benefit.rb b/lib/finch_api/models/hris/supported_benefit.rb index f1f3e811..a283db37 100644 --- a/lib/finch_api/models/hris/supported_benefit.rb +++ b/lib/finch_api/models/hris/supported_benefit.rb @@ -9,21 +9,14 @@ class SupportedBenefit < FinchAPI::Internal::Type::BaseModel # Whether the provider supports an annual maximum for this benefit. # # @return [Boolean, nil] - optional :annual_maximum, FinchAPI::Internal::Type::Boolean, nil?: true - - # @!attribute catch_up - # Whether the provider supports catch up for this benefit. This field will only be - # true for retirement benefits. - # - # @return [Boolean, nil] - optional :catch_up, FinchAPI::Internal::Type::Boolean, nil?: true + required :annual_maximum, FinchAPI::Internal::Type::Boolean, nil?: true # @!attribute company_contribution # Supported contribution types. An empty array indicates contributions are not # supported. # # @return [Array, nil] - optional :company_contribution, + required :company_contribution, -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::SupportedBenefit::CompanyContribution, nil?: true] @@ -33,14 +26,14 @@ class SupportedBenefit < FinchAPI::Internal::Type::BaseModel # @!attribute description # # @return [String, nil] - optional :description, String, nil?: true + required :description, String, nil?: true # @!attribute employee_deduction # Supported deduction types. An empty array indicates deductions are not # supported. # # @return [Array, nil] - optional :employee_deduction, + required :employee_deduction, -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true] @@ -50,10 +43,17 @@ class SupportedBenefit < FinchAPI::Internal::Type::BaseModel # @!attribute frequencies # The list of frequencies supported by the provider for this benefit # - # @return [Array, nil] - optional :frequencies, + # @return [Array] + required :frequencies, -> { FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::BenefitFrequency, nil?: true] } + # @!attribute catch_up + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. + # + # @return [Boolean, nil] + optional :catch_up, FinchAPI::Internal::Type::Boolean, nil?: true + # @!attribute hsa_contribution_limit # Whether the provider supports HSA contribution limits. Empty if this feature is # not supported for the benefit. This array only has values for HSA benefits. @@ -66,14 +66,12 @@ class SupportedBenefit < FinchAPI::Internal::Type::BaseModel }, nil?: true - # @!method initialize(annual_maximum: nil, catch_up: nil, company_contribution: nil, description: nil, employee_deduction: nil, frequencies: nil, hsa_contribution_limit: nil) + # @!method initialize(annual_maximum:, company_contribution:, description:, employee_deduction:, frequencies:, catch_up: nil, hsa_contribution_limit: nil) # Some parameter documentations has been truncated, see # {FinchAPI::Models::HRIS::SupportedBenefit} for more details. # # @param annual_maximum [Boolean, nil] Whether the provider supports an annual maximum for this benefit. # - # @param catch_up [Boolean, nil] Whether the provider supports catch up for this benefit. This field will only be - # # @param company_contribution [Array, nil] Supported contribution types. An empty array indicates contributions are not sup # # @param description [String, nil] @@ -82,6 +80,8 @@ class SupportedBenefit < FinchAPI::Internal::Type::BaseModel # # @param frequencies [Array] The list of frequencies supported by the provider for this benefit # + # @param catch_up [Boolean, nil] Whether the provider supports catch up for this benefit. This field will only be + # # @param hsa_contribution_limit [Array, nil] Whether the provider supports HSA contribution limits. Empty if this feature is module CompanyContribution @@ -107,8 +107,8 @@ module EmployeeDeduction module HsaContributionLimit extend FinchAPI::Internal::Type::Enum - INDIVIDUAL = :individual FAMILY = :family + INDIVIDUAL = :individual # @!method self.values # @return [Array] diff --git a/lib/finch_api/models/jobs/automated_create_response.rb b/lib/finch_api/models/jobs/automated_create_response.rb index 2c46869e..075cd579 100644 --- a/lib/finch_api/models/jobs/automated_create_response.rb +++ b/lib/finch_api/models/jobs/automated_create_response.rb @@ -11,32 +11,40 @@ class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel # @return [Integer] required :allowed_refreshes, Integer + # @!attribute remaining_refreshes + # The number of remaining refreshes available (per hour, fixed window) + # + # @return [Integer] + required :remaining_refreshes, Integer + # @!attribute job_id # The id of the job that has been created. # - # @return [String] - required :job_id, String + # @return [String, nil] + optional :job_id, String # @!attribute job_url # The url that can be used to retrieve the job status # - # @return [String] - required :job_url, String + # @return [String, nil] + optional :job_url, String - # @!attribute remaining_refreshes - # The number of remaining refreshes available (per hour, fixed window) + # @!attribute retry_at + # ISO 8601 timestamp indicating when to retry the request # - # @return [Integer] - required :remaining_refreshes, Integer + # @return [String, nil] + optional :retry_at, String - # @!method initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) + # @!method initialize(allowed_refreshes:, remaining_refreshes:, job_id: nil, job_url: nil, retry_at: nil) # @param allowed_refreshes [Integer] The number of allowed refreshes per hour (per hour, fixed window) # + # @param remaining_refreshes [Integer] The number of remaining refreshes available (per hour, fixed window) + # # @param job_id [String] The id of the job that has been created. # # @param job_url [String] The url that can be used to retrieve the job status # - # @param remaining_refreshes [Integer] The number of remaining refreshes available (per hour, fixed window) + # @param retry_at [String] ISO 8601 timestamp indicating when to retry the request end end end diff --git a/lib/finch_api/version.rb b/lib/finch_api/version.rb index 303f1f36..c8a8000b 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.23" + VERSION = "0.1.0.pre.alpha.24" end diff --git a/rbi/finch_api/models/hris/benefit_contribution.rbi b/rbi/finch_api/models/hris/benefit_contribution.rbi index 86012901..84568b65 100644 --- a/rbi/finch_api/models/hris/benefit_contribution.rbi +++ b/rbi/finch_api/models/hris/benefit_contribution.rbi @@ -32,9 +32,9 @@ module FinchAPI end def self.new( # Contribution amount in cents (if `fixed`) or basis points (if `percent`). - amount: nil, + amount:, # Contribution type. - type: nil + type: ) end diff --git a/rbi/finch_api/models/hris/benefit_create_params.rbi b/rbi/finch_api/models/hris/benefit_create_params.rbi index 72206fcf..b4efa3bc 100644 --- a/rbi/finch_api/models/hris/benefit_create_params.rbi +++ b/rbi/finch_api/models/hris/benefit_create_params.rbi @@ -105,41 +105,19 @@ module FinchAPI sig do returns( - T.nilable( - T::Array[ - FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier - ] - ) + T::Array[ + FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier + ] ) end - attr_reader :tiers - - sig do - params( - tiers: - T::Array[ - FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier::OrHash - ] - ).void - end - attr_writer :tiers + attr_accessor :tiers sig do returns( - T.nilable( - FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol - ) + FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol ) end - attr_reader :type - - sig do - params( - type: - FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol - ).void - end - attr_writer :type + attr_accessor :type # The company match for this benefit. sig do @@ -152,7 +130,7 @@ module FinchAPI FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol ).returns(T.attached_class) end - def self.new(tiers: nil, type: nil) + def self.new(tiers:, type:) end sig do @@ -179,24 +157,18 @@ module FinchAPI ) end - sig { returns(T.nilable(Integer)) } - attr_reader :match - - sig { params(match: Integer).void } - attr_writer :match - - sig { returns(T.nilable(Integer)) } - attr_reader :threshold + sig { returns(Integer) } + attr_accessor :match - sig { params(threshold: Integer).void } - attr_writer :threshold + sig { returns(Integer) } + attr_accessor :threshold sig do params(match: Integer, threshold: Integer).returns( T.attached_class ) end - def self.new(match: nil, threshold: nil) + def self.new(match:, threshold:) end sig { override.returns({ match: Integer, threshold: Integer }) } diff --git a/rbi/finch_api/models/hris/benefit_frequency.rbi b/rbi/finch_api/models/hris/benefit_frequency.rbi index 05caa7f6..a4f7d04a 100644 --- a/rbi/finch_api/models/hris/benefit_frequency.rbi +++ b/rbi/finch_api/models/hris/benefit_frequency.rbi @@ -11,12 +11,12 @@ module FinchAPI T.type_alias { T.all(Symbol, FinchAPI::HRIS::BenefitFrequency) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let(:one_time, FinchAPI::HRIS::BenefitFrequency::TaggedSymbol) EVERY_PAYCHECK = T.let(:every_paycheck, FinchAPI::HRIS::BenefitFrequency::TaggedSymbol) MONTHLY = T.let(:monthly, FinchAPI::HRIS::BenefitFrequency::TaggedSymbol) + ONE_TIME = + T.let(:one_time, FinchAPI::HRIS::BenefitFrequency::TaggedSymbol) sig do override.returns( diff --git a/rbi/finch_api/models/hris/benefits/individual_benefit.rbi b/rbi/finch_api/models/hris/benefits/individual_benefit.rbi index 00a7de49..952acd1d 100644 --- a/rbi/finch_api/models/hris/benefits/individual_benefit.rbi +++ b/rbi/finch_api/models/hris/benefits/individual_benefit.rbi @@ -16,45 +16,35 @@ module FinchAPI end sig do - returns( - T.nilable(FinchAPI::HRIS::Benefits::IndividualBenefit::Body) - ) - end - attr_reader :body - - sig do - params( - body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body::OrHash - ).void + returns(FinchAPI::HRIS::Benefits::IndividualBenefit::Body::Variants) end - attr_writer :body - - sig { returns(T.nilable(Integer)) } - attr_reader :code + attr_accessor :body - sig { params(code: Integer).void } - attr_writer :code + sig { returns(Integer) } + attr_accessor :code - sig { returns(T.nilable(String)) } - attr_reader :individual_id - - sig { params(individual_id: String).void } - attr_writer :individual_id + sig { returns(String) } + attr_accessor :individual_id sig do params( - body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body::OrHash, + body: + T.any( + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::OrHash, + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::BatchError::OrHash + ), code: Integer, individual_id: String ).returns(T.attached_class) end - def self.new(body: nil, code: nil, individual_id: nil) + def self.new(body:, code:, individual_id:) end sig do override.returns( { - body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body, + body: + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::Variants, code: Integer, individual_id: String } @@ -63,136 +53,207 @@ module FinchAPI def to_hash end - class Body < FinchAPI::Internal::Type::BaseModel - OrHash = + module Body + extend FinchAPI::Internal::Type::Union + + Variants = T.type_alias do T.any( - FinchAPI::HRIS::Benefits::IndividualBenefit::Body, - FinchAPI::Internal::AnyHash + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0, + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::BatchError ) end - # If the benefit supports annual maximum, the amount in cents for this individual. - sig { returns(T.nilable(Integer)) } - attr_accessor :annual_maximum + class UnionMember0 < FinchAPI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0, + FinchAPI::Internal::AnyHash + ) + end - # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled - # for this individual. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :catch_up + # If the benefit supports annual maximum, the amount in cents for this individual. + sig { returns(T.nilable(Integer)) } + attr_accessor :annual_maximum - sig { returns(T.nilable(FinchAPI::HRIS::BenefitContribution)) } - attr_reader :company_contribution + # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled + # for this individual. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :catch_up - sig do - params( - company_contribution: - T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash) - ).void - end - attr_writer :company_contribution + sig { returns(T.nilable(FinchAPI::HRIS::BenefitContribution)) } + attr_reader :company_contribution - sig { returns(T.nilable(FinchAPI::HRIS::BenefitContribution)) } - attr_reader :employee_deduction + sig do + params( + company_contribution: + T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash) + ).void + end + attr_writer :company_contribution - sig do - params( - employee_deduction: - T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash) - ).void - end - attr_writer :employee_deduction + sig { returns(T.nilable(FinchAPI::HRIS::BenefitContribution)) } + attr_reader :employee_deduction - # Type for HSA contribution limit if the benefit is a HSA. - sig do - returns( - T.nilable( - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol - ) - ) - end - attr_accessor :hsa_contribution_limit + sig do + params( + employee_deduction: + T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash) + ).void + end + attr_writer :employee_deduction - sig do - params( - annual_maximum: T.nilable(Integer), - catch_up: T.nilable(T::Boolean), - company_contribution: - T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash), - employee_deduction: - T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash), - hsa_contribution_limit: + # Type for HSA contribution limit if the benefit is a HSA. + sig do + returns( T.nilable( - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::OrSymbol + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit::TaggedSymbol ) - ).returns(T.attached_class) - end - def self.new( - # If the benefit supports annual maximum, the amount in cents for this individual. - annual_maximum: nil, - # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled - # for this individual. - catch_up: nil, - company_contribution: nil, - employee_deduction: nil, - # Type for HSA contribution limit if the benefit is a HSA. - hsa_contribution_limit: nil - ) - end + ) + end + attr_accessor :hsa_contribution_limit - sig do - override.returns( - { + sig do + params( annual_maximum: T.nilable(Integer), catch_up: T.nilable(T::Boolean), company_contribution: - T.nilable(FinchAPI::HRIS::BenefitContribution), + T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash), employee_deduction: - T.nilable(FinchAPI::HRIS::BenefitContribution), + T.nilable(FinchAPI::HRIS::BenefitContribution::OrHash), hsa_contribution_limit: T.nilable( - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit::OrSymbol ) - } + ).returns(T.attached_class) + end + def self.new( + # If the benefit supports annual maximum, the amount in cents for this individual. + annual_maximum:, + # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled + # for this individual. + catch_up:, + company_contribution:, + employee_deduction:, + # Type for HSA contribution limit if the benefit is a HSA. + hsa_contribution_limit: nil ) - end - def to_hash - end + end - # Type for HSA contribution limit if the benefit is a HSA. - module HsaContributionLimit - extend FinchAPI::Internal::Type::Enum + sig do + override.returns( + { + annual_maximum: T.nilable(Integer), + catch_up: T.nilable(T::Boolean), + company_contribution: + T.nilable(FinchAPI::HRIS::BenefitContribution), + employee_deduction: + T.nilable(FinchAPI::HRIS::BenefitContribution), + hsa_contribution_limit: + T.nilable( + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Type for HSA contribution limit if the benefit is a HSA. + module HsaContributionLimit + extend FinchAPI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } - TaggedSymbol = + INDIVIDUAL = + T.let( + :individual, + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit::TaggedSymbol + ) + FAMILY = + T.let( + :family, + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class BatchError < FinchAPI::Internal::Type::BaseModel + OrHash = T.type_alias do - T.all( - Symbol, - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit + T.any( + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::BatchError, + FinchAPI::Internal::AnyHash ) end - OrSymbol = T.type_alias { T.any(Symbol, String) } - INDIVIDUAL = - T.let( - :individual, - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol - ) - FAMILY = - T.let( - :family, - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol - ) + sig { returns(Float) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :finch_code + + sig { params(finch_code: String).void } + attr_writer :finch_code + + sig do + params( + code: Float, + message: String, + name: String, + finch_code: String + ).returns(T.attached_class) + end + def self.new(code:, message:, name:, finch_code: nil) + end sig do override.returns( - T::Array[ - FinchAPI::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol - ] + { + code: Float, + message: String, + name: String, + finch_code: String + } ) end - def self.values + def to_hash end end + + sig do + override.returns( + T::Array[ + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::Variants + ] + ) + end + def self.variants + end end end end diff --git a/rbi/finch_api/models/hris/company_benefit.rbi b/rbi/finch_api/models/hris/company_benefit.rbi index be57f17d..9394b739 100644 --- a/rbi/finch_api/models/hris/company_benefit.rbi +++ b/rbi/finch_api/models/hris/company_benefit.rbi @@ -13,6 +13,19 @@ module FinchAPI sig { returns(String) } attr_accessor :benefit_id + sig { returns(T.nilable(String)) } + attr_accessor :description + + # The frequency of the benefit deduction/contribution. + sig do + returns(T.nilable(FinchAPI::HRIS::BenefitFrequency::TaggedSymbol)) + end + attr_accessor :frequency + + # Type of benefit. + sig { returns(T.nilable(FinchAPI::HRIS::BenefitType::TaggedSymbol)) } + attr_accessor :type + # The company match for this benefit. sig do returns( @@ -31,41 +44,28 @@ module FinchAPI end attr_writer :company_contribution - sig { returns(T.nilable(String)) } - attr_accessor :description - - # The frequency of the benefit deduction/contribution. - sig do - returns(T.nilable(FinchAPI::HRIS::BenefitFrequency::TaggedSymbol)) - end - attr_accessor :frequency - - # Type of benefit. - sig { returns(T.nilable(FinchAPI::HRIS::BenefitType::TaggedSymbol)) } - attr_accessor :type - sig do params( benefit_id: String, + description: T.nilable(String), + frequency: T.nilable(FinchAPI::HRIS::BenefitFrequency::OrSymbol), + type: T.nilable(FinchAPI::HRIS::BenefitType::OrSymbol), company_contribution: T.nilable( FinchAPI::HRIS::CompanyBenefit::CompanyContribution::OrHash - ), - description: T.nilable(String), - frequency: T.nilable(FinchAPI::HRIS::BenefitFrequency::OrSymbol), - type: T.nilable(FinchAPI::HRIS::BenefitType::OrSymbol) + ) ).returns(T.attached_class) end def self.new( # The id of the benefit. benefit_id:, - # The company match for this benefit. - company_contribution:, description:, # The frequency of the benefit deduction/contribution. frequency:, # Type of benefit. - type: + type:, + # The company match for this benefit. + company_contribution: nil ) end @@ -73,12 +73,12 @@ module FinchAPI override.returns( { benefit_id: String, - company_contribution: - T.nilable(FinchAPI::HRIS::CompanyBenefit::CompanyContribution), description: T.nilable(String), frequency: T.nilable(FinchAPI::HRIS::BenefitFrequency::TaggedSymbol), - type: T.nilable(FinchAPI::HRIS::BenefitType::TaggedSymbol) + type: T.nilable(FinchAPI::HRIS::BenefitType::TaggedSymbol), + company_contribution: + T.nilable(FinchAPI::HRIS::CompanyBenefit::CompanyContribution) } ) end @@ -96,41 +96,19 @@ module FinchAPI sig do returns( - T.nilable( - T::Array[ - FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier - ] - ) + T::Array[ + FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier + ] ) end - attr_reader :tiers - - sig do - params( - tiers: - T::Array[ - FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier::OrHash - ] - ).void - end - attr_writer :tiers + attr_accessor :tiers sig do returns( - T.nilable( - FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Type::TaggedSymbol - ) + FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Type::TaggedSymbol ) end - attr_reader :type - - sig do - params( - type: - FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Type::OrSymbol - ).void - end - attr_writer :type + attr_accessor :type # The company match for this benefit. sig do @@ -143,7 +121,7 @@ module FinchAPI FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Type::OrSymbol ).returns(T.attached_class) end - def self.new(tiers: nil, type: nil) + def self.new(tiers:, type:) end sig do @@ -170,24 +148,18 @@ module FinchAPI ) end - sig { returns(T.nilable(Integer)) } - attr_reader :match - - sig { params(match: Integer).void } - attr_writer :match - - sig { returns(T.nilable(Integer)) } - attr_reader :threshold + sig { returns(Integer) } + attr_accessor :match - sig { params(threshold: Integer).void } - attr_writer :threshold + sig { returns(Integer) } + attr_accessor :threshold sig do params(match: Integer, threshold: Integer).returns( T.attached_class ) end - def self.new(match: nil, threshold: nil) + def self.new(match:, threshold:) end sig { override.returns({ match: Integer, threshold: Integer }) } diff --git a/rbi/finch_api/models/hris/supported_benefit.rbi b/rbi/finch_api/models/hris/supported_benefit.rbi index 6bda9106..db643fff 100644 --- a/rbi/finch_api/models/hris/supported_benefit.rbi +++ b/rbi/finch_api/models/hris/supported_benefit.rbi @@ -13,11 +13,6 @@ module FinchAPI sig { returns(T.nilable(T::Boolean)) } attr_accessor :annual_maximum - # Whether the provider supports catch up for this benefit. This field will only be - # true for retirement benefits. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :catch_up - # Supported contribution types. An empty array indicates contributions are not # supported. sig do @@ -54,22 +49,15 @@ module FinchAPI # The list of frequencies supported by the provider for this benefit sig do returns( - T.nilable( - T::Array[ - T.nilable(FinchAPI::HRIS::BenefitFrequency::TaggedSymbol) - ] - ) + T::Array[T.nilable(FinchAPI::HRIS::BenefitFrequency::TaggedSymbol)] ) end - attr_reader :frequencies + attr_accessor :frequencies - sig do - params( - frequencies: - T::Array[T.nilable(FinchAPI::HRIS::BenefitFrequency::OrSymbol)] - ).void - end - attr_writer :frequencies + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :catch_up # Whether the provider supports HSA contribution limits. Empty if this feature is # not supported for the benefit. This array only has values for HSA benefits. @@ -89,7 +77,6 @@ module FinchAPI sig do params( annual_maximum: T.nilable(T::Boolean), - catch_up: T.nilable(T::Boolean), company_contribution: T.nilable( T::Array[ @@ -109,6 +96,7 @@ module FinchAPI ), frequencies: T::Array[T.nilable(FinchAPI::HRIS::BenefitFrequency::OrSymbol)], + catch_up: T.nilable(T::Boolean), hsa_contribution_limit: T.nilable( T::Array[ @@ -121,19 +109,19 @@ module FinchAPI end def self.new( # Whether the provider supports an annual maximum for this benefit. - annual_maximum: nil, - # Whether the provider supports catch up for this benefit. This field will only be - # true for retirement benefits. - catch_up: nil, + annual_maximum:, # Supported contribution types. An empty array indicates contributions are not # supported. - company_contribution: nil, - description: nil, + company_contribution:, + description:, # Supported deduction types. An empty array indicates deductions are not # supported. - employee_deduction: nil, + employee_deduction:, # The list of frequencies supported by the provider for this benefit - frequencies: nil, + frequencies:, + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. + catch_up: nil, # Whether the provider supports HSA contribution limits. Empty if this feature is # not supported for the benefit. This array only has values for HSA benefits. hsa_contribution_limit: nil @@ -144,7 +132,6 @@ module FinchAPI override.returns( { annual_maximum: T.nilable(T::Boolean), - catch_up: T.nilable(T::Boolean), company_contribution: T.nilable( T::Array[ @@ -166,6 +153,7 @@ module FinchAPI T::Array[ T.nilable(FinchAPI::HRIS::BenefitFrequency::TaggedSymbol) ], + catch_up: T.nilable(T::Boolean), hsa_contribution_limit: T.nilable( T::Array[ @@ -257,14 +245,14 @@ module FinchAPI end OrSymbol = T.type_alias { T.any(Symbol, String) } - INDIVIDUAL = + FAMILY = T.let( - :individual, + :family, FinchAPI::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol ) - FAMILY = + INDIVIDUAL = T.let( - :family, + :individual, FinchAPI::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol ) diff --git a/rbi/finch_api/models/jobs/automated_create_response.rbi b/rbi/finch_api/models/jobs/automated_create_response.rbi index 18773c8a..61452aa1 100644 --- a/rbi/finch_api/models/jobs/automated_create_response.rbi +++ b/rbi/finch_api/models/jobs/automated_create_response.rbi @@ -16,35 +16,51 @@ module FinchAPI sig { returns(Integer) } attr_accessor :allowed_refreshes + # The number of remaining refreshes available (per hour, fixed window) + sig { returns(Integer) } + attr_accessor :remaining_refreshes + # The id of the job that has been created. - sig { returns(String) } - attr_accessor :job_id + sig { returns(T.nilable(String)) } + attr_reader :job_id + + sig { params(job_id: String).void } + attr_writer :job_id # The url that can be used to retrieve the job status - sig { returns(String) } - attr_accessor :job_url + sig { returns(T.nilable(String)) } + attr_reader :job_url - # The number of remaining refreshes available (per hour, fixed window) - sig { returns(Integer) } - attr_accessor :remaining_refreshes + sig { params(job_url: String).void } + attr_writer :job_url + + # ISO 8601 timestamp indicating when to retry the request + sig { returns(T.nilable(String)) } + attr_reader :retry_at + + sig { params(retry_at: String).void } + attr_writer :retry_at sig do params( allowed_refreshes: Integer, + remaining_refreshes: Integer, job_id: String, job_url: String, - remaining_refreshes: Integer + retry_at: String ).returns(T.attached_class) end def self.new( # The number of allowed refreshes per hour (per hour, fixed window) allowed_refreshes:, + # The number of remaining refreshes available (per hour, fixed window) + remaining_refreshes:, # The id of the job that has been created. - job_id:, + job_id: nil, # The url that can be used to retrieve the job status - job_url:, - # The number of remaining refreshes available (per hour, fixed window) - remaining_refreshes: + job_url: nil, + # ISO 8601 timestamp indicating when to retry the request + retry_at: nil ) end @@ -52,9 +68,10 @@ module FinchAPI override.returns( { allowed_refreshes: Integer, + remaining_refreshes: Integer, job_id: String, job_url: String, - remaining_refreshes: Integer + retry_at: String } ) end diff --git a/sig/finch_api/models/hris/benefit_contribution.rbs b/sig/finch_api/models/hris/benefit_contribution.rbs index 4461179b..b18e040d 100644 --- a/sig/finch_api/models/hris/benefit_contribution.rbs +++ b/sig/finch_api/models/hris/benefit_contribution.rbs @@ -13,8 +13,8 @@ module FinchAPI attr_accessor type: FinchAPI::Models::HRIS::BenefitContribution::type_? def initialize: ( - ?amount: Integer?, - ?type: FinchAPI::Models::HRIS::BenefitContribution::type_? + amount: Integer?, + type: FinchAPI::Models::HRIS::BenefitContribution::type_? ) -> void def to_hash: -> { diff --git a/sig/finch_api/models/hris/benefit_create_params.rbs b/sig/finch_api/models/hris/benefit_create_params.rbs index 84a26d40..3a79eece 100644 --- a/sig/finch_api/models/hris/benefit_create_params.rbs +++ b/sig/finch_api/models/hris/benefit_create_params.rbs @@ -47,21 +47,13 @@ module FinchAPI } class CompanyContribution < FinchAPI::Internal::Type::BaseModel - attr_reader tiers: ::Array[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier]? + attr_accessor tiers: ::Array[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier] - def tiers=: ( - ::Array[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier] - ) -> ::Array[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier] - - attr_reader type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_? - - def type=: ( - FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_ - ) -> FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_ + attr_accessor type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_ def initialize: ( - ?tiers: ::Array[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier], - ?type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_ + tiers: ::Array[FinchAPI::HRIS::BenefitCreateParams::CompanyContribution::Tier], + type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_ ) -> void def to_hash: -> { @@ -72,15 +64,11 @@ module FinchAPI type tier = { match: Integer, threshold: Integer } class Tier < FinchAPI::Internal::Type::BaseModel - attr_reader match: Integer? - - def match=: (Integer) -> Integer - - attr_reader threshold: Integer? + attr_accessor match: Integer - def threshold=: (Integer) -> Integer + attr_accessor threshold: Integer - def initialize: (?match: Integer, ?threshold: Integer) -> void + def initialize: (match: Integer, threshold: Integer) -> void def to_hash: -> { match: Integer, threshold: Integer } end diff --git a/sig/finch_api/models/hris/benefit_frequency.rbs b/sig/finch_api/models/hris/benefit_frequency.rbs index 5cef4f7a..c1c0ef8c 100644 --- a/sig/finch_api/models/hris/benefit_frequency.rbs +++ b/sig/finch_api/models/hris/benefit_frequency.rbs @@ -1,14 +1,14 @@ module FinchAPI module Models module HRIS - type benefit_frequency = :one_time | :every_paycheck | :monthly + type benefit_frequency = :every_paycheck | :monthly | :one_time module BenefitFrequency extend FinchAPI::Internal::Type::Enum - ONE_TIME: :one_time EVERY_PAYCHECK: :every_paycheck MONTHLY: :monthly + ONE_TIME: :one_time def self?.values: -> ::Array[FinchAPI::Models::HRIS::benefit_frequency] end diff --git a/sig/finch_api/models/hris/benefits/individual_benefit.rbs b/sig/finch_api/models/hris/benefits/individual_benefit.rbs index 9a819710..1469f702 100644 --- a/sig/finch_api/models/hris/benefits/individual_benefit.rbs +++ b/sig/finch_api/models/hris/benefits/individual_benefit.rbs @@ -6,84 +6,115 @@ module FinchAPI module Benefits type individual_benefit = { - body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body, + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body, code: Integer, individual_id: String } class IndividualBenefit < FinchAPI::Internal::Type::BaseModel - attr_reader body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body? + attr_accessor body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body - def body=: ( - FinchAPI::HRIS::Benefits::IndividualBenefit::Body - ) -> FinchAPI::HRIS::Benefits::IndividualBenefit::Body + attr_accessor code: Integer - attr_reader code: Integer? - - def code=: (Integer) -> Integer - - attr_reader individual_id: String? - - def individual_id=: (String) -> String + attr_accessor individual_id: String def initialize: ( - ?body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body, - ?code: Integer, - ?individual_id: String + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body, + code: Integer, + individual_id: String ) -> void def to_hash: -> { - body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body, + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body, code: Integer, individual_id: String } type body = - { - annual_maximum: Integer?, - catch_up: bool?, - company_contribution: FinchAPI::HRIS::BenefitContribution?, - employee_deduction: FinchAPI::HRIS::BenefitContribution?, - hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? - } + FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0 + | FinchAPI::HRIS::Benefits::IndividualBenefit::Body::BatchError - class Body < FinchAPI::Internal::Type::BaseModel - attr_accessor annual_maximum: Integer? + module Body + extend FinchAPI::Internal::Type::Union - attr_accessor catch_up: bool? + type union_member0 = + { + annual_maximum: Integer?, + catch_up: bool?, + company_contribution: FinchAPI::HRIS::BenefitContribution?, + employee_deduction: FinchAPI::HRIS::BenefitContribution?, + hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::hsa_contribution_limit? + } - attr_accessor company_contribution: FinchAPI::HRIS::BenefitContribution? + class UnionMember0 < FinchAPI::Internal::Type::BaseModel + attr_accessor annual_maximum: Integer? - attr_accessor employee_deduction: FinchAPI::HRIS::BenefitContribution? + attr_accessor catch_up: bool? - attr_accessor hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? + attr_accessor company_contribution: FinchAPI::HRIS::BenefitContribution? - def initialize: ( - ?annual_maximum: Integer?, - ?catch_up: bool?, - ?company_contribution: FinchAPI::HRIS::BenefitContribution?, - ?employee_deduction: FinchAPI::HRIS::BenefitContribution?, - ?hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? - ) -> void + attr_accessor employee_deduction: FinchAPI::HRIS::BenefitContribution? - def to_hash: -> { - annual_maximum: Integer?, - catch_up: bool?, - company_contribution: FinchAPI::HRIS::BenefitContribution?, - employee_deduction: FinchAPI::HRIS::BenefitContribution?, - hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? - } + attr_accessor hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::hsa_contribution_limit? - type hsa_contribution_limit = :individual | :family + def initialize: ( + annual_maximum: Integer?, + catch_up: bool?, + company_contribution: FinchAPI::HRIS::BenefitContribution?, + employee_deduction: FinchAPI::HRIS::BenefitContribution?, + ?hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::hsa_contribution_limit? + ) -> void - module HsaContributionLimit - extend FinchAPI::Internal::Type::Enum + def to_hash: -> { + annual_maximum: Integer?, + catch_up: bool?, + company_contribution: FinchAPI::HRIS::BenefitContribution?, + employee_deduction: FinchAPI::HRIS::BenefitContribution?, + hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::hsa_contribution_limit? + } - INDIVIDUAL: :individual - FAMILY: :family + type hsa_contribution_limit = :individual | :family - def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit] + module HsaContributionLimit + extend FinchAPI::Internal::Type::Enum + + INDIVIDUAL: :individual + FAMILY: :family + + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::hsa_contribution_limit] + end end + + type batch_error = + { code: Float, message: String, name: String, finch_code: String } + + class BatchError < FinchAPI::Internal::Type::BaseModel + attr_accessor code: Float + + attr_accessor message: String + + attr_accessor name: String + + attr_reader finch_code: String? + + def finch_code=: (String) -> String + + def initialize: ( + code: Float, + message: String, + name: String, + ?finch_code: String + ) -> void + + def to_hash: -> { + code: Float, + message: String, + name: String, + finch_code: String + } + end + + def self?.variants: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body] end end end diff --git a/sig/finch_api/models/hris/company_benefit.rbs b/sig/finch_api/models/hris/company_benefit.rbs index b7004711..286c3bce 100644 --- a/sig/finch_api/models/hris/company_benefit.rbs +++ b/sig/finch_api/models/hris/company_benefit.rbs @@ -4,37 +4,37 @@ module FinchAPI type company_benefit = { benefit_id: String, - company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution?, description: String?, frequency: FinchAPI::Models::HRIS::benefit_frequency?, - type: FinchAPI::Models::HRIS::benefit_type? + type: FinchAPI::Models::HRIS::benefit_type?, + company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution? } class CompanyBenefit < FinchAPI::Internal::Type::BaseModel attr_accessor benefit_id: String - attr_accessor company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution? - attr_accessor description: String? attr_accessor frequency: FinchAPI::Models::HRIS::benefit_frequency? attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + attr_accessor company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution? + def initialize: ( benefit_id: String, - company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution?, description: String?, frequency: FinchAPI::Models::HRIS::benefit_frequency?, - type: FinchAPI::Models::HRIS::benefit_type? + type: FinchAPI::Models::HRIS::benefit_type?, + ?company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution? ) -> void def to_hash: -> { benefit_id: String, - company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution?, description: String?, frequency: FinchAPI::Models::HRIS::benefit_frequency?, - type: FinchAPI::Models::HRIS::benefit_type? + type: FinchAPI::Models::HRIS::benefit_type?, + company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution? } type company_contribution = @@ -44,21 +44,13 @@ module FinchAPI } class CompanyContribution < FinchAPI::Internal::Type::BaseModel - attr_reader tiers: ::Array[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier]? - - def tiers=: ( - ::Array[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier] - ) -> ::Array[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier] + attr_accessor tiers: ::Array[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier] - attr_reader type: FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::type_? - - def type=: ( - FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::type_ - ) -> FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::type_ + attr_accessor type: FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::type_ def initialize: ( - ?tiers: ::Array[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier], - ?type: FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::type_ + tiers: ::Array[FinchAPI::HRIS::CompanyBenefit::CompanyContribution::Tier], + type: FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution::type_ ) -> void def to_hash: -> { @@ -69,15 +61,11 @@ module FinchAPI type tier = { match: Integer, threshold: Integer } class Tier < FinchAPI::Internal::Type::BaseModel - attr_reader match: Integer? - - def match=: (Integer) -> Integer - - attr_reader threshold: Integer? + attr_accessor match: Integer - def threshold=: (Integer) -> Integer + attr_accessor threshold: Integer - def initialize: (?match: Integer, ?threshold: Integer) -> void + def initialize: (match: Integer, threshold: Integer) -> void def to_hash: -> { match: Integer, threshold: Integer } end diff --git a/sig/finch_api/models/hris/supported_benefit.rbs b/sig/finch_api/models/hris/supported_benefit.rbs index d4a7572d..ab4e335c 100644 --- a/sig/finch_api/models/hris/supported_benefit.rbs +++ b/sig/finch_api/models/hris/supported_benefit.rbs @@ -4,50 +4,46 @@ module FinchAPI type supported_benefit = { annual_maximum: bool?, - catch_up: bool?, company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]?, description: String?, employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]?, frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], + catch_up: bool?, hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]? } class SupportedBenefit < FinchAPI::Internal::Type::BaseModel attr_accessor annual_maximum: bool? - attr_accessor catch_up: bool? - attr_accessor company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]? attr_accessor description: String? attr_accessor employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]? - attr_reader frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?]? + attr_accessor frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?] - def frequencies=: ( - ::Array[FinchAPI::Models::HRIS::benefit_frequency?] - ) -> ::Array[FinchAPI::Models::HRIS::benefit_frequency?] + attr_accessor catch_up: bool? attr_accessor hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]? def initialize: ( - ?annual_maximum: bool?, + annual_maximum: bool?, + company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]?, + description: String?, + employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]?, + frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], ?catch_up: bool?, - ?company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]?, - ?description: String?, - ?employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]?, - ?frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], ?hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]? ) -> void def to_hash: -> { annual_maximum: bool?, - catch_up: bool?, company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]?, description: String?, employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]?, frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], + catch_up: bool?, hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]? } @@ -73,13 +69,13 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction] end - type hsa_contribution_limit = :individual | :family + type hsa_contribution_limit = :family | :individual module HsaContributionLimit extend FinchAPI::Internal::Type::Enum - INDIVIDUAL: :individual FAMILY: :family + INDIVIDUAL: :individual def self?.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit] end diff --git a/sig/finch_api/models/jobs/automated_create_response.rbs b/sig/finch_api/models/jobs/automated_create_response.rbs index 6665be1c..c17f583b 100644 --- a/sig/finch_api/models/jobs/automated_create_response.rbs +++ b/sig/finch_api/models/jobs/automated_create_response.rbs @@ -4,32 +4,43 @@ module FinchAPI type automated_create_response = { allowed_refreshes: Integer, + remaining_refreshes: Integer, job_id: String, job_url: String, - remaining_refreshes: Integer + retry_at: String } class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel attr_accessor allowed_refreshes: Integer - attr_accessor job_id: String + attr_accessor remaining_refreshes: Integer - attr_accessor job_url: String + attr_reader job_id: String? - attr_accessor remaining_refreshes: Integer + def job_id=: (String) -> String + + attr_reader job_url: String? + + def job_url=: (String) -> String + + attr_reader retry_at: String? + + def retry_at=: (String) -> String def initialize: ( allowed_refreshes: Integer, - job_id: String, - job_url: String, - remaining_refreshes: Integer + remaining_refreshes: Integer, + ?job_id: String, + ?job_url: String, + ?retry_at: String ) -> void def to_hash: -> { allowed_refreshes: Integer, + remaining_refreshes: Integer, job_id: String, job_url: String, - remaining_refreshes: Integer + retry_at: String } end end diff --git a/test/finch_api/resources/hris/benefits/individuals_test.rb b/test/finch_api/resources/hris/benefits/individuals_test.rb index b8b559d4..3abd5319 100644 --- a/test/finch_api/resources/hris/benefits/individuals_test.rb +++ b/test/finch_api/resources/hris/benefits/individuals_test.rb @@ -48,9 +48,9 @@ def test_retrieve_many_benefits assert_pattern do row => { - body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body | nil, - code: Integer | nil, - individual_id: String | nil + body: FinchAPI::HRIS::Benefits::IndividualBenefit::Body, + code: Integer, + individual_id: String } end end diff --git a/test/finch_api/resources/hris/benefits_test.rb b/test/finch_api/resources/hris/benefits_test.rb index c7de1b26..828a7dd4 100644 --- a/test/finch_api/resources/hris/benefits_test.rb +++ b/test/finch_api/resources/hris/benefits_test.rb @@ -28,10 +28,10 @@ def test_retrieve assert_pattern do response => { benefit_id: String, - company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution | nil, description: String | nil, frequency: FinchAPI::HRIS::BenefitFrequency | nil, - type: FinchAPI::HRIS::BenefitType | nil + type: FinchAPI::HRIS::BenefitType | nil, + company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution | nil } end end @@ -68,10 +68,10 @@ def test_list assert_pattern do row => { benefit_id: String, - company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution | nil, description: String | nil, frequency: FinchAPI::HRIS::BenefitFrequency | nil, - type: FinchAPI::HRIS::BenefitType | nil + type: FinchAPI::HRIS::BenefitType | nil, + company_contribution: FinchAPI::HRIS::CompanyBenefit::CompanyContribution | nil } end end @@ -93,14 +93,13 @@ def test_list_supported_benefits assert_pattern do row => { annual_maximum: FinchAPI::Internal::Type::Boolean | nil, - catch_up: FinchAPI::Internal::Type::Boolean | nil, company_contribution: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::SupportedBenefit::CompanyContribution, nil?: true]) | nil, description: String | nil, employee_deduction: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true]) | nil, - frequencies: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::BenefitFrequency, - nil?: true]) | nil, + frequencies: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::BenefitFrequency, nil?: true]), + catch_up: FinchAPI::Internal::Type::Boolean | nil, hsa_contribution_limit: ^(FinchAPI::Internal::Type::ArrayOf[enum: FinchAPI::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true]) | nil } diff --git a/test/finch_api/resources/jobs/automated_test.rb b/test/finch_api/resources/jobs/automated_test.rb index 4942aeee..9398dd98 100644 --- a/test/finch_api/resources/jobs/automated_test.rb +++ b/test/finch_api/resources/jobs/automated_test.rb @@ -14,9 +14,10 @@ def test_create_required_params assert_pattern do response => { allowed_refreshes: Integer, - job_id: String, - job_url: String, - remaining_refreshes: Integer + remaining_refreshes: Integer, + job_id: String | nil, + job_url: String | nil, + retry_at: String | nil } end end