-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose api client hooks for dotnet (#389)
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using RestSharp; | ||
using System; | ||
|
||
namespace Ory.Client.Client | ||
{ | ||
public partial class ApiClient : ISynchronousClient, IAsynchronousClient | ||
{ | ||
/// <summary> | ||
/// Hook to access the underlying RestRequest before the request is sent. | ||
/// </summary> | ||
public Action<RestRequest>? RequestHook { get; set; } | ||
|
||
/// <summary> | ||
/// Hook to access the underlying RestRequest and RestResponse after the response is received. | ||
/// </summary> | ||
public Action<RestRequest, RestResponse>? ResponseHook { get; set; } | ||
|
||
partial void InterceptRequest(RestRequest request) | ||
{ | ||
RequestHook?.Invoke(request); | ||
} | ||
|
||
partial void InterceptResponse(RestRequest request, RestResponse response) | ||
{ | ||
ResponseHook?.Invoke(request, response); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters