Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.23"
".": "0.1.0-alpha.24"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "finch-api", "~> 0.1.0.pre.alpha.23"
gem "finch-api", "~> 0.1.0.pre.alpha.24"
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -222,25 +222,25 @@ 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:

```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,
# …
)
```
Expand Down
6 changes: 3 additions & 3 deletions lib/finch_api/models/hris/benefit_contribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 10 additions & 10 deletions lib/finch_api/models/hris/benefit_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel
class CompanyContribution < FinchAPI::Internal::Type::BaseModel
# @!attribute tiers
#
# @return [Array<FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier>, nil]
optional :tiers,
# @return [Array<FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier>]
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<FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier>]
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/finch_api/models/hris/benefit_frequency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<Symbol>]
Expand Down
172 changes: 107 additions & 65 deletions lib/finch_api/models/hris/benefits/individual_benefit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<Symbol>]
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<Symbol>]
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
Expand Down
Loading