Skip to content

Commit

Permalink
Merge pull request #18 from tryAGI/bot/update-openapi_202410010630
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 1, 2024
2 parents 279a27f + 59c5d5a commit a438fb3
Show file tree
Hide file tree
Showing 16 changed files with 151 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ partial void ProcessDownloadResultResponseContent(
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);
}
}

PrepareRequest(
client: _httpClient,
Expand Down
21 changes: 15 additions & 6 deletions src/libs/Jina/Generated/Jina.BulkEmbeddingsClient.RetrieveJob.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ partial void ProcessRetrieveJobResponseContent(
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 @@ -48,12 +48,21 @@ partial void ProcessStartBulkEmbeddingResponseContent(
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);
}
}
using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
__httpRequestContent.Add(
content: new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty<byte>())
Expand Down
8 changes: 4 additions & 4 deletions src/libs/Jina/Generated/Jina.BulkEmbeddingsClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed partial class BulkEmbeddingsClient : global::Jina.IBulkEmbeddingsC
public const string BaseUrl = "https://api.jina.ai/";

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

/// <summary>
///
Expand All @@ -30,15 +30,15 @@ public sealed partial class BulkEmbeddingsClient : global::Jina.IBulkEmbeddingsC
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public BulkEmbeddingsClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::Jina.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::Jina.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::Jina.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
21 changes: 15 additions & 6 deletions src/libs/Jina/Generated/Jina.EmbeddingsClient.CreateEmbedding.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ partial void ProcessCreateEmbeddingResponseContent(
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/Jina/Generated/Jina.EmbeddingsClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed partial class EmbeddingsClient : global::Jina.IEmbeddingsClient, g
public const string BaseUrl = "https://api.jina.ai/";

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

/// <summary>
///
Expand All @@ -30,15 +30,15 @@ public sealed partial class EmbeddingsClient : global::Jina.IEmbeddingsClient, g
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public EmbeddingsClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::Jina.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::Jina.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::Jina.EndPointAuthorization>();

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

_authorization = new global::Jina.EndPointAuthorization
_authorizations.Clear();
_authorizations.Add(new global::Jina.EndPointAuthorization
{
Type = "Http",
Location = "Header",
Name = "Bearer",
Value = apiKey,
};
});
}
}
}
4 changes: 2 additions & 2 deletions src/libs/Jina/Generated/Jina.JinaApi.Constructors.Bearer.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace Jina
{
public sealed partial class JinaApi
{
/// <inheritdoc cref="JinaApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::Jina.EndPointAuthorization?)"/>
/// <inheritdoc cref="JinaApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Jina.EndPointAuthorization}?)"/>
public JinaApi(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::Jina.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization)
global::System.Collections.Generic.List<global::Jina.EndPointAuthorization>? authorizations = null) : this(httpClient, baseUri, authorizations)
{
Authorizing(_httpClient, ref apiKey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,21 @@ partial void ProcessGetTheHealthOfUniversalAPIServiceResponseContent(
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
16 changes: 8 additions & 8 deletions src/libs/Jina/Generated/Jina.JinaApi.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class JinaApi : global::Jina.IJinaApi, global::System.IDis
public const string BaseUrl = "https://api.jina.ai/";

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

/// <summary>
///
Expand All @@ -27,31 +27,31 @@ public sealed partial class JinaApi : global::Jina.IJinaApi, global::System.IDis
/// <summary>
///
/// </summary>
public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, authorization: _authorization)
public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public BulkEmbeddingsClient BulkEmbeddings => new BulkEmbeddingsClient(_httpClient, authorization: _authorization)
public BulkEmbeddingsClient BulkEmbeddings => new BulkEmbeddingsClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public RerankClient Rerank => new RerankClient(_httpClient, authorization: _authorization)
public RerankClient Rerank => new RerankClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public MultiVectorClient MultiVector => new MultiVectorClient(_httpClient, authorization: _authorization)
public MultiVectorClient MultiVector => new MultiVectorClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};
Expand All @@ -63,15 +63,15 @@ public sealed partial class JinaApi : global::Jina.IJinaApi, global::System.IDis
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public JinaApi(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::Jina.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::Jina.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::Jina.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,21 @@ partial void ProcessCreateMultiVectorResponseContent(
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/Jina/Generated/Jina.MultiVectorClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed partial class MultiVectorClient : global::Jina.IMultiVectorClient,
public const string BaseUrl = "https://api.jina.ai/";

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

/// <summary>
///
Expand All @@ -30,15 +30,15 @@ public sealed partial class MultiVectorClient : global::Jina.IMultiVectorClient,
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public MultiVectorClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::Jina.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::Jina.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::Jina.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
10 changes: 10 additions & 0 deletions src/libs/Jina/Generated/Jina.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
21 changes: 15 additions & 6 deletions src/libs/Jina/Generated/Jina.RerankClient.Rank.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,21 @@ partial void ProcessRankResponseContent(
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 a438fb3

Please sign in to comment.