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
@@ -0,0 +1,110 @@
#nullable enable

namespace Fal
{
public partial interface IServerlessClient
{
/// <summary>
/// Runner State History<br/>
/// Returns historical runner counts by state (running, idle, pending, draining)<br/>
/// for an application, bucketed over time.<br/>
/// **Use cases:**<br/>
/// - Capacity/utilization analysis: compare idle vs running over days or weeks<br/>
/// to see how much reserved capacity goes unused (use `aggregation=avg`)<br/>
/// - Incident forensics: correlate error spikes with runner drops or drain<br/>
/// events around the incident window (use `aggregation=max`)<br/>
/// **Time range:** up to 90 days of history. Defaults to the last 24 hours when<br/>
/// `start`/`end` are omitted. Bucket size is auto-detected from the range<br/>
/// unless `timeframe` is specified.<br/>
/// **Authentication:** Required via API key. Only the app owner can query it.
/// </summary>
/// <param name="owner">
/// Username of the app owner<br/>
/// Example: user_123
/// </param>
/// <param name="name">
/// Application name<br/>
/// Example: my-app
/// </param>
/// <param name="start">
/// Start date in ISO8601 format (e.g., '2025-01-01T00:00:00Z' or '2025-01-01'). Defaults to 24 hours ago.<br/>
/// Example: 2025-01-01T00:00:00Z
/// </param>
/// <param name="end">
/// End date in ISO8601 format, exclusive (e.g., '2025-02-01T00:00:00Z' or '2025-02-01'). Data up to but not including this timestamp is returned. Defaults to current time.<br/>
/// Example: 2025-02-01T00:00:00Z
/// </param>
/// <param name="timeframe">
/// Bucket size for the time series (auto-detected from the date range if not specified). Auto-detection uses: minute (&lt;2h), hour (&lt;2d), day (&lt;64d), week (&lt;183d), month (&gt;=183d).<br/>
/// Example: day
/// </param>
/// <param name="aggregation">
/// How runner counts are aggregated within each bucket: 'max' shows peak concurrency (capacity analysis), 'avg' shows mean concurrency (utilization analysis).<br/>
/// Default Value: max<br/>
/// Example: max
/// </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>
/// <exception cref="global::Fal.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Fal.ServerlessGetRunnerHistoryResponse> ServerlessGetRunnerHistoryAsync(
string owner,
string name,
global::Fal.AnyOf<global::System.DateTime?, string>? start = default,
global::Fal.AnyOf<global::System.DateTime?, string>? end = default,
global::Fal.ServerlessGetRunnerHistoryTimeframe? timeframe = default,
global::Fal.ServerlessGetRunnerHistoryAggregation? aggregation = default,
global::Fal.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Runner State History<br/>
/// Returns historical runner counts by state (running, idle, pending, draining)<br/>
/// for an application, bucketed over time.<br/>
/// **Use cases:**<br/>
/// - Capacity/utilization analysis: compare idle vs running over days or weeks<br/>
/// to see how much reserved capacity goes unused (use `aggregation=avg`)<br/>
/// - Incident forensics: correlate error spikes with runner drops or drain<br/>
/// events around the incident window (use `aggregation=max`)<br/>
/// **Time range:** up to 90 days of history. Defaults to the last 24 hours when<br/>
/// `start`/`end` are omitted. Bucket size is auto-detected from the range<br/>
/// unless `timeframe` is specified.<br/>
/// **Authentication:** Required via API key. Only the app owner can query it.
/// </summary>
/// <param name="owner">
/// Username of the app owner<br/>
/// Example: user_123
/// </param>
/// <param name="name">
/// Application name<br/>
/// Example: my-app
/// </param>
/// <param name="start">
/// Start date in ISO8601 format (e.g., '2025-01-01T00:00:00Z' or '2025-01-01'). Defaults to 24 hours ago.<br/>
/// Example: 2025-01-01T00:00:00Z
/// </param>
/// <param name="end">
/// End date in ISO8601 format, exclusive (e.g., '2025-02-01T00:00:00Z' or '2025-02-01'). Data up to but not including this timestamp is returned. Defaults to current time.<br/>
/// Example: 2025-02-01T00:00:00Z
/// </param>
/// <param name="timeframe">
/// Bucket size for the time series (auto-detected from the date range if not specified). Auto-detection uses: minute (&lt;2h), hour (&lt;2d), day (&lt;64d), week (&lt;183d), month (&gt;=183d).<br/>
/// Example: day
/// </param>
/// <param name="aggregation">
/// How runner counts are aggregated within each bucket: 'max' shows peak concurrency (capacity analysis), 'avg' shows mean concurrency (utilization analysis).<br/>
/// Default Value: max<br/>
/// Example: max
/// </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>
/// <exception cref="global::Fal.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Fal.AutoSDKHttpResponse<global::Fal.ServerlessGetRunnerHistoryResponse>> ServerlessGetRunnerHistoryAsResponseAsync(
string owner,
string name,
global::Fal.AnyOf<global::System.DateTime?, string>? start = default,
global::Fal.AnyOf<global::System.DateTime?, string>? end = default,
global::Fal.ServerlessGetRunnerHistoryTimeframe? timeframe = default,
global::Fal.ServerlessGetRunnerHistoryAggregation? aggregation = default,
global::Fal.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Fal.JsonConverters
{
/// <inheritdoc />
public sealed class ServerlessGetRunnerHistoryAggregationJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Fal.ServerlessGetRunnerHistoryAggregation>
{
/// <inheritdoc />
public override global::Fal.ServerlessGetRunnerHistoryAggregation Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Fal.ServerlessGetRunnerHistoryAggregationExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Fal.ServerlessGetRunnerHistoryAggregation)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Fal.ServerlessGetRunnerHistoryAggregation);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Fal.ServerlessGetRunnerHistoryAggregation value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Fal.ServerlessGetRunnerHistoryAggregationExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Fal.JsonConverters
{
/// <inheritdoc />
public sealed class ServerlessGetRunnerHistoryAggregationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Fal.ServerlessGetRunnerHistoryAggregation?>
{
/// <inheritdoc />
public override global::Fal.ServerlessGetRunnerHistoryAggregation? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Fal.ServerlessGetRunnerHistoryAggregationExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Fal.ServerlessGetRunnerHistoryAggregation)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Fal.ServerlessGetRunnerHistoryAggregation?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Fal.ServerlessGetRunnerHistoryAggregation? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Fal.ServerlessGetRunnerHistoryAggregationExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Fal.JsonConverters
{
/// <inheritdoc />
public sealed class ServerlessGetRunnerHistoryResponseAggregationJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Fal.ServerlessGetRunnerHistoryResponseAggregation>
{
/// <inheritdoc />
public override global::Fal.ServerlessGetRunnerHistoryResponseAggregation Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Fal.ServerlessGetRunnerHistoryResponseAggregationExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Fal.ServerlessGetRunnerHistoryResponseAggregation)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Fal.ServerlessGetRunnerHistoryResponseAggregation);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Fal.ServerlessGetRunnerHistoryResponseAggregation value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Fal.ServerlessGetRunnerHistoryResponseAggregationExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Fal.JsonConverters
{
/// <inheritdoc />
public sealed class ServerlessGetRunnerHistoryResponseAggregationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Fal.ServerlessGetRunnerHistoryResponseAggregation?>
{
/// <inheritdoc />
public override global::Fal.ServerlessGetRunnerHistoryResponseAggregation? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Fal.ServerlessGetRunnerHistoryResponseAggregationExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Fal.ServerlessGetRunnerHistoryResponseAggregation)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Fal.ServerlessGetRunnerHistoryResponseAggregation?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Fal.ServerlessGetRunnerHistoryResponseAggregation? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Fal.ServerlessGetRunnerHistoryResponseAggregationExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Fal.JsonConverters
{
/// <inheritdoc />
public sealed class ServerlessGetRunnerHistoryResponseErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Fal.ServerlessGetRunnerHistoryResponseErrorType>
{
/// <inheritdoc />
public override global::Fal.ServerlessGetRunnerHistoryResponseErrorType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Fal.ServerlessGetRunnerHistoryResponseErrorTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Fal.ServerlessGetRunnerHistoryResponseErrorType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Fal.ServerlessGetRunnerHistoryResponseErrorType);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Fal.ServerlessGetRunnerHistoryResponseErrorType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Fal.ServerlessGetRunnerHistoryResponseErrorTypeExtensions.ToValueString(value));
}
}
}
Loading