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/Neuphonic.CLI/Neuphonic.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/Neuphonic/Neuphonic.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

#nullable enable

namespace Neuphonic
{
public sealed partial class AgentsClient
{

/// <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::Neuphonic.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 Neuphonic
{
public sealed partial class AgentsClient
{
/// <inheritdoc cref="AgentsClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Neuphonic.EndPointAuthorization}?, bool)"/>

public AgentsClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::Neuphonic.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 Neuphonic
{
public partial interface IAgentsClient
{
/// <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 Neuphonic
{
public partial interface ITtsClient
{
/// <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 Neuphonic
{
public partial interface IVoicesClient
{
/// <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 Neuphonic
{
public sealed partial class TtsClient
{

/// <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::Neuphonic.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 Neuphonic
{
public sealed partial class TtsClient
{
/// <inheritdoc cref="TtsClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Neuphonic.EndPointAuthorization}?, bool)"/>

public TtsClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::Neuphonic.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 Neuphonic
{
public sealed partial class VoicesClient
{

/// <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::Neuphonic.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 Neuphonic
{
public sealed partial class VoicesClient
{
/// <inheritdoc cref="VoicesClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Neuphonic.EndPointAuthorization}?, bool)"/>

public VoicesClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::Neuphonic.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);

}
}