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
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ partial void ProcessQueryAnalyticsResponseContent(
global::OpenRouter.QueryAnalyticsRequestClassifierDimensions? classifierDimensions = default,
global::OpenRouter.QueryAnalyticsRequestClassifierFilters? classifierFilters = default,
global::System.Collections.Generic.IList<string>? dimensions = default,
global::System.Collections.Generic.IList<global::OpenRouter.QueryAnalyticsRequestFilter>? filters = default,
global::System.Collections.Generic.IList<global::OpenRouter.Filter>? filters = default,
string? granularity = default,
int? groupLimit = default,
int? limit = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public partial interface IAnalyticsClient
global::OpenRouter.QueryAnalyticsRequestClassifierDimensions? classifierDimensions = default,
global::OpenRouter.QueryAnalyticsRequestClassifierFilters? classifierFilters = default,
global::System.Collections.Generic.IList<string>? dimensions = default,
global::System.Collections.Generic.IList<global::OpenRouter.QueryAnalyticsRequestFilter>? filters = default,
global::System.Collections.Generic.IList<global::OpenRouter.Filter>? filters = default,
string? granularity = default,
int? groupLimit = default,
int? limit = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial interface IVaultClient
/// Example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
/// </param>
/// <param name="name">
/// Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.<br/>
/// Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.<br/>
/// Example: github_token
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand All @@ -33,7 +33,7 @@ public partial interface IVaultClient
/// Example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
/// </param>
/// <param name="name">
/// Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.<br/>
/// Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.<br/>
/// Example: github_token
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial interface IVaultClient
/// Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. An intern's own API key is confined to that intern: it can always read the intern's secrets and effective secrets, writes to them follow the rules above, and every other intern and every workspace route answers 404. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
/// </summary>
/// <param name="name">
/// Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.<br/>
/// Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.<br/>
/// Example: github_token
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand All @@ -24,7 +24,7 @@ public partial interface IVaultClient
/// Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. An intern's own API key is confined to that intern: it can always read the intern's secrets and effective secrets, writes to them follow the rules above, and every other intern and every workspace route answers 404. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
/// </summary>
/// <param name="name">
/// Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.<br/>
/// Existing secret name. Accepts legacy names stored before the 255-character write bound; new writes still require the documented name format.<br/>
/// Example: github_token
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public partial interface IVaultClient
/// Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.
/// </param>
/// <param name="value">
/// Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.
/// Secret value, 1 to 985721 characters. It is encrypted at rest and never returned.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public partial interface IVaultClient
/// Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.
/// </param>
/// <param name="value">
/// Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.
/// Secret value, 1 to 985721 characters. It is encrypted at rest and never returned.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
#nullable enable
#pragma warning disable CS0618 // Type or member is obsolete

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public class ClassifierFiltersFilterJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.ClassifierFiltersFilter>
{
/// <inheritdoc />
public override global::OpenRouter.ClassifierFiltersFilter Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");

using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
var __jsonProps = new global::System.Collections.Generic.HashSet<string>();
if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
{
foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
{
__jsonProps.Add(__jsonProp.Name);

}
}

var __score0 = 0;
if (__jsonProps.Contains("field")) __score0++;
if (__jsonProps.Contains("operator")) __score0++;
if (__jsonProps.Contains("value")) __score0++;
var __score1 = 0;
if (__jsonProps.Contains("field")) __score1++;
if (__jsonProps.Contains("operator")) __score1++;
if (__jsonProps.Contains("value")) __score1++;
var __bestScore = 0;
var __bestIndex = -1;
if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }

global::OpenRouter.ClassifierScalarFilter? scalar = default;
global::OpenRouter.ClassifierSetFilter? set = default;
if (__bestIndex >= 0)
{
if (__bestIndex == 0)
{
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ClassifierScalarFilter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ClassifierScalarFilter> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ClassifierScalarFilter).Name}");
scalar = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader")
{
// Legacy enum converters signal an incompatible JSON token with this exception.
}
}
else if (__bestIndex == 1)
{
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ClassifierSetFilter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ClassifierSetFilter> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ClassifierSetFilter).Name}");
set = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader")
{
// Legacy enum converters signal an incompatible JSON token with this exception.
}
}
}

if (scalar == null && set == null)
{
try
{

var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ClassifierScalarFilter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ClassifierScalarFilter> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ClassifierScalarFilter).Name}");
scalar = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader")
{
// Legacy enum converters signal an incompatible JSON token with this exception.
}
}

if (scalar == null && set == null)
{
try
{

var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ClassifierSetFilter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ClassifierSetFilter> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ClassifierSetFilter).Name}");
set = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader")
{
// Legacy enum converters signal an incompatible JSON token with this exception.
}
}

var __value = new global::OpenRouter.ClassifierFiltersFilter(
scalar,

set
);

return __value;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.ClassifierFiltersFilter value,
global::System.Text.Json.JsonSerializerOptions options)
{
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");

if (value.IsScalar)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ClassifierScalarFilter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ClassifierScalarFilter?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ClassifierScalarFilter).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickScalar(), typeInfo);
}
else if (value.IsSet)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ClassifierSetFilter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ClassifierSetFilter?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ClassifierSetFilter).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickSet(), typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class GetAnalyticsMetaResponseDataOperatorNameJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.GetAnalyticsMetaResponseDataOperatorName>
public sealed class ClassifierScalarFilterOperatorJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.ClassifierScalarFilterOperator>
{
/// <inheritdoc />
public override global::OpenRouter.GetAnalyticsMetaResponseDataOperatorName Read(
public override global::OpenRouter.ClassifierScalarFilterOperator Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,14 +18,14 @@ public sealed class GetAnalyticsMetaResponseDataOperatorNameJsonConverter : glob
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::OpenRouter.GetAnalyticsMetaResponseDataOperatorNameExtensions.ToEnum(stringValue) ?? default;
return global::OpenRouter.ClassifierScalarFilterOperatorExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.GetAnalyticsMetaResponseDataOperatorName);
return default(global::OpenRouter.ClassifierScalarFilterOperator);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -37,12 +37,12 @@ public sealed class GetAnalyticsMetaResponseDataOperatorNameJsonConverter : glob
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.GetAnalyticsMetaResponseDataOperatorName value,
global::OpenRouter.ClassifierScalarFilterOperator value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::OpenRouter.GetAnalyticsMetaResponseDataOperatorNameExtensions.ToValueString(value));
writer.WriteStringValue(global::OpenRouter.ClassifierScalarFilterOperatorExtensions.ToValueString(value));
}
}
}
Loading
Loading