finch-api 0.1.0.pre.alpha.26 → 0.1.0.pre.alpha.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/finch_api/internal/transport/pooled_net_requester.rb +1 -9
  5. data/lib/finch_api/internal/type/base_model.rb +1 -8
  6. data/lib/finch_api/internal/util.rb +1 -1
  7. data/lib/finch_api/models/access_token_create_params.rb +21 -13
  8. data/lib/finch_api/models/account_update_event.rb +28 -84
  9. data/lib/finch_api/models/create_access_token_response.rb +42 -42
  10. data/lib/finch_api/models/hris/benefit_create_params.rb +1 -3
  11. data/lib/finch_api/models/hris/benefits/individual_enroll_many_params.rb +6 -18
  12. data/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rb +3 -10
  13. data/lib/finch_api/models/hris/company/pay_statement_item_list_params.rb +1 -3
  14. data/lib/finch_api/models/hris/company_benefit.rb +1 -3
  15. data/lib/finch_api/models/hris/document_list_params.rb +1 -4
  16. data/lib/finch_api/models/hris/employment_retrieve_many_params.rb +1 -3
  17. data/lib/finch_api/models/hris/individual_retrieve_many_params.rb +1 -3
  18. data/lib/finch_api/models/hris/pay_statement.rb +1 -4
  19. data/lib/finch_api/models/hris/pay_statement_retrieve_many_params.rb +1 -3
  20. data/lib/finch_api/models/introspection.rb +180 -137
  21. data/lib/finch_api/models/provider.rb +19 -68
  22. data/lib/finch_api/models/sandbox/connection_create_params.rb +1 -4
  23. data/lib/finch_api/models/sandbox/directory_create_params.rb +1 -4
  24. data/lib/finch_api/models/sandbox/payment_create_params.rb +7 -22
  25. data/lib/finch_api/resources/access_tokens.rb +9 -5
  26. data/lib/finch_api/version.rb +1 -1
  27. data/rbi/finch_api/errors.rbi +2 -2
  28. data/rbi/finch_api/models/access_token_create_params.rbi +17 -15
  29. data/rbi/finch_api/models/create_access_token_response.rbi +54 -51
  30. data/rbi/finch_api/models/introspection.rbi +309 -236
  31. data/rbi/finch_api/resources/access_tokens.rbi +7 -3
  32. data/sig/finch_api/models/access_token_create_params.rbs +7 -11
  33. data/sig/finch_api/models/create_access_token_response.rbs +25 -23
  34. data/sig/finch_api/models/introspection.rbs +139 -117
  35. data/sig/finch_api/resources/access_tokens.rbs +2 -2
  36. metadata +2 -2
@@ -155,10 +155,7 @@ module FinchAPI
155
155
  # @!attribute pay_statement
156
156
  #
157
157
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, nil]
158
- optional :pay_statement,
159
- -> {
160
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement
161
- }
158
+ optional :pay_statement, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement }
162
159
 
163
160
  # @!attribute payment
164
161
  #
@@ -186,10 +183,7 @@ module FinchAPI
186
183
  # @!attribute accounts
187
184
  #
188
185
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, nil]
189
- optional :accounts,
190
- -> {
191
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Accounts
192
- }
186
+ optional :accounts, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Accounts }
193
187
 
194
188
  # @!attribute departments
195
189
  #
@@ -205,10 +199,7 @@ module FinchAPI
205
199
  # @!attribute entity
206
200
  #
207
201
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, nil]
208
- optional :entity,
209
- -> {
210
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Entity
211
- }
202
+ optional :entity, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Entity }
212
203
 
213
204
  # @!attribute legal_name
214
205
  #
@@ -218,10 +209,7 @@ module FinchAPI
218
209
  # @!attribute locations
219
210
  #
220
211
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, nil]
221
- optional :locations,
222
- -> {
223
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Locations
224
- }
212
+ optional :locations, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Locations }
225
213
 
226
214
  # @!attribute primary_email
227
215
  #
@@ -290,9 +278,7 @@ module FinchAPI
290
278
  #
291
279
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent, nil]
292
280
  optional :parent,
293
- -> {
294
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent
295
- }
281
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent }
296
282
 
297
283
  # @!method initialize(name: nil, parent: nil)
298
284
  # @param name [Boolean]
@@ -380,10 +366,7 @@ module FinchAPI
380
366
  # @!attribute paging
381
367
  #
382
368
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging, nil]
383
- optional :paging,
384
- -> {
385
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Directory::Paging
386
- }
369
+ optional :paging, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Directory::Paging }
387
370
 
388
371
  # @!method initialize(individuals: nil, paging: nil)
389
372
  # @param individuals [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals]
@@ -420,9 +403,7 @@ module FinchAPI
420
403
  #
421
404
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, nil]
422
405
  optional :manager,
423
- -> {
424
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager
425
- }
406
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager }
426
407
 
427
408
  # @!attribute middle_name
428
409
  #
@@ -515,10 +496,7 @@ module FinchAPI
515
496
  # @!attribute income
516
497
  #
517
498
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, nil]
518
- optional :income,
519
- -> {
520
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Employment::Income
521
- }
499
+ optional :income, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Employment::Income }
522
500
 
523
501
  # @!attribute income_history
524
502
  #
@@ -538,18 +516,12 @@ module FinchAPI
538
516
  # @!attribute location
539
517
  #
540
518
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, nil]
541
- optional :location,
542
- -> {
543
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Employment::Location
544
- }
519
+ optional :location, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Employment::Location }
545
520
 
546
521
  # @!attribute manager
547
522
  #
548
523
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, nil]
549
- optional :manager,
550
- -> {
551
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Employment::Manager
552
- }
524
+ optional :manager, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Employment::Manager }
553
525
 
554
526
  # @!attribute middle_name
555
527
  #
@@ -704,10 +676,7 @@ module FinchAPI
704
676
  # @!attribute emails
705
677
  #
706
678
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, nil]
707
- optional :emails,
708
- -> {
709
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Individual::Emails
710
- }
679
+ optional :emails, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Individual::Emails }
711
680
 
712
681
  # @!attribute encrypted_ssn
713
682
  #
@@ -743,9 +712,7 @@ module FinchAPI
743
712
  #
744
713
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, nil]
745
714
  optional :phone_numbers,
746
- -> {
747
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers
748
- }
715
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers }
749
716
 
750
717
  # @!attribute preferred_name
751
718
  #
@@ -888,18 +855,13 @@ module FinchAPI
888
855
  # @!attribute paging
889
856
  #
890
857
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, nil]
891
- optional :paging,
892
- -> {
893
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging
894
- }
858
+ optional :paging, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging }
895
859
 
896
860
  # @!attribute pay_statements
897
861
  #
898
862
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, nil]
899
863
  optional :pay_statements,
900
- -> {
901
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements
902
- }
864
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements }
903
865
 
904
866
  # @!method initialize(paging: nil, pay_statements: nil)
905
867
  # @param paging [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging]
@@ -928,25 +890,19 @@ module FinchAPI
928
890
  #
929
891
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, nil]
930
892
  optional :earnings,
931
- -> {
932
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings
933
- }
893
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings }
934
894
 
935
895
  # @!attribute employee_deductions
936
896
  #
937
897
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, nil]
938
898
  optional :employee_deductions,
939
- -> {
940
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions
941
- }
899
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions }
942
900
 
943
901
  # @!attribute employer_contributions
944
902
  #
945
903
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, nil]
946
904
  optional :employer_contributions,
947
- -> {
948
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions
949
- }
905
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions }
950
906
 
951
907
  # @!attribute gross_pay
952
908
  #
@@ -972,9 +928,7 @@ module FinchAPI
972
928
  #
973
929
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, nil]
974
930
  optional :taxes,
975
- -> {
976
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes
977
- }
931
+ -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes }
978
932
 
979
933
  # @!attribute total_hours
980
934
  #
@@ -1182,10 +1136,7 @@ module FinchAPI
1182
1136
  # @!attribute pay_period
1183
1137
  #
1184
1138
  # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod, nil]
1185
- optional :pay_period,
1186
- -> {
1187
- FinchAPI::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod
1188
- }
1139
+ optional :pay_period, -> { FinchAPI::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod }
1189
1140
 
1190
1141
  # @!method initialize(id: nil, company_debit: nil, debit_date: nil, employee_taxes: nil, employer_taxes: nil, gross_pay: nil, individual_ids: nil, net_pay: nil, pay_date: nil, pay_frequencies: nil, pay_group_ids: nil, pay_period: nil)
1191
1142
  # @param id [Boolean]
@@ -17,10 +17,7 @@ module FinchAPI
17
17
  # @!attribute authentication_type
18
18
  #
19
19
  # @return [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType, nil]
20
- optional :authentication_type,
21
- enum: -> {
22
- FinchAPI::Sandbox::ConnectionCreateParams::AuthenticationType
23
- }
20
+ optional :authentication_type, enum: -> { FinchAPI::Sandbox::ConnectionCreateParams::AuthenticationType }
24
21
 
25
22
  # @!attribute employee_size
26
23
  # Optional: the size of the employer to be created with this connection. Defaults
@@ -13,10 +13,7 @@ module FinchAPI
13
13
  # `/employment` endpoints. All fields are optional.
14
14
  #
15
15
  # @return [Array<FinchAPI::Models::Sandbox::DirectoryCreateParams::Body>, nil]
16
- optional :body,
17
- -> {
18
- FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::DirectoryCreateParams::Body]
19
- }
16
+ optional :body, -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::DirectoryCreateParams::Body] }
20
17
 
21
18
  # @!method initialize(body: nil, request_options: {})
22
19
  # Some parameter documentations has been truncated, see
@@ -18,9 +18,7 @@ module FinchAPI
18
18
  #
19
19
  # @return [Array<FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement>, nil]
20
20
  optional :pay_statements,
21
- -> {
22
- FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement]
23
- }
21
+ -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement] }
24
22
 
25
23
  # @!attribute start_date
26
24
  #
@@ -46,25 +44,19 @@ module FinchAPI
46
44
  #
47
45
  # @return [Array<FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning>, nil]
48
46
  optional :earnings,
49
- -> {
50
- FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::Earning]
51
- }
47
+ -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::Earning] }
52
48
 
53
49
  # @!attribute employee_deductions
54
50
  #
55
51
  # @return [Array<FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction>, nil]
56
52
  optional :employee_deductions,
57
- -> {
58
- FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction]
59
- }
53
+ -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction] }
60
54
 
61
55
  # @!attribute employer_contributions
62
56
  #
63
57
  # @return [Array<FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution>, nil]
64
58
  optional :employer_contributions,
65
- -> {
66
- FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution]
67
- }
59
+ -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution] }
68
60
 
69
61
  # @!attribute gross_pay
70
62
  #
@@ -87,9 +79,7 @@ module FinchAPI
87
79
  #
88
80
  # @return [Array<FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax>, nil]
89
81
  optional :taxes,
90
- -> {
91
- FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::Tax]
92
- }
82
+ -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::PaymentCreateParams::PayStatement::Tax] }
93
83
 
94
84
  # @!attribute total_hours
95
85
  #
@@ -182,10 +172,7 @@ module FinchAPI
182
172
  # @!attribute type
183
173
  #
184
174
  # @return [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Type, nil]
185
- optional :type,
186
- enum: -> {
187
- FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Type
188
- }
175
+ optional :type, enum: -> { FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Type }
189
176
 
190
177
  # @!method initialize(amount: nil, name: nil, pre_tax: nil, type: nil)
191
178
  # @param amount [Integer]
@@ -237,9 +224,7 @@ module FinchAPI
237
224
  #
238
225
  # @return [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Type, nil]
239
226
  optional :type,
240
- enum: -> {
241
- FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Type
242
- }
227
+ enum: -> { FinchAPI::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Type }
243
228
 
244
229
  # @!method initialize(amount: nil, name: nil, type: nil)
245
230
  # @param amount [Integer]
@@ -5,12 +5,16 @@ module FinchAPI
5
5
  class AccessTokens
6
6
  # Exchange the authorization code for an access token
7
7
  #
8
- # @overload create(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {})
8
+ # @overload create(client_id:, client_secret:, code:, redirect_uri: nil, request_options: {})
9
+ #
10
+ # @param client_id [String] The client ID for your application
11
+ #
12
+ # @param client_secret [String] The client secret for your application
13
+ #
14
+ # @param code [String] The authorization code received from the authorization server
15
+ #
16
+ # @param redirect_uri [String] The redirect URI used in the authorization request (optional)
9
17
  #
10
- # @param code [String]
11
- # @param client_id [String]
12
- # @param client_secret [String]
13
- # @param redirect_uri [String]
14
18
  # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil]
15
19
  #
16
20
  # @return [FinchAPI::Models::CreateAccessTokenResponse]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinchAPI
4
- VERSION = "0.1.0.pre.alpha.26"
4
+ VERSION = "0.1.0.pre.alpha.28"
5
5
  end
@@ -59,10 +59,10 @@ module FinchAPI
59
59
  end
60
60
 
61
61
  class APIConnectionError < FinchAPI::Errors::APIError
62
- sig { void }
62
+ sig { returns(NilClass) }
63
63
  attr_accessor :status
64
64
 
65
- sig { void }
65
+ sig { returns(NilClass) }
66
66
  attr_accessor :body
67
67
 
68
68
  # @api private
@@ -11,21 +11,19 @@ module FinchAPI
11
11
  T.any(FinchAPI::AccessTokenCreateParams, FinchAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The client ID for your application
14
15
  sig { returns(String) }
15
- attr_accessor :code
16
-
17
- sig { returns(T.nilable(String)) }
18
- attr_reader :client_id
16
+ attr_accessor :client_id
19
17
 
20
- sig { params(client_id: String).void }
21
- attr_writer :client_id
22
-
23
- sig { returns(T.nilable(String)) }
24
- attr_reader :client_secret
18
+ # The client secret for your application
19
+ sig { returns(String) }
20
+ attr_accessor :client_secret
25
21
 
26
- sig { params(client_secret: String).void }
27
- attr_writer :client_secret
22
+ # The authorization code received from the authorization server
23
+ sig { returns(String) }
24
+ attr_accessor :code
28
25
 
26
+ # The redirect URI used in the authorization request (optional)
29
27
  sig { returns(T.nilable(String)) }
30
28
  attr_reader :redirect_uri
31
29
 
@@ -34,17 +32,21 @@ module FinchAPI
34
32
 
35
33
  sig do
36
34
  params(
37
- code: String,
38
35
  client_id: String,
39
36
  client_secret: String,
37
+ code: String,
40
38
  redirect_uri: String,
41
39
  request_options: FinchAPI::RequestOptions::OrHash
42
40
  ).returns(T.attached_class)
43
41
  end
44
42
  def self.new(
43
+ # The client ID for your application
44
+ client_id:,
45
+ # The client secret for your application
46
+ client_secret:,
47
+ # The authorization code received from the authorization server
45
48
  code:,
46
- client_id: nil,
47
- client_secret: nil,
49
+ # The redirect URI used in the authorization request (optional)
48
50
  redirect_uri: nil,
49
51
  request_options: {}
50
52
  )
@@ -53,9 +55,9 @@ module FinchAPI
53
55
  sig do
54
56
  override.returns(
55
57
  {
56
- code: String,
57
58
  client_id: String,
58
59
  client_secret: String,
60
+ code: String,
59
61
  redirect_uri: String,
60
62
  request_options: FinchAPI::RequestOptions
61
63
  }
@@ -11,27 +11,17 @@ module FinchAPI
11
11
  )
12
12
  end
13
13
 
14
- # The access token for the connection.
14
+ # The access token for the connection
15
15
  sig { returns(String) }
16
16
  attr_accessor :access_token
17
17
 
18
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
19
- # account ID.
20
- sig { returns(String) }
21
- attr_accessor :account_id
22
-
23
18
  # The type of application associated with a token.
24
19
  sig do
25
20
  returns(FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol)
26
21
  end
27
22
  attr_accessor :client_type
28
23
 
29
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
30
- # company ID.
31
- sig { returns(String) }
32
- attr_accessor :company_id
33
-
34
- # The Finch UUID of the connection associated with the `access_token`.
24
+ # The Finch UUID of the connection associated with the `access_token`
35
25
  sig { returns(String) }
36
26
  attr_accessor :connection_id
37
27
 
@@ -46,69 +36,82 @@ module FinchAPI
46
36
  end
47
37
  attr_accessor :connection_type
48
38
 
49
- # An array of the authorized products associated with the `access_token`.
39
+ # An array of the authorized products associated with the `access_token`
50
40
  sig { returns(T::Array[String]) }
51
41
  attr_accessor :products
52
42
 
53
- # The ID of the provider associated with the `access_token`.
43
+ # The ID of the provider associated with the `access_token`
54
44
  sig { returns(String) }
55
45
  attr_accessor :provider_id
56
46
 
57
- # The ID of your customer you provided to Finch when a connect session was created
58
- # for this connection.
47
+ # The RFC 8693 token type (Finch uses `bearer` tokens)
48
+ sig { returns(String) }
49
+ attr_accessor :token_type
50
+
51
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
52
+ # account ID
59
53
  sig { returns(T.nilable(String)) }
60
- attr_accessor :customer_id
54
+ attr_reader :account_id
61
55
 
62
- # The RFC 8693 token type (Finch uses `bearer` tokens)
56
+ sig { params(account_id: String).void }
57
+ attr_writer :account_id
58
+
59
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
60
+ # company ID
63
61
  sig { returns(T.nilable(String)) }
64
- attr_reader :token_type
62
+ attr_reader :company_id
63
+
64
+ sig { params(company_id: String).void }
65
+ attr_writer :company_id
65
66
 
66
- sig { params(token_type: String).void }
67
- attr_writer :token_type
67
+ # The ID of your customer you provided to Finch when a connect session was created
68
+ # for this connection
69
+ sig { returns(T.nilable(String)) }
70
+ attr_accessor :customer_id
68
71
 
69
72
  sig do
70
73
  params(
71
74
  access_token: String,
72
- account_id: String,
73
75
  client_type:
74
76
  FinchAPI::CreateAccessTokenResponse::ClientType::OrSymbol,
75
- company_id: String,
76
77
  connection_id: String,
77
78
  connection_type:
78
79
  FinchAPI::CreateAccessTokenResponse::ConnectionType::OrSymbol,
79
80
  products: T::Array[String],
80
81
  provider_id: String,
81
- customer_id: T.nilable(String),
82
- token_type: String
82
+ token_type: String,
83
+ account_id: String,
84
+ company_id: String,
85
+ customer_id: T.nilable(String)
83
86
  ).returns(T.attached_class)
84
87
  end
85
88
  def self.new(
86
- # The access token for the connection.
89
+ # The access token for the connection
87
90
  access_token:,
88
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
89
- # account ID.
90
- account_id:,
91
91
  # The type of application associated with a token.
92
92
  client_type:,
93
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
94
- # company ID.
95
- company_id:,
96
- # The Finch UUID of the connection associated with the `access_token`.
93
+ # The Finch UUID of the connection associated with the `access_token`
97
94
  connection_id:,
98
95
  # The type of the connection associated with the token.
99
96
  #
100
97
  # - `provider` - connection to an external provider
101
98
  # - `finch` - finch-generated data.
102
99
  connection_type:,
103
- # An array of the authorized products associated with the `access_token`.
100
+ # An array of the authorized products associated with the `access_token`
104
101
  products:,
105
- # The ID of the provider associated with the `access_token`.
102
+ # The ID of the provider associated with the `access_token`
106
103
  provider_id:,
107
- # The ID of your customer you provided to Finch when a connect session was created
108
- # for this connection.
109
- customer_id: nil,
110
104
  # The RFC 8693 token type (Finch uses `bearer` tokens)
111
- token_type: nil
105
+ token_type:,
106
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
107
+ # account ID
108
+ account_id: nil,
109
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
110
+ # company ID
111
+ company_id: nil,
112
+ # The ID of your customer you provided to Finch when a connect session was created
113
+ # for this connection
114
+ customer_id: nil
112
115
  )
113
116
  end
114
117
 
@@ -116,17 +119,17 @@ module FinchAPI
116
119
  override.returns(
117
120
  {
118
121
  access_token: String,
119
- account_id: String,
120
122
  client_type:
121
123
  FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol,
122
- company_id: String,
123
124
  connection_id: String,
124
125
  connection_type:
125
126
  FinchAPI::CreateAccessTokenResponse::ConnectionType::TaggedSymbol,
126
127
  products: T::Array[String],
127
128
  provider_id: String,
128
- customer_id: T.nilable(String),
129
- token_type: String
129
+ token_type: String,
130
+ account_id: String,
131
+ company_id: String,
132
+ customer_id: T.nilable(String)
130
133
  }
131
134
  )
132
135
  end
@@ -143,14 +146,14 @@ module FinchAPI
143
146
  end
144
147
  OrSymbol = T.type_alias { T.any(Symbol, String) }
145
148
 
146
- PRODUCTION =
149
+ DEVELOPMENT =
147
150
  T.let(
148
- :production,
151
+ :development,
149
152
  FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol
150
153
  )
151
- DEVELOPMENT =
154
+ PRODUCTION =
152
155
  T.let(
153
- :development,
156
+ :production,
154
157
  FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol
155
158
  )
156
159
  SANDBOX =
@@ -183,14 +186,14 @@ module FinchAPI
183
186
  end
184
187
  OrSymbol = T.type_alias { T.any(Symbol, String) }
185
188
 
186
- PROVIDER =
189
+ FINCH =
187
190
  T.let(
188
- :provider,
191
+ :finch,
189
192
  FinchAPI::CreateAccessTokenResponse::ConnectionType::TaggedSymbol
190
193
  )
191
- FINCH =
194
+ PROVIDER =
192
195
  T.let(
193
- :finch,
196
+ :provider,
194
197
  FinchAPI::CreateAccessTokenResponse::ConnectionType::TaggedSymbol
195
198
  )
196
199