Skip to content

Commit a8916c9

Browse files
feat(api): api update
1 parent b5ceabb commit a8916c9

10 files changed

Lines changed: 239 additions & 22 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-639dd4ab9ac2acad21a6764fda369a1d189a3e64bf71a65db36daf0f32d98242.yml
3-
openapi_spec_hash: c148f859bdd0b723c856bd472f115f1f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0583a6e86a80bc62551727b12c37e02a9b4e4ac5bce822b2e2c1cade3588a6f4.yml
3+
openapi_spec_hash: 53783b6cc1f63d9fb5d3a4dba7b0a806
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

lib/finch_api/models/hris/benefit_create_params.rb

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel
88
extend FinchAPI::Internal::Type::RequestParameters::Converter
99
include FinchAPI::Internal::Type::RequestParameters
1010

11+
# @!attribute company_contribution
12+
# The company match for this benefit.
13+
#
14+
# @return [FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution, nil]
15+
optional :company_contribution,
16+
-> { FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution },
17+
nil?: true
18+
1119
# @!attribute description
1220
# Name of the benefit as it appears in the provider and pay statements. Recommend
1321
# limiting this to <30 characters due to limitations in specific providers (e.g.
@@ -28,10 +36,12 @@ class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel
2836
# @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil]
2937
optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true
3038

31-
# @!method initialize(description: nil, frequency: nil, type: nil, request_options: {})
39+
# @!method initialize(company_contribution: nil, description: nil, frequency: nil, type: nil, request_options: {})
3240
# Some parameter documentations has been truncated, see
3341
# {FinchAPI::Models::HRIS::BenefitCreateParams} for more details.
3442
#
43+
# @param company_contribution [FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution, nil] The company match for this benefit.
44+
#
3545
# @param description [String] Name of the benefit as it appears in the provider and pay statements. Recommend
3646
# ...
3747
#
@@ -40,6 +50,51 @@ class BenefitCreateParams < FinchAPI::Internal::Type::BaseModel
4050
# @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] Type of benefit.
4151
#
4252
# @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}]
53+
54+
class CompanyContribution < FinchAPI::Internal::Type::BaseModel
55+
# @!attribute tiers
56+
#
57+
# @return [Array<FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier>, nil]
58+
optional :tiers,
59+
-> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier] }
60+
61+
# @!attribute type
62+
#
63+
# @return [Symbol, FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type, nil]
64+
optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type }
65+
66+
# @!method initialize(tiers: nil, type: nil)
67+
# The company match for this benefit.
68+
#
69+
# @param tiers [Array<FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier>]
70+
# @param type [Symbol, FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type]
71+
72+
class Tier < FinchAPI::Internal::Type::BaseModel
73+
# @!attribute match
74+
#
75+
# @return [Integer, nil]
76+
optional :match, Integer
77+
78+
# @!attribute threshold
79+
#
80+
# @return [Integer, nil]
81+
optional :threshold, Integer
82+
83+
# @!method initialize(match: nil, threshold: nil)
84+
# @param match [Integer]
85+
# @param threshold [Integer]
86+
end
87+
88+
# @see FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution#type
89+
module Type
90+
extend FinchAPI::Internal::Type::Enum
91+
92+
MATCH = :match
93+
94+
# @!method self.values
95+
# @return [Array<Symbol>]
96+
end
97+
end
4398
end
4499
end
45100
end

lib/finch_api/models/hris/company_benefit.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ class CompanyContribution < FinchAPI::Internal::Type::BaseModel
6969
class Tier < FinchAPI::Internal::Type::BaseModel
7070
# @!attribute match
7171
#
72-
# @return [Float, nil]
73-
optional :match, Float
72+
# @return [Integer, nil]
73+
optional :match, Integer
7474

7575
# @!attribute threshold
7676
#
77-
# @return [Float, nil]
78-
optional :threshold, Float
77+
# @return [Integer, nil]
78+
optional :threshold, Integer
7979

8080
# @!method initialize(match: nil, threshold: nil)
81-
# @param match [Float]
82-
# @param threshold [Float]
81+
# @param match [Integer]
82+
# @param threshold [Integer]
8383
end
8484

8585
# @see FinchAPI::Models::HRIS::CompanyBenefit::CompanyContribution#type

lib/finch_api/resources/hris/benefits.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ class Benefits
1313
# Creates a new company-wide deduction or contribution. Please use the
1414
# `/providers` endpoint to view available types for each provider.
1515
#
16-
# @overload create(description: nil, frequency: nil, type: nil, request_options: {})
16+
# @overload create(company_contribution: nil, description: nil, frequency: nil, type: nil, request_options: {})
17+
#
18+
# @param company_contribution [FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution, nil] The company match for this benefit.
1719
#
1820
# @param description [String] Name of the benefit as it appears in the provider and pay statements. Recommend
1921
# ...

rbi/finch_api/models/hris/benefit_create_params.rbi

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ module FinchAPI
77
extend FinchAPI::Internal::Type::RequestParameters::Converter
88
include FinchAPI::Internal::Type::RequestParameters
99

10+
# The company match for this benefit.
11+
sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution)) }
12+
attr_reader :company_contribution
13+
14+
sig do
15+
params(
16+
company_contribution: T.nilable(
17+
T.any(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution, FinchAPI::Internal::AnyHash)
18+
)
19+
)
20+
.void
21+
end
22+
attr_writer :company_contribution
23+
1024
# Name of the benefit as it appears in the provider and pay statements. Recommend
1125
# limiting this to <30 characters due to limitations in specific providers (e.g.
1226
# Justworks).
@@ -26,6 +40,9 @@ module FinchAPI
2640

2741
sig do
2842
params(
43+
company_contribution: T.nilable(
44+
T.any(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution, FinchAPI::Internal::AnyHash)
45+
),
2946
description: String,
3047
frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol),
3148
type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol),
@@ -34,6 +51,8 @@ module FinchAPI
3451
.returns(T.attached_class)
3552
end
3653
def self.new(
54+
# The company match for this benefit.
55+
company_contribution: nil,
3756
# Name of the benefit as it appears in the provider and pay statements. Recommend
3857
# limiting this to <30 characters due to limitations in specific providers (e.g.
3958
# Justworks).
@@ -48,6 +67,7 @@ module FinchAPI
4867
override
4968
.returns(
5069
{
70+
company_contribution: T.nilable(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution),
5171
description: String,
5272
frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol),
5373
type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol),
@@ -56,6 +76,83 @@ module FinchAPI
5676
)
5777
end
5878
def to_hash; end
79+
80+
class CompanyContribution < FinchAPI::Internal::Type::BaseModel
81+
sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier])) }
82+
attr_reader :tiers
83+
84+
sig do
85+
params(
86+
tiers: T::Array[T.any(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier, FinchAPI::Internal::AnyHash)]
87+
)
88+
.void
89+
end
90+
attr_writer :tiers
91+
92+
sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol)) }
93+
attr_reader :type
94+
95+
sig { params(type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol).void }
96+
attr_writer :type
97+
98+
# The company match for this benefit.
99+
sig do
100+
params(
101+
tiers: T::Array[T.any(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier, FinchAPI::Internal::AnyHash)],
102+
type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol
103+
)
104+
.returns(T.attached_class)
105+
end
106+
def self.new(tiers: nil, type: nil); end
107+
108+
sig do
109+
override
110+
.returns(
111+
{
112+
tiers: T::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier],
113+
type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type::OrSymbol
114+
}
115+
)
116+
end
117+
def to_hash; end
118+
119+
class Tier < FinchAPI::Internal::Type::BaseModel
120+
sig { returns(T.nilable(Integer)) }
121+
attr_reader :match
122+
123+
sig { params(match: Integer).void }
124+
attr_writer :match
125+
126+
sig { returns(T.nilable(Integer)) }
127+
attr_reader :threshold
128+
129+
sig { params(threshold: Integer).void }
130+
attr_writer :threshold
131+
132+
sig { params(match: Integer, threshold: Integer).returns(T.attached_class) }
133+
def self.new(match: nil, threshold: nil); end
134+
135+
sig { override.returns({match: Integer, threshold: Integer}) }
136+
def to_hash; end
137+
end
138+
139+
module Type
140+
extend FinchAPI::Internal::Type::Enum
141+
142+
TaggedSymbol =
143+
T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type) }
144+
OrSymbol = T.type_alias { T.any(Symbol, String) }
145+
146+
MATCH =
147+
T.let(:match, FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type::TaggedSymbol)
148+
149+
sig do
150+
override
151+
.returns(T::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Type::TaggedSymbol])
152+
end
153+
def self.values; end
154+
end
155+
end
59156
end
60157
end
61158
end

rbi/finch_api/models/hris/company_benefit.rbi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,22 @@ module FinchAPI
106106
def to_hash; end
107107

108108
class Tier < FinchAPI::Internal::Type::BaseModel
109-
sig { returns(T.nilable(Float)) }
109+
sig { returns(T.nilable(Integer)) }
110110
attr_reader :match
111111

112-
sig { params(match: Float).void }
112+
sig { params(match: Integer).void }
113113
attr_writer :match
114114

115-
sig { returns(T.nilable(Float)) }
115+
sig { returns(T.nilable(Integer)) }
116116
attr_reader :threshold
117117

118-
sig { params(threshold: Float).void }
118+
sig { params(threshold: Integer).void }
119119
attr_writer :threshold
120120

121-
sig { params(match: Float, threshold: Float).returns(T.attached_class) }
121+
sig { params(match: Integer, threshold: Integer).returns(T.attached_class) }
122122
def self.new(match: nil, threshold: nil); end
123123

124-
sig { override.returns({match: Float, threshold: Float}) }
124+
sig { override.returns({match: Integer, threshold: Integer}) }
125125
def to_hash; end
126126
end
127127

rbi/finch_api/resources/hris/benefits.rbi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ module FinchAPI
1111
# `/providers` endpoint to view available types for each provider.
1212
sig do
1313
params(
14+
company_contribution: T.nilable(
15+
T.any(FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution, FinchAPI::Internal::AnyHash)
16+
),
1417
description: String,
1518
frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol),
1619
type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol),
@@ -19,6 +22,8 @@ module FinchAPI
1922
.returns(FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse)
2023
end
2124
def create(
25+
# The company match for this benefit.
26+
company_contribution: nil,
2227
# Name of the benefit as it appears in the provider and pay statements. Recommend
2328
# limiting this to <30 characters due to limitations in specific providers (e.g.
2429
# Justworks).

sig/finch_api/models/hris/benefit_create_params.rbs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module FinchAPI
33
module HRIS
44
type benefit_create_params =
55
{
6+
company_contribution: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution?,
67
description: String,
78
frequency: FinchAPI::Models::HRIS::benefit_frequency?,
89
type: FinchAPI::Models::HRIS::benefit_type?
@@ -13,6 +14,8 @@ module FinchAPI
1314
extend FinchAPI::Internal::Type::RequestParameters::Converter
1415
include FinchAPI::Internal::Type::RequestParameters
1516

17+
attr_accessor company_contribution: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution?
18+
1619
attr_reader description: String?
1720

1821
def description=: (String) -> String
@@ -22,13 +25,67 @@ module FinchAPI
2225
attr_accessor type: FinchAPI::Models::HRIS::benefit_type?
2326

2427
def initialize: (
28+
?company_contribution: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution?,
2529
?description: String,
2630
?frequency: FinchAPI::Models::HRIS::benefit_frequency?,
2731
?type: FinchAPI::Models::HRIS::benefit_type?,
2832
?request_options: FinchAPI::request_opts
2933
) -> void
3034

3135
def to_hash: -> FinchAPI::Models::HRIS::benefit_create_params
36+
37+
type company_contribution =
38+
{
39+
tiers: ::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier],
40+
type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_
41+
}
42+
43+
class CompanyContribution < FinchAPI::Internal::Type::BaseModel
44+
attr_reader tiers: ::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier]?
45+
46+
def tiers=: (
47+
::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier]
48+
) -> ::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier]
49+
50+
attr_reader type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_?
51+
52+
def type=: (
53+
FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_
54+
) -> FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_
55+
56+
def initialize: (
57+
?tiers: ::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::Tier],
58+
?type: FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_
59+
) -> void
60+
61+
def to_hash: -> FinchAPI::Models::HRIS::BenefitCreateParams::company_contribution
62+
63+
type tier = { match: Integer, threshold: Integer }
64+
65+
class Tier < FinchAPI::Internal::Type::BaseModel
66+
attr_reader match: Integer?
67+
68+
def match=: (Integer) -> Integer
69+
70+
attr_reader threshold: Integer?
71+
72+
def threshold=: (Integer) -> Integer
73+
74+
def initialize: (?match: Integer, ?threshold: Integer) -> void
75+
76+
def to_hash: -> FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::tier
77+
end
78+
79+
type type_ = :match
80+
81+
module Type
82+
extend FinchAPI::Internal::Type::Enum
83+
84+
MATCH: :match
85+
86+
def self?.values: -> ::Array[FinchAPI::Models::HRIS::BenefitCreateParams::CompanyContribution::type_]
87+
end
88+
end
3289
end
3390
end
3491
end

0 commit comments

Comments
 (0)