finch-api 0.1.0.pre.alpha.27 → 0.1.0.pre.alpha.29

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.
@@ -5,28 +5,13 @@ module FinchAPI
5
5
  # @see FinchAPI::Resources::Account#introspect
6
6
  class Introspection < FinchAPI::Internal::Type::BaseModel
7
7
  # @!attribute id
8
- # The Finch UUID of the token being introspected.
8
+ # The Finch UUID of the token being introspected
9
9
  #
10
10
  # @return [String]
11
11
  required :id, String
12
12
 
13
- # @!attribute account_id
14
- # @deprecated
15
- #
16
- # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection
17
- # instead of this account ID.
18
- #
19
- # @return [String]
20
- required :account_id, String
21
-
22
- # @!attribute authentication_methods
23
- #
24
- # @return [Array<FinchAPI::Models::Introspection::AuthenticationMethod>]
25
- required :authentication_methods,
26
- -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Introspection::AuthenticationMethod] }
27
-
28
13
  # @!attribute client_id
29
- # The client ID of the application associated with the `access_token`.
14
+ # The client ID of the application associated with the `access_token`
30
15
  #
31
16
  # @return [String]
32
17
  required :client_id, String
@@ -37,17 +22,8 @@ module FinchAPI
37
22
  # @return [Symbol, FinchAPI::Models::Introspection::ClientType]
38
23
  required :client_type, enum: -> { FinchAPI::Introspection::ClientType }
39
24
 
40
- # @!attribute company_id
41
- # @deprecated
42
- #
43
- # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection
44
- # instead of this company ID.
45
- #
46
- # @return [String]
47
- required :company_id, String
48
-
49
25
  # @!attribute connection_id
50
- # The Finch UUID of the connection associated with the `access_token`.
26
+ # The Finch UUID of the connection associated with the `access_token`
51
27
  #
52
28
  # @return [String]
53
29
  required :connection_id, String
@@ -66,34 +42,82 @@ module FinchAPI
66
42
  # @return [Symbol, FinchAPI::Models::Introspection::ConnectionType]
67
43
  required :connection_type, enum: -> { FinchAPI::Introspection::ConnectionType }
68
44
 
45
+ # @!attribute products
46
+ # An array of the authorized products associated with the `access_token`.
47
+ #
48
+ # @return [Array<String>]
49
+ required :products, FinchAPI::Internal::Type::ArrayOf[String]
50
+
51
+ # @!attribute provider_id
52
+ # The ID of the provider associated with the `access_token`.
53
+ #
54
+ # @return [String]
55
+ required :provider_id, String
56
+
57
+ # @!attribute account_id
58
+ # @deprecated
59
+ #
60
+ # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection
61
+ # instead of this account ID
62
+ #
63
+ # @return [String, nil]
64
+ optional :account_id, String
65
+
66
+ # @!attribute authentication_methods
67
+ #
68
+ # @return [Array<FinchAPI::Models::Introspection::AuthenticationMethod>, nil]
69
+ optional :authentication_methods,
70
+ -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::Introspection::AuthenticationMethod] }
71
+
72
+ # @!attribute company_id
73
+ # @deprecated
74
+ #
75
+ # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection
76
+ # instead of this company ID
77
+ #
78
+ # @return [String, nil]
79
+ optional :company_id, String
80
+
69
81
  # @!attribute customer_email
70
82
  # The email of your customer you provided to Finch when a connect session was
71
- # created for this connection.
83
+ # created for this connection
72
84
  #
73
85
  # @return [String, nil]
74
- required :customer_email, String, nil?: true
86
+ optional :customer_email, String, nil?: true
75
87
 
76
88
  # @!attribute customer_id
77
89
  # The ID of your customer you provided to Finch when a connect session was created
78
- # for this connection.
90
+ # for this connection
79
91
  #
80
92
  # @return [String, nil]
81
- required :customer_id, String, nil?: true
93
+ optional :customer_id, String, nil?: true
82
94
 
83
95
  # @!attribute customer_name
84
96
  # The name of your customer you provided to Finch when a connect session was
85
- # created for this connection.
97
+ # created for this connection
86
98
  #
87
99
  # @return [String, nil]
88
- required :customer_name, String, nil?: true
100
+ optional :customer_name, String, nil?: true
101
+
102
+ # @!attribute entity_ids
103
+ # Array of entity IDs associated with this connection.
104
+ #
105
+ # @return [Array<String>, nil]
106
+ optional :entity_ids, FinchAPI::Internal::Type::ArrayOf[String]
107
+
108
+ # @!attribute entity_mode
109
+ # Indicates whether this connection manages a single entity or multiple entities.
110
+ #
111
+ # @return [Symbol, FinchAPI::Models::Introspection::EntityMode, nil]
112
+ optional :entity_mode, enum: -> { FinchAPI::Introspection::EntityMode }
89
113
 
90
114
  # @!attribute manual
91
115
  # Whether the connection associated with the `access_token` uses the Assisted
92
116
  # Connect Flow. (`true` if using Assisted Connect, `false` if connection is
93
117
  # automated)
94
118
  #
95
- # @return [Boolean]
96
- required :manual, FinchAPI::Internal::Type::Boolean
119
+ # @return [Boolean, nil]
120
+ optional :manual, FinchAPI::Internal::Type::Boolean
97
121
 
98
122
  # @!attribute payroll_provider_id
99
123
  # @deprecated
@@ -101,108 +125,155 @@ module FinchAPI
101
125
  # [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll
102
126
  # provider ID.
103
127
  #
104
- # @return [String]
105
- required :payroll_provider_id, String
106
-
107
- # @!attribute products
108
- # An array of the authorized products associated with the `access_token`.
109
- #
110
- # @return [Array<String>]
111
- required :products, FinchAPI::Internal::Type::ArrayOf[String]
112
-
113
- # @!attribute provider_id
114
- # The ID of the provider associated with the `access_token`.
115
- #
116
- # @return [String]
117
- required :provider_id, String
128
+ # @return [String, nil]
129
+ optional :payroll_provider_id, String
118
130
 
119
131
  # @!attribute username
120
132
  # The account username used for login associated with the `access_token`.
121
133
  #
122
- # @return [String]
123
- required :username, String
134
+ # @return [String, nil]
135
+ optional :username, String, nil?: true
124
136
 
125
- # @!method initialize(id:, account_id:, authentication_methods:, client_id:, client_type:, company_id:, connection_id:, connection_status:, connection_type:, customer_email:, customer_id:, customer_name:, manual:, payroll_provider_id:, products:, provider_id:, username:)
137
+ # @!method initialize(id:, client_id:, client_type:, connection_id:, connection_status:, connection_type:, products:, provider_id:, account_id: nil, authentication_methods: nil, company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, entity_ids: nil, entity_mode: nil, manual: nil, payroll_provider_id: nil, username: nil)
126
138
  # Some parameter documentations has been truncated, see
127
139
  # {FinchAPI::Models::Introspection} for more details.
128
140
  #
129
- # @param id [String] The Finch UUID of the token being introspected.
130
- #
131
- # @param account_id [String] [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection ins
141
+ # @param id [String] The Finch UUID of the token being introspected
132
142
  #
133
- # @param authentication_methods [Array<FinchAPI::Models::Introspection::AuthenticationMethod>]
134
- #
135
- # @param client_id [String] The client ID of the application associated with the `access_token`.
143
+ # @param client_id [String] The client ID of the application associated with the `access_token`
136
144
  #
137
145
  # @param client_type [Symbol, FinchAPI::Models::Introspection::ClientType] The type of application associated with a token.
138
146
  #
139
- # @param company_id [String] [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection ins
140
- #
141
- # @param connection_id [String] The Finch UUID of the connection associated with the `access_token`.
147
+ # @param connection_id [String] The Finch UUID of the connection associated with the `access_token`
142
148
  #
143
149
  # @param connection_status [FinchAPI::Models::Introspection::ConnectionStatus]
144
150
  #
145
151
  # @param connection_type [Symbol, FinchAPI::Models::Introspection::ConnectionType] The type of the connection associated with the token.
146
152
  #
153
+ # @param products [Array<String>] An array of the authorized products associated with the `access_token`.
154
+ #
155
+ # @param provider_id [String] The ID of the provider associated with the `access_token`.
156
+ #
157
+ # @param account_id [String] [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection ins
158
+ #
159
+ # @param authentication_methods [Array<FinchAPI::Models::Introspection::AuthenticationMethod>]
160
+ #
161
+ # @param company_id [String] [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection ins
162
+ #
147
163
  # @param customer_email [String, nil] The email of your customer you provided to Finch when a connect session was crea
148
164
  #
149
165
  # @param customer_id [String, nil] The ID of your customer you provided to Finch when a connect session was created
150
166
  #
151
167
  # @param customer_name [String, nil] The name of your customer you provided to Finch when a connect session was creat
152
168
  #
169
+ # @param entity_ids [Array<String>] Array of entity IDs associated with this connection.
170
+ #
171
+ # @param entity_mode [Symbol, FinchAPI::Models::Introspection::EntityMode] Indicates whether this connection manages a single entity or multiple entities.
172
+ #
153
173
  # @param manual [Boolean] Whether the connection associated with the `access_token` uses the Assisted Conn
154
174
  #
155
175
  # @param payroll_provider_id [String] [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll
156
176
  #
157
- # @param products [Array<String>] An array of the authorized products associated with the `access_token`.
177
+ # @param username [String, nil] The account username used for login associated with the `access_token`.
178
+
179
+ # The type of application associated with a token.
158
180
  #
159
- # @param provider_id [String] The ID of the provider associated with the `access_token`.
181
+ # @see FinchAPI::Models::Introspection#client_type
182
+ module ClientType
183
+ extend FinchAPI::Internal::Type::Enum
184
+
185
+ DEVELOPMENT = :development
186
+ PRODUCTION = :production
187
+ SANDBOX = :sandbox
188
+
189
+ # @!method self.values
190
+ # @return [Array<Symbol>]
191
+ end
192
+
193
+ # @see FinchAPI::Models::Introspection#connection_status
194
+ class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
195
+ # @!attribute status
196
+ #
197
+ # @return [Symbol, FinchAPI::Models::ConnectionStatusType]
198
+ required :status, enum: -> { FinchAPI::ConnectionStatusType }
199
+
200
+ # @!attribute last_successful_sync
201
+ # The datetime when the connection was last successfully synced
202
+ #
203
+ # @return [Time, String, nil]
204
+ optional :last_successful_sync,
205
+ union: -> { FinchAPI::Introspection::ConnectionStatus::LastSuccessfulSync },
206
+ nil?: true
207
+
208
+ # @!attribute message
209
+ #
210
+ # @return [String, nil]
211
+ optional :message, String
212
+
213
+ # @!method initialize(status:, last_successful_sync: nil, message: nil)
214
+ # @param status [Symbol, FinchAPI::Models::ConnectionStatusType]
215
+ #
216
+ # @param last_successful_sync [Time, String, nil] The datetime when the connection was last successfully synced
217
+ #
218
+ # @param message [String]
219
+
220
+ # The datetime when the connection was last successfully synced
221
+ #
222
+ # @see FinchAPI::Models::Introspection::ConnectionStatus#last_successful_sync
223
+ module LastSuccessfulSync
224
+ extend FinchAPI::Internal::Type::Union
225
+
226
+ variant Time
227
+
228
+ variant String
229
+
230
+ # @!method self.variants
231
+ # @return [Array(Time, String)]
232
+ end
233
+ end
234
+
235
+ # The type of the connection associated with the token.
236
+ #
237
+ # - `provider` - connection to an external provider
238
+ # - `finch` - finch-generated data.
160
239
  #
161
- # @param username [String] The account username used for login associated with the `access_token`.
240
+ # @see FinchAPI::Models::Introspection#connection_type
241
+ module ConnectionType
242
+ extend FinchAPI::Internal::Type::Enum
243
+
244
+ FINCH = :finch
245
+ PROVIDER = :provider
246
+
247
+ # @!method self.values
248
+ # @return [Array<Symbol>]
249
+ end
162
250
 
163
251
  class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel
252
+ # @!attribute type
253
+ # The type of authentication method
254
+ #
255
+ # @return [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type]
256
+ required :type, enum: -> { FinchAPI::Introspection::AuthenticationMethod::Type }
257
+
164
258
  # @!attribute connection_status
165
259
  #
166
260
  # @return [FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, nil]
167
261
  optional :connection_status, -> { FinchAPI::Introspection::AuthenticationMethod::ConnectionStatus }
168
262
 
169
263
  # @!attribute products
170
- # An array of the authorized products associated with the `access_token`.
264
+ # An array of the authorized products associated with the `access_token`
171
265
  #
172
266
  # @return [Array<String>, nil]
173
267
  optional :products, FinchAPI::Internal::Type::ArrayOf[String]
174
268
 
175
- # @!attribute type
176
- # The type of authentication method.
269
+ # @!method initialize(type:, connection_status: nil, products: nil)
270
+ # @param type [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type] The type of authentication method
177
271
  #
178
- # @return [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type, nil]
179
- optional :type, enum: -> { FinchAPI::Introspection::AuthenticationMethod::Type }
180
-
181
- # @!method initialize(connection_status: nil, products: nil, type: nil)
182
272
  # @param connection_status [FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus]
183
273
  #
184
- # @param products [Array<String>] An array of the authorized products associated with the `access_token`.
185
- #
186
- # @param type [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type] The type of authentication method.
274
+ # @param products [Array<String>] An array of the authorized products associated with the `access_token`
187
275
 
188
- # @see FinchAPI::Models::Introspection::AuthenticationMethod#connection_status
189
- class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
190
- # @!attribute message
191
- #
192
- # @return [String, nil]
193
- optional :message, String
194
-
195
- # @!attribute status
196
- #
197
- # @return [Symbol, FinchAPI::Models::ConnectionStatusType, nil]
198
- optional :status, enum: -> { FinchAPI::ConnectionStatusType }
199
-
200
- # @!method initialize(message: nil, status: nil)
201
- # @param message [String]
202
- # @param status [Symbol, FinchAPI::Models::ConnectionStatusType]
203
- end
204
-
205
- # The type of authentication method.
276
+ # The type of authentication method
206
277
  #
207
278
  # @see FinchAPI::Models::Introspection::AuthenticationMethod#type
208
279
  module Type
@@ -217,59 +288,60 @@ module FinchAPI
217
288
  # @!method self.values
218
289
  # @return [Array<Symbol>]
219
290
  end
220
- end
221
291
 
222
- # The type of application associated with a token.
223
- #
224
- # @see FinchAPI::Models::Introspection#client_type
225
- module ClientType
226
- extend FinchAPI::Internal::Type::Enum
292
+ # @see FinchAPI::Models::Introspection::AuthenticationMethod#connection_status
293
+ class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
294
+ # @!attribute status
295
+ #
296
+ # @return [Symbol, FinchAPI::Models::ConnectionStatusType]
297
+ required :status, enum: -> { FinchAPI::ConnectionStatusType }
227
298
 
228
- PRODUCTION = :production
229
- DEVELOPMENT = :development
230
- SANDBOX = :sandbox
299
+ # @!attribute last_successful_sync
300
+ # The datetime when the connection was last successfully synced
301
+ #
302
+ # @return [Time, String, nil]
303
+ optional :last_successful_sync,
304
+ union: -> {
305
+ FinchAPI::Introspection::AuthenticationMethod::ConnectionStatus::LastSuccessfulSync
306
+ },
307
+ nil?: true
231
308
 
232
- # @!method self.values
233
- # @return [Array<Symbol>]
234
- end
309
+ # @!attribute message
310
+ #
311
+ # @return [String, nil]
312
+ optional :message, String
235
313
 
236
- # @see FinchAPI::Models::Introspection#connection_status
237
- class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
238
- # @!attribute last_successful_sync
239
- # The datetime when the connection was last successfully synced.
240
- #
241
- # @return [Time, nil]
242
- optional :last_successful_sync, Time
314
+ # @!method initialize(status:, last_successful_sync: nil, message: nil)
315
+ # @param status [Symbol, FinchAPI::Models::ConnectionStatusType]
316
+ #
317
+ # @param last_successful_sync [Time, String, nil] The datetime when the connection was last successfully synced
318
+ #
319
+ # @param message [String]
243
320
 
244
- # @!attribute message
245
- #
246
- # @return [String, nil]
247
- optional :message, String
321
+ # The datetime when the connection was last successfully synced
322
+ #
323
+ # @see FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus#last_successful_sync
324
+ module LastSuccessfulSync
325
+ extend FinchAPI::Internal::Type::Union
248
326
 
249
- # @!attribute status
250
- #
251
- # @return [Symbol, FinchAPI::Models::ConnectionStatusType, nil]
252
- optional :status, enum: -> { FinchAPI::ConnectionStatusType }
327
+ variant Time
253
328
 
254
- # @!method initialize(last_successful_sync: nil, message: nil, status: nil)
255
- # @param last_successful_sync [Time] The datetime when the connection was last successfully synced.
256
- #
257
- # @param message [String]
258
- #
259
- # @param status [Symbol, FinchAPI::Models::ConnectionStatusType]
329
+ variant String
330
+
331
+ # @!method self.variants
332
+ # @return [Array(Time, String)]
333
+ end
334
+ end
260
335
  end
261
336
 
262
- # The type of the connection associated with the token.
337
+ # Indicates whether this connection manages a single entity or multiple entities.
263
338
  #
264
- # - `provider` - connection to an external provider
265
- # - `finch` - finch-generated data.
266
- #
267
- # @see FinchAPI::Models::Introspection#connection_type
268
- module ConnectionType
339
+ # @see FinchAPI::Models::Introspection#entity_mode
340
+ module EntityMode
269
341
  extend FinchAPI::Internal::Type::Enum
270
342
 
271
- PROVIDER = :provider
272
- FINCH = :finch
343
+ SINGLE = :single
344
+ MULTI = :multi
273
345
 
274
346
  # @!method self.values
275
347
  # @return [Array<Symbol>]
@@ -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.27"
4
+ VERSION = "0.1.0.pre.alpha.29"
5
5
  end
@@ -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
  }