Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cli/AsyncAI.CLI/AsyncAI.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MinVer" Version="8.0.0">
<PackageReference Include="MinVer" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.CommandLine" Version="2.0.12" />
<PackageReference Include="System.CommandLine" Version="2.0.7" />
<ProjectReference Include="../../libs/AsyncAI/AsyncAI.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

#nullable enable

namespace AsyncAI
{
public sealed partial class ApiStatusClient
{

/// <inheritdoc/>
public void AuthorizeUsingApiKeyInHeader(
string apiKey)
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

for (var i = Authorizations.Count - 1; i >= 0; i--)
{
var __authorization = Authorizations[i];
if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header" &&
__authorization.Name == "X-Api-Key")
{
Authorizations.RemoveAt(i);
}
}

Authorizations.Add(new global::AsyncAI.EndPointAuthorization
{
Type = "ApiKey",
SchemeId = "ApikeyXApiKey",
Location = "Header",
Name = "X-Api-Key",
Value = apiKey,
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

#nullable enable

namespace AsyncAI
{
public sealed partial class ApiStatusClient
{
/// <inheritdoc cref="ApiStatusClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::AsyncAI.EndPointAuthorization}?, bool)"/>

public ApiStatusClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::AsyncAI.EndPointAuthorization>? authorizations = null,
bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient)
{
Authorizing(HttpClient, ref apiKey);

AuthorizeUsingApiKeyInHeader(apiKey);

Authorized(HttpClient);
}

partial void Authorizing(
global::System.Net.Http.HttpClient client,
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#nullable enable

namespace AsyncAI
{
public partial interface IApiStatusClient
{
/// <summary>
/// Authorize using ApiKey authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingApiKeyInHeader(
string apiKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#nullable enable

namespace AsyncAI
{
public partial interface ITextToSpeechClient
{
/// <summary>
/// Authorize using ApiKey authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingApiKeyInHeader(
string apiKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#nullable enable

namespace AsyncAI
{
public partial interface IVoiceManagementClient
{
/// <summary>
/// Authorize using ApiKey authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingApiKeyInHeader(
string apiKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

#nullable enable

namespace AsyncAI
{
public sealed partial class TextToSpeechClient
{

/// <inheritdoc/>
public void AuthorizeUsingApiKeyInHeader(
string apiKey)
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

for (var i = Authorizations.Count - 1; i >= 0; i--)
{
var __authorization = Authorizations[i];
if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header" &&
__authorization.Name == "X-Api-Key")
{
Authorizations.RemoveAt(i);
}
}

Authorizations.Add(new global::AsyncAI.EndPointAuthorization
{
Type = "ApiKey",
SchemeId = "ApikeyXApiKey",
Location = "Header",
Name = "X-Api-Key",
Value = apiKey,
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

#nullable enable

namespace AsyncAI
{
public sealed partial class TextToSpeechClient
{
/// <inheritdoc cref="TextToSpeechClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::AsyncAI.EndPointAuthorization}?, bool)"/>

public TextToSpeechClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::AsyncAI.EndPointAuthorization>? authorizations = null,
bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient)
{
Authorizing(HttpClient, ref apiKey);

AuthorizeUsingApiKeyInHeader(apiKey);

Authorized(HttpClient);
}

partial void Authorizing(
global::System.Net.Http.HttpClient client,
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

#nullable enable

namespace AsyncAI
{
public sealed partial class VoiceManagementClient
{

/// <inheritdoc/>
public void AuthorizeUsingApiKeyInHeader(
string apiKey)
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

for (var i = Authorizations.Count - 1; i >= 0; i--)
{
var __authorization = Authorizations[i];
if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header" &&
__authorization.Name == "X-Api-Key")
{
Authorizations.RemoveAt(i);
}
}

Authorizations.Add(new global::AsyncAI.EndPointAuthorization
{
Type = "ApiKey",
SchemeId = "ApikeyXApiKey",
Location = "Header",
Name = "X-Api-Key",
Value = apiKey,
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

#nullable enable

namespace AsyncAI
{
public sealed partial class VoiceManagementClient
{
/// <inheritdoc cref="VoiceManagementClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::AsyncAI.EndPointAuthorization}?, bool)"/>

public VoiceManagementClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::AsyncAI.EndPointAuthorization>? authorizations = null,
bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient)
{
Authorizing(HttpClient, ref apiKey);

AuthorizeUsingApiKeyInHeader(apiKey);

Authorized(HttpClient);
}

partial void Authorizing(
global::System.Net.Http.HttpClient client,
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);

}
}