-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: To generated apiKey constructor.
- Loading branch information
Showing
7 changed files
with
73 additions
and
21 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
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.Authorizations.Bearer.g.cs
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,22 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
public sealed partial class DeepInfraApi | ||
{ | ||
/// <summary> | ||
/// Authorize using bearer authentication. | ||
/// </summary> | ||
/// <param name="apiKey"></param> | ||
public void AuthorizeUsingBearer( | ||
string apiKey) | ||
{ | ||
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); | ||
|
||
_httpClient.DefaultRequestHeaders.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( | ||
scheme: "Bearer", | ||
parameter: apiKey); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.Constructors.Bearer.g.cs
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,17 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
public sealed partial class DeepInfraApi | ||
{ | ||
/// <inheritdoc cref="DeepInfraApi(global::System.Net.Http.HttpClient?, global::System.Uri?)"/> | ||
public DeepInfraApi( | ||
string apiKey, | ||
global::System.Net.Http.HttpClient? httpClient = null, | ||
global::System.Uri? baseUri = null) : this(httpClient, baseUri) | ||
{ | ||
AuthorizeUsingBearer(apiKey); | ||
} | ||
} | ||
} |
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
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
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