@@ -56,7 +56,6 @@ class Finch(SyncAPIClient):
56
56
hris : resources .HRIS
57
57
providers : resources .Providers
58
58
account : resources .Account
59
- webhooks : resources .Webhooks
60
59
request_forwarding : resources .RequestForwarding
61
60
jobs : resources .Jobs
62
61
sandbox : resources .Sandbox
@@ -157,7 +156,6 @@ def __init__(
157
156
self .hris = resources .HRIS (self )
158
157
self .providers = resources .Providers (self )
159
158
self .account = resources .Account (self )
160
- self .webhooks = resources .Webhooks (self )
161
159
self .request_forwarding = resources .RequestForwarding (self )
162
160
self .jobs = resources .Jobs (self )
163
161
self .sandbox = resources .Sandbox (self )
@@ -301,70 +299,6 @@ def copy(
301
299
# client.with_options(timeout=10).foo.create(...)
302
300
with_options = copy
303
301
304
- def get_access_token (
305
- self ,
306
- code : str ,
307
- * ,
308
- redirect_uri : str | None = None ,
309
- ) -> str :
310
- """DEPRECATED: use client.access_tokens.create instead."""
311
- if self .client_id is None :
312
- raise ValueError ("Expected client_id to be set in order to call get_access_token" )
313
-
314
- if self .client_secret is None :
315
- raise ValueError ("Expected client_secret to be set in order to call get_access_token" )
316
-
317
- response = self .post (
318
- "/auth/token" ,
319
- body = {
320
- "client_id" : self .client_id ,
321
- "client_secret" : self .client_secret ,
322
- "code" : code ,
323
- "redirect_uri" : redirect_uri ,
324
- },
325
- options = {"headers" : {"Authorization" : Omit ()}},
326
- cast_to = httpx .Response ,
327
- )
328
- data = response .json ()
329
- return str (data ["access_token" ])
330
-
331
- def get_auth_url (
332
- self ,
333
- * ,
334
- products : str ,
335
- redirect_uri : str ,
336
- sandbox : bool ,
337
- ) -> str :
338
- """
339
- Returns the authorization url which can be visited in order to obtain an
340
- authorization code from Finch. The authorization code can then be exchanged for
341
- an access token for the Finch api by calling get_access_token().
342
- """
343
- if self .client_id is None :
344
- raise ValueError ("Expected the client_id to be set in order to call get_auth_url" )
345
-
346
- return str (
347
- httpx .URL (
348
- "https://connect.tryfinch.com/authorize" ,
349
- params = {
350
- "client_id" : self .client_id ,
351
- "products" : products ,
352
- "redirect_uri" : redirect_uri ,
353
- "sandbox" : sandbox ,
354
- },
355
- )
356
- )
357
-
358
- def with_access_token (
359
- self ,
360
- access_token : str ,
361
- ) -> Self :
362
- """
363
- Returns a copy of the current Finch client with the given access token for
364
- authentication.
365
- """
366
- return self .with_options (access_token = access_token )
367
-
368
302
@override
369
303
def _make_status_error (
370
304
self ,
@@ -404,7 +338,6 @@ class AsyncFinch(AsyncAPIClient):
404
338
hris : resources .AsyncHRIS
405
339
providers : resources .AsyncProviders
406
340
account : resources .AsyncAccount
407
- webhooks : resources .AsyncWebhooks
408
341
request_forwarding : resources .AsyncRequestForwarding
409
342
jobs : resources .AsyncJobs
410
343
sandbox : resources .AsyncSandbox
@@ -505,7 +438,6 @@ def __init__(
505
438
self .hris = resources .AsyncHRIS (self )
506
439
self .providers = resources .AsyncProviders (self )
507
440
self .account = resources .AsyncAccount (self )
508
- self .webhooks = resources .AsyncWebhooks (self )
509
441
self .request_forwarding = resources .AsyncRequestForwarding (self )
510
442
self .jobs = resources .AsyncJobs (self )
511
443
self .sandbox = resources .AsyncSandbox (self )
@@ -649,70 +581,6 @@ def copy(
649
581
# client.with_options(timeout=10).foo.create(...)
650
582
with_options = copy
651
583
652
- async def get_access_token (
653
- self ,
654
- code : str ,
655
- * ,
656
- redirect_uri : str | None = None ,
657
- ) -> str :
658
- """DEPRECATED: use client.access_tokens.create instead."""
659
- if self .client_id is None :
660
- raise ValueError ("Expected client_id to be set in order to call get_access_token" )
661
-
662
- if self .client_secret is None :
663
- raise ValueError ("Expected client_secret to be set in order to call get_access_token" )
664
-
665
- response = await self .post (
666
- "/auth/token" ,
667
- body = {
668
- "client_id" : self .client_id ,
669
- "client_secret" : self .client_secret ,
670
- "code" : code ,
671
- "redirect_uri" : redirect_uri ,
672
- },
673
- options = {"headers" : {"Authorization" : Omit ()}},
674
- cast_to = httpx .Response ,
675
- )
676
- data = response .json ()
677
- return str (data ["access_token" ])
678
-
679
- def get_auth_url (
680
- self ,
681
- * ,
682
- products : str ,
683
- redirect_uri : str ,
684
- sandbox : bool ,
685
- ) -> str :
686
- """
687
- Returns the authorization url which can be visited in order to obtain an
688
- authorization code from Finch. The authorization code can then be exchanged for
689
- an access token for the Finch api by calling get_access_token().
690
- """
691
- if self .client_id is None :
692
- raise ValueError ("Expected the client_id to be set in order to call get_auth_url" )
693
-
694
- return str (
695
- httpx .URL (
696
- "https://connect.tryfinch.com/authorize" ,
697
- params = {
698
- "client_id" : self .client_id ,
699
- "products" : products ,
700
- "redirect_uri" : redirect_uri ,
701
- "sandbox" : sandbox ,
702
- },
703
- )
704
- )
705
-
706
- def with_access_token (
707
- self ,
708
- access_token : str ,
709
- ) -> Self :
710
- """
711
- Returns a copy of the current Finch client with the given access token for
712
- authentication.
713
- """
714
- return self .with_options (access_token = access_token )
715
-
716
584
@override
717
585
def _make_status_error (
718
586
self ,
0 commit comments