Skip to content

Commit 66b8a64

Browse files
feat(api): api update
1 parent b7c6223 commit 66b8a64

22 files changed

+948
-5145
lines changed

.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-1066fa342808844922c79f57fea5676ba822a7ff57f2143efa70bbadf5ed6428.yml
3-
openapi_spec_hash: 794703adc5978c044203ee5b1a9eb4f0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-fd18483a409117a70113398a50c7ff8bde92455d830e8027f2c2e3cc7a9c67ac.yml
3+
openapi_spec_hash: cb88f02495e1cfd2d73d2f9e3728205d
44
config_hash: 6d3585c0032e08d723d077d660fc8448

lib/finch_api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
require_relative "finch_api/models/pay_statement_event"
155155
require_relative "finch_api/models/provider"
156156
require_relative "finch_api/models/provider_list_params"
157+
require_relative "finch_api/models/provider_list_response"
157158
require_relative "finch_api/models/request_forwarding_forward_params"
158159
require_relative "finch_api/models/request_forwarding_forward_response"
159160
require_relative "finch_api/models/sandbox/company_update_params"

lib/finch_api/models/provider.rb

Lines changed: 42 additions & 1092 deletions
Large diffs are not rendered by default.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# frozen_string_literal: true
2+
3+
module FinchAPI
4+
module Models
5+
# @see FinchAPI::Resources::Providers#list
6+
class ProviderListResponse < FinchAPI::Internal::Type::BaseModel
7+
# @!attribute id
8+
# The id of the payroll provider used in Connect.
9+
#
10+
# @return [String]
11+
required :id, String
12+
13+
# @!attribute display_name
14+
# The display name of the payroll provider.
15+
#
16+
# @return [String]
17+
required :display_name, String
18+
19+
# @!attribute products
20+
# The list of Finch products supported on this payroll provider.
21+
#
22+
# @return [Array<String>]
23+
required :products, FinchAPI::Internal::Type::ArrayOf[String]
24+
25+
# @!attribute authentication_methods
26+
# The authentication methods supported by the provider.
27+
#
28+
# @return [Array<FinchAPI::Models::ProviderListResponse::AuthenticationMethod>, nil]
29+
optional :authentication_methods,
30+
-> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Models::ProviderListResponse::AuthenticationMethod] }
31+
32+
# @!attribute beta
33+
# `true` if the integration is in a beta state, `false` otherwise
34+
#
35+
# @return [Boolean, nil]
36+
optional :beta, FinchAPI::Internal::Type::Boolean
37+
38+
# @!attribute icon
39+
# The url to the official icon of the payroll provider.
40+
#
41+
# @return [String, nil]
42+
optional :icon, String
43+
44+
# @!attribute logo
45+
# The url to the official logo of the payroll provider.
46+
#
47+
# @return [String, nil]
48+
optional :logo, String
49+
50+
# @!attribute manual
51+
# @deprecated
52+
#
53+
# [DEPRECATED] Whether the Finch integration with this provider uses the Assisted
54+
# Connect Flow by default. This field is now deprecated. Please check for a `type`
55+
# of `assisted` in the `authentication_methods` field instead.
56+
#
57+
# @return [Boolean, nil]
58+
optional :manual, FinchAPI::Internal::Type::Boolean
59+
60+
# @!attribute mfa_required
61+
# whether MFA is required for the provider.
62+
#
63+
# @return [Boolean, nil]
64+
optional :mfa_required, FinchAPI::Internal::Type::Boolean
65+
66+
# @!attribute primary_color
67+
# The hex code for the primary color of the payroll provider.
68+
#
69+
# @return [String, nil]
70+
optional :primary_color, String
71+
72+
# @!method initialize(id:, display_name:, products:, authentication_methods: nil, beta: nil, icon: nil, logo: nil, manual: nil, mfa_required: nil, primary_color: nil)
73+
# Some parameter documentations has been truncated, see
74+
# {FinchAPI::Models::ProviderListResponse} for more details.
75+
#
76+
# @param id [String] The id of the payroll provider used in Connect.
77+
#
78+
# @param display_name [String] The display name of the payroll provider.
79+
#
80+
# @param products [Array<String>] The list of Finch products supported on this payroll provider.
81+
#
82+
# @param authentication_methods [Array<FinchAPI::Models::ProviderListResponse::AuthenticationMethod>] The authentication methods supported by the provider.
83+
#
84+
# @param beta [Boolean] `true` if the integration is in a beta state, `false` otherwise
85+
#
86+
# @param icon [String] The url to the official icon of the payroll provider.
87+
#
88+
# @param logo [String] The url to the official logo of the payroll provider.
89+
#
90+
# @param manual [Boolean] [DEPRECATED] Whether the Finch integration with this provider uses the Assisted
91+
#
92+
# @param mfa_required [Boolean] whether MFA is required for the provider.
93+
#
94+
# @param primary_color [String] The hex code for the primary color of the payroll provider.
95+
96+
class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel
97+
# @!attribute type
98+
# The type of authentication method
99+
#
100+
# @return [Symbol, FinchAPI::Models::ProviderListResponse::AuthenticationMethod::Type]
101+
required :type, enum: -> { FinchAPI::Models::ProviderListResponse::AuthenticationMethod::Type }
102+
103+
# @!attribute benefits_support
104+
# The supported benefit types and their configurations
105+
#
106+
# @return [Hash{Symbol=>Object, nil}, nil]
107+
optional :benefits_support,
108+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true]
109+
110+
# @!attribute supported_fields
111+
# The supported fields for each Finch product
112+
#
113+
# @return [Hash{Symbol=>Object, nil}, nil]
114+
optional :supported_fields,
115+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true]
116+
117+
# @!method initialize(type:, benefits_support: nil, supported_fields: nil)
118+
# @param type [Symbol, FinchAPI::Models::ProviderListResponse::AuthenticationMethod::Type] The type of authentication method
119+
#
120+
# @param benefits_support [Hash{Symbol=>Object, nil}] The supported benefit types and their configurations
121+
#
122+
# @param supported_fields [Hash{Symbol=>Object, nil}] The supported fields for each Finch product
123+
124+
# The type of authentication method
125+
#
126+
# @see FinchAPI::Models::ProviderListResponse::AuthenticationMethod#type
127+
module Type
128+
extend FinchAPI::Internal::Type::Enum
129+
130+
ASSISTED = :assisted
131+
CREDENTIAL = :credential
132+
API_TOKEN = :api_token
133+
API_CREDENTIAL = :api_credential
134+
OAUTH = :oauth
135+
API = :api
136+
137+
# @!method self.values
138+
# @return [Array<Symbol>]
139+
end
140+
end
141+
end
142+
end
143+
end

lib/finch_api/models/request_forwarding_forward_params.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ class RequestForwardingForwardParams < FinchAPI::Internal::Type::BaseModel
3434
# specified as an object of key-value pairs. Example:
3535
# `{"Content-Type": "application/xml", "X-API-Version": "v1" }`
3636
#
37-
# @return [Object, nil]
38-
optional :headers, FinchAPI::Internal::Type::Unknown, nil?: true
37+
# @return [Hash{Symbol=>Object, nil}, nil]
38+
optional :headers,
39+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true],
40+
nil?: true
3941

4042
# @!attribute params
4143
# The query parameters for the forwarded request. This value must be specified as
4244
# a valid JSON object rather than a query string.
4345
#
44-
# @return [Object, nil]
45-
optional :params, FinchAPI::Internal::Type::Unknown, nil?: true
46+
# @return [Hash{Symbol=>Object, nil}, nil]
47+
optional :params,
48+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true],
49+
nil?: true
4650

4751
# @!method initialize(method_:, route:, data: nil, headers: nil, params: nil, request_options: {})
4852
# Some parameter documentations has been truncated, see
@@ -54,9 +58,9 @@ class RequestForwardingForwardParams < FinchAPI::Internal::Type::BaseModel
5458
#
5559
# @param data [String, nil] The body for the forwarded request. This value must be specified as either a str
5660
#
57-
# @param headers [Object, nil] The HTTP headers to include on the forwarded request. This value must be specifi
61+
# @param headers [Hash{Symbol=>Object, nil}, nil] The HTTP headers to include on the forwarded request. This value must be specifi
5862
#
59-
# @param params [Object, nil] The query parameters for the forwarded request. This value must be specified as
63+
# @param params [Hash{Symbol=>Object, nil}, nil] The query parameters for the forwarded request. This value must be specified as
6064
#
6165
# @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}]
6266
end

lib/finch_api/models/request_forwarding_forward_response.rb

Lines changed: 69 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ module FinchAPI
44
module Models
55
# @see FinchAPI::Resources::RequestForwarding#forward
66
class RequestForwardingForwardResponse < FinchAPI::Internal::Type::BaseModel
7-
# @!attribute data
8-
# A string representation of the HTTP response body of the forwarded request's
9-
# response received from the underlying integration's API. This field may be null
10-
# in the case where the upstream system's response is empty.
11-
#
12-
# @return [String, nil]
13-
required :data, String, nil?: true
14-
15-
# @!attribute headers
16-
# The HTTP headers of the forwarded request's response, exactly as received from
17-
# the underlying integration's API.
18-
#
19-
# @return [Object, nil]
20-
required :headers, FinchAPI::Internal::Type::Unknown, nil?: true
21-
227
# @!attribute request
238
# An object containing details of your original forwarded request, for your ease
249
# of reference.
@@ -33,71 +18,107 @@ class RequestForwardingForwardResponse < FinchAPI::Internal::Type::BaseModel
3318
# @return [Integer]
3419
required :status_code, Integer, api_name: :statusCode
3520

36-
# @!method initialize(data:, headers:, request:, status_code:)
37-
# Some parameter documentations has been truncated, see
38-
# {FinchAPI::Models::RequestForwardingForwardResponse} for more details.
21+
# @!attribute data
22+
# A string representation of the HTTP response body of the forwarded request's
23+
# response received from the underlying integration's API. This field may be null
24+
# in the case where the upstream system's response is empty.
3925
#
40-
# @param data [String, nil] A string representation of the HTTP response body of the forwarded request's res
26+
# @return [String, nil]
27+
optional :data, String, nil?: true
28+
29+
# @!attribute headers
30+
# The HTTP headers of the forwarded request's response, exactly as received from
31+
# the underlying integration's API.
4132
#
42-
# @param headers [Object, nil] The HTTP headers of the forwarded request's response, exactly as received from t
33+
# @return [Hash{Symbol=>Object, nil}, nil]
34+
optional :headers,
35+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true],
36+
nil?: true
37+
38+
# @!method initialize(request:, status_code:, data: nil, headers: nil)
39+
# Some parameter documentations has been truncated, see
40+
# {FinchAPI::Models::RequestForwardingForwardResponse} for more details.
4341
#
4442
# @param request [FinchAPI::Models::RequestForwardingForwardResponse::Request] An object containing details of your original forwarded request, for your ease o
4543
#
4644
# @param status_code [Integer] The HTTP status code of the forwarded request's response, exactly received from
45+
#
46+
# @param data [String, nil] A string representation of the HTTP response body of the forwarded request's res
47+
#
48+
# @param headers [Hash{Symbol=>Object, nil}, nil] The HTTP headers of the forwarded request's response, exactly as received from t
4749

4850
# @see FinchAPI::Models::RequestForwardingForwardResponse#request
4951
class Request < FinchAPI::Internal::Type::BaseModel
50-
# @!attribute data
51-
# The body that was specified for the forwarded request. If a value was not
52-
# specified in the original request, this value will be returned as null ;
53-
# otherwise, this value will always be returned as a string.
54-
#
55-
# @return [String, nil]
56-
required :data, String, nil?: true
57-
58-
# @!attribute headers
59-
# The specified HTTP headers that were included in the forwarded request. If no
60-
# headers were specified, this will be returned as `null`.
61-
#
62-
# @return [Object, nil]
63-
required :headers, FinchAPI::Internal::Type::Unknown, nil?: true
64-
6552
# @!attribute method_
6653
# The HTTP method that was specified for the forwarded request. Valid values
6754
# include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`.
6855
#
6956
# @return [String]
7057
required :method_, String, api_name: :method
7158

72-
# @!attribute params
73-
# The query parameters that were included in the forwarded request. If no query
74-
# parameters were specified, this will be returned as `null`.
75-
#
76-
# @return [Object, nil]
77-
required :params, FinchAPI::Internal::Type::Unknown, nil?: true
78-
7959
# @!attribute route
8060
# The URL route path that was specified for the forwarded request.
8161
#
8262
# @return [String]
8363
required :route, String
8464

85-
# @!method initialize(data:, headers:, method_:, params:, route:)
65+
# @!attribute data
66+
# The body that was specified for the forwarded request.
67+
#
68+
# @return [String, Hash{Symbol=>Object, nil}, nil]
69+
optional :data,
70+
union: -> { FinchAPI::Models::RequestForwardingForwardResponse::Request::Data },
71+
nil?: true
72+
73+
# @!attribute headers
74+
# The HTTP headers that were specified for the forwarded request.
75+
#
76+
# @return [Hash{Symbol=>Object, nil}, nil]
77+
optional :headers,
78+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true],
79+
nil?: true
80+
81+
# @!attribute params
82+
# The query parameters that were specified for the forwarded request.
83+
#
84+
# @return [Hash{Symbol=>Object, nil}, nil]
85+
optional :params,
86+
FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true],
87+
nil?: true
88+
89+
# @!method initialize(method_:, route:, data: nil, headers: nil, params: nil)
8690
# Some parameter documentations has been truncated, see
8791
# {FinchAPI::Models::RequestForwardingForwardResponse::Request} for more details.
8892
#
8993
# An object containing details of your original forwarded request, for your ease
9094
# of reference.
9195
#
92-
# @param data [String, nil] The body that was specified for the forwarded request. If a value was not specif
96+
# @param method_ [String] The HTTP method that was specified for the forwarded request. Valid values inclu
9397
#
94-
# @param headers [Object, nil] The specified HTTP headers that were included in the forwarded request. If no he
98+
# @param route [String] The URL route path that was specified for the forwarded request.
9599
#
96-
# @param method_ [String] The HTTP method that was specified for the forwarded request. Valid values inclu
100+
# @param data [String, Hash{Symbol=>Object, nil}, nil] The body that was specified for the forwarded request.
97101
#
98-
# @param params [Object, nil] The query parameters that were included in the forwarded request. If no query pa
102+
# @param headers [Hash{Symbol=>Object, nil}, nil] The HTTP headers that were specified for the forwarded request.
99103
#
100-
# @param route [String] The URL route path that was specified for the forwarded request.
104+
# @param params [Hash{Symbol=>Object, nil}, nil] The query parameters that were specified for the forwarded request.
105+
106+
# The body that was specified for the forwarded request.
107+
#
108+
# @see FinchAPI::Models::RequestForwardingForwardResponse::Request#data
109+
module Data
110+
extend FinchAPI::Internal::Type::Union
111+
112+
variant String
113+
114+
variant -> { FinchAPI::Models::RequestForwardingForwardResponse::Request::Data::UnionMember1Map }
115+
116+
# @!method self.variants
117+
# @return [Array(String, Hash{Symbol=>Object, nil})]
118+
119+
# @type [FinchAPI::Internal::Type::Converter]
120+
UnionMember1Map = FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true]
121+
end
101122
end
102123
end
103124
end

lib/finch_api/resources/providers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ class Providers
99
#
1010
# @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil]
1111
#
12-
# @return [FinchAPI::Internal::SinglePage<FinchAPI::Models::Provider>]
12+
# @return [FinchAPI::Internal::SinglePage<FinchAPI::Models::ProviderListResponse>]
1313
#
1414
# @see FinchAPI::Models::ProviderListParams
1515
def list(params = {})
1616
@client.request(
1717
method: :get,
1818
path: "providers",
1919
page: FinchAPI::Internal::SinglePage,
20-
model: FinchAPI::Provider,
20+
model: FinchAPI::Models::ProviderListResponse,
2121
options: params[:request_options]
2222
)
2323
end

lib/finch_api/resources/request_forwarding.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class RequestForwarding
1919
#
2020
# @param data [String, nil] The body for the forwarded request. This value must be specified as either a str
2121
#
22-
# @param headers [Object, nil] The HTTP headers to include on the forwarded request. This value must be specifi
22+
# @param headers [Hash{Symbol=>Object, nil}, nil] The HTTP headers to include on the forwarded request. This value must be specifi
2323
#
24-
# @param params [Object, nil] The query parameters for the forwarded request. This value must be specified as
24+
# @param params [Hash{Symbol=>Object, nil}, nil] The query parameters for the forwarded request. This value must be specified as
2525
#
2626
# @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil]
2727
#

0 commit comments

Comments
 (0)