Skip to content

Commit

Permalink
Merge pull request #14 from tryAGI/bot/update-openapi_202410010328
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 1, 2024
2 parents 2955446 + 24b87fe commit e1cf49f
Show file tree
Hide file tree
Showing 56 changed files with 412 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ partial void ProcessCreateCatalogResponseContent(
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
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);
}}
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 @@ -50,6 +50,13 @@ partial void ProcessDeleteCatalogResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ partial void ProcessDeleteCatalogFileResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ partial void ProcessGetFileCatalogResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ partial void ProcessGetSourceFileResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ partial void ProcessListCatalogFilesResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ partial void ProcessListCatalogRunsResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ partial void ProcessListCatalogsResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ partial void ProcessListChunksResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,26 @@ partial void ProcessProcessCatalogFilesResponseContent(
instillRequesterUid: ref instillRequesterUid,
request: request);

if (instillRequesterUid != default)
{
_httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Instill-Requester-Uid", instillRequesterUid);
}

var __pathBuilder = new PathBuilder(
path: "/v1alpha/catalogs/files/processAsync",
baseUri: _httpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
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);
}}

if (instillRequesterUid != default)
{
httpRequest.Headers.TryAddWithoutValidation("Instill-Requester-Uid", instillRequesterUid.ToString());
}

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 @@ -54,18 +54,26 @@ partial void ProcessQuestionAnsweringResponseContent(
instillRequesterUid: ref instillRequesterUid,
request: request);

if (instillRequesterUid != default)
{
_httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Instill-Requester-Uid", instillRequesterUid);
}

var __pathBuilder = new PathBuilder(
path: $"/v1alpha/namespaces/{namespaceId}/catalogs/{catalogId}/ask",
baseUri: _httpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
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);
}}

if (instillRequesterUid != default)
{
httpRequest.Headers.TryAddWithoutValidation("Instill-Requester-Uid", instillRequesterUid.ToString());
}

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 @@ -54,18 +54,26 @@ partial void ProcessSimilarityChunksSearchResponseContent(
instillRequesterUid: ref instillRequesterUid,
request: request);

if (instillRequesterUid != default)
{
_httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Instill-Requester-Uid", instillRequesterUid);
}

var __pathBuilder = new PathBuilder(
path: $"/v1alpha/namespaces/{namespaceId}/catalogs/{catalogId}/chunks/retrieve",
baseUri: _httpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
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);
}}

if (instillRequesterUid != default)
{
httpRequest.Headers.TryAddWithoutValidation("Instill-Requester-Uid", instillRequesterUid.ToString());
}

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 @@ -56,6 +56,13 @@ partial void ProcessUpdateCatalogResponseContent(
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Put,
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);
}}
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 @@ -51,6 +51,13 @@ partial void ProcessUpdateChunkResponseContent(
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
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);
}}
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 @@ -56,6 +56,13 @@ partial void ProcessUploadCatalogFileResponseContent(
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
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);
}}
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: 6 additions & 2 deletions src/libs/Instill/Generated/Instill.CatalogClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class CatalogClient : global::Instill.ICatalogClient, glob
public const string BaseUrl = "https://api.instill.tech";

private readonly global::System.Net.Http.HttpClient _httpClient;
private global::Instill.EndPointAuthorization? _authorization;

/// <summary>
///
Expand All @@ -28,13 +29,16 @@ public sealed partial class CatalogClient : global::Instill.ICatalogClient, glob
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
public CatalogClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
global::System.Uri? baseUri = null,
global::Instill.EndPointAuthorization? authorization = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
_authorization = authorization;

Initialized(_httpClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ partial void ProcessGetRemainingCreditResponseContent(
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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
8 changes: 6 additions & 2 deletions src/libs/Instill/Generated/Instill.CreditClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public sealed partial class CreditClient : global::Instill.ICreditClient, global
public const string BaseUrl = "https://api.instill.tech";

private readonly global::System.Net.Http.HttpClient _httpClient;
private global::Instill.EndPointAuthorization? _authorization;

/// <summary>
///
Expand All @@ -29,13 +30,16 @@ public sealed partial class CreditClient : global::Instill.ICreditClient, global
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
public CreditClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
global::System.Uri? baseUri = null,
global::Instill.EndPointAuthorization? authorization = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
_authorization = authorization;

Initialized(_httpClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ public void AuthorizeUsingBearer(
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

_httpClient.DefaultRequestHeaders.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: "Bearer",
parameter: apiKey);
_authorization = new global::Instill.EndPointAuthorization
{
Name = "Bearer",
Value = apiKey,
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ namespace Instill
{
public sealed partial class InstillClient
{
/// <inheritdoc cref="InstillClient(global::System.Net.Http.HttpClient?, global::System.Uri?)"/>
/// <inheritdoc cref="InstillClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::Instill.EndPointAuthorization?)"/>
public InstillClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null) : this(httpClient, baseUri)
global::System.Uri? baseUri = null,
global::Instill.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization)
{
Authorizing(_httpClient, ref apiKey);

Expand Down
Loading

0 comments on commit e1cf49f

Please sign in to comment.