Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 1, 2024
1 parent 0821939 commit dca1996
Show file tree
Hide file tree
Showing 25 changed files with 296 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ public void AuthorizeUsingApiKeyInHeader(
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

_authorization = new global::AssemblyAI.EndPointAuthorization
_authorizations.Clear();
_authorizations.Add(new global::AssemblyAI.EndPointAuthorization
{
Type = "ApiKey",
Location = "Header",
Name = "Authorization",
Value = apiKey,
};
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace AssemblyAI
{
public sealed partial class AssemblyAIClient
{
/// <inheritdoc cref="AssemblyAIClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::AssemblyAI.EndPointAuthorization?)"/>
/// <inheritdoc cref="AssemblyAIClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::AssemblyAI.EndPointAuthorization}?)"/>
public AssemblyAIClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::AssemblyAI.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization)
global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>? authorizations = null) : this(httpClient, baseUri, authorizations)
{
Authorizing(_httpClient, ref apiKey);

Expand Down
14 changes: 7 additions & 7 deletions src/libs/AssemblyAI/Generated/AssemblyAI.AssemblyAIClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class AssemblyAIClient : global::AssemblyAI.IAssemblyAICli
public const string BaseUrl = "https://api.assemblyai.com";

private readonly global::System.Net.Http.HttpClient _httpClient;
private global::AssemblyAI.EndPointAuthorization? _authorization;
private global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization> _authorizations;

/// <summary>
///
Expand All @@ -27,23 +27,23 @@ public sealed partial class AssemblyAIClient : global::AssemblyAI.IAssemblyAICli
/// <summary>
/// Transcript related operations
/// </summary>
public TranscriptClient Transcript => new TranscriptClient(_httpClient, authorization: _authorization)
public TranscriptClient Transcript => new TranscriptClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
/// LeMUR related operations
/// </summary>
public LeMURClient LeMUR => new LeMURClient(_httpClient, authorization: _authorization)
public LeMURClient LeMUR => new LeMURClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
/// Streaming Speech-to-Text
/// </summary>
public StreamingClient Streaming => new StreamingClient(_httpClient, authorization: _authorization)
public StreamingClient Streaming => new StreamingClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};
Expand All @@ -55,15 +55,15 @@ public sealed partial class AssemblyAIClient : global::AssemblyAI.IAssemblyAICli
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public AssemblyAIClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::AssemblyAI.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>? authorizations = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
_authorization = authorization;
_authorizations = authorizations ?? new global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ partial void ProcessGetLemurResponseResponseContent(
method: global::System.Net.Http.HttpMethod.Get,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}

PrepareRequest(
client: _httpClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ partial void ProcessLemurActionItemsResponseContent(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,21 @@ partial void ProcessLemurQuestionAnswerResponseContent(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,21 @@ partial void ProcessLemurSummaryResponseContent(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ partial void ProcessLemurTaskResponseContent(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,21 @@ partial void ProcessPurgeLemurRequestDataResponseContent(
method: global::System.Net.Http.HttpMethod.Delete,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}

PrepareRequest(
client: _httpClient,
Expand Down
8 changes: 4 additions & 4 deletions src/libs/AssemblyAI/Generated/AssemblyAI.LeMURClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class LeMURClient : global::AssemblyAI.ILeMURClient, globa
public const string BaseUrl = "https://api.assemblyai.com";

private readonly global::System.Net.Http.HttpClient _httpClient;
private global::AssemblyAI.EndPointAuthorization? _authorization;
private global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization> _authorizations;

/// <summary>
///
Expand All @@ -31,15 +31,15 @@ public sealed partial class LeMURClient : global::AssemblyAI.ILeMURClient, globa
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public LeMURClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::AssemblyAI.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>? authorizations = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
_authorization = authorization;
_authorizations = authorizations ?? new global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
10 changes: 10 additions & 0 deletions src/libs/AssemblyAI/Generated/AssemblyAI.PathBuilder.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,16 @@ public PathBuilder AddOptionalParameter<T>(
/// </summary>
public class EndPointAuthorization
{
/// <summary>
///
/// </summary>
public string Type { get; set; } = string.Empty;

/// <summary>
///
/// </summary>
public string Location { get; set; } = string.Empty;

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,21 @@ partial void ProcessCreateTemporaryTokenResponseContent(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand Down
8 changes: 4 additions & 4 deletions src/libs/AssemblyAI/Generated/AssemblyAI.StreamingClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class StreamingClient : global::AssemblyAI.IStreamingClien
public const string BaseUrl = "https://api.assemblyai.com";

private readonly global::System.Net.Http.HttpClient _httpClient;
private global::AssemblyAI.EndPointAuthorization? _authorization;
private global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization> _authorizations;

/// <summary>
///
Expand All @@ -31,15 +31,15 @@ public sealed partial class StreamingClient : global::AssemblyAI.IStreamingClien
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public StreamingClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::AssemblyAI.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>? authorizations = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
_authorization = authorization;
_authorizations = authorizations ?? new global::System.Collections.Generic.List<global::AssemblyAI.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ partial void ProcessCreateTranscriptResponseContent(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}}
foreach (var _authorization in _authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
}
}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand Down
Loading

0 comments on commit dca1996

Please sign in to comment.