Skip to content
Open
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#nullable enable

namespace CursorAgents
{
public partial interface ICursorAgentsClient
{
/// <summary>
/// Get agent usage<br/>
/// Retrieve token usage for an agent, broken down per run.<br/>
/// `totalUsage` sums input, output, and cache token counts across<br/>
/// every run on the agent, and `runs` lists the same breakdown for<br/>
/// each run. Token usage mirrors the `tokenUsage` shape on the team<br/>
/// usage events endpoint.<br/>
/// This endpoint is in early access. When it isn't enabled for the<br/>
/// account it returns `403 feature_unavailable`. An unknown `runId`<br/>
/// returns `404 run_not_found`.
/// </summary>
/// <param name="id">
/// Example: bc-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="runId">
/// Example: run-00000000-0000-0000-0000-000000000001
/// </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::CursorAgents.ApiException"></exception>
global::System.Threading.Tasks.Task<global::CursorAgents.AgentUsageResponse> GetAgentUsageAsync(
string id,
string? runId = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get agent usage<br/>
/// Retrieve token usage for an agent, broken down per run.<br/>
/// `totalUsage` sums input, output, and cache token counts across<br/>
/// every run on the agent, and `runs` lists the same breakdown for<br/>
/// each run. Token usage mirrors the `tokenUsage` shape on the team<br/>
/// usage events endpoint.<br/>
/// This endpoint is in early access. When it isn't enabled for the<br/>
/// account it returns `403 feature_unavailable`. An unknown `runId`<br/>
/// returns `404 run_not_found`.
/// </summary>
/// <param name="id">
/// Example: bc-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="runId">
/// Example: run-00000000-0000-0000-0000-000000000001
/// </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::CursorAgents.ApiException"></exception>
global::System.Threading.Tasks.Task<global::CursorAgents.AutoSDKHttpResponse<global::CursorAgents.AgentUsageResponse>> GetAgentUsageAsResponseAsync(
string id,
string? runId = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListArtifactsResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::CursorAgents.Artifact>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.DownloadArtifactResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.UsageTokenUsage))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunUsage))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentUsageResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::CursorAgents.RunUsage>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ApiKeyInfo))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelParameterValueDefinition))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelParameterDefinition))]
Expand Down Expand Up @@ -152,6 +156,7 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.AgentSummary>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.Run>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.Artifact>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.RunUsage>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelParameterValueDefinition>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelVariantParam>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelParameterDefinition>))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,79 +276,95 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::CursorAgents.ApiKeyInfo? Type62 { get; set; }
public global::CursorAgents.UsageTokenUsage? Type62 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelParameterValueDefinition? Type63 { get; set; }
public global::CursorAgents.RunUsage? Type63 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelParameterDefinition? Type64 { get; set; }
public global::CursorAgents.AgentUsageResponse? Type64 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterValueDefinition>? Type65 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.RunUsage>? Type65 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelVariant? Type66 { get; set; }
public global::CursorAgents.ApiKeyInfo? Type66 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariantParam>? Type67 { get; set; }
public global::CursorAgents.ModelParameterValueDefinition? Type67 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelVariantParam? Type68 { get; set; }
public global::CursorAgents.ModelParameterDefinition? Type68 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelListItem? Type69 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterValueDefinition>? Type69 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterDefinition>? Type70 { get; set; }
public global::CursorAgents.ModelVariant? Type70 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariant>? Type71 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariantParam>? Type71 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListModelsResponse? Type72 { get; set; }
public global::CursorAgents.ModelVariantParam? Type72 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelListItem>? Type73 { get; set; }
public global::CursorAgents.ModelListItem? Type73 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Repository? Type74 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterDefinition>? Type74 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListRepositoriesResponse? Type75 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariant>? Type75 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.Repository>? Type76 { get; set; }
public global::CursorAgents.ListModelsResponse? Type76 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenRequest? Type77 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelListItem>? Type77 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenResponse? Type78 { get; set; }
public global::CursorAgents.Repository? Type78 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Error? Type79 { get; set; }
public global::CursorAgents.ListRepositoriesResponse? Type79 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ErrorError1? Type80 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.Repository>? Type80 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenRequest? Type81 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenResponse? Type82 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Error? Type83 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ErrorError1? Type84 { get; set; }

/// <summary>
///
Expand Down Expand Up @@ -397,26 +413,30 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterValueDefinition>? ListType11 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.RunUsage>? ListType11 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterValueDefinition>? ListType12 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariantParam>? ListType12 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariantParam>? ListType13 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterDefinition>? ListType13 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterDefinition>? ListType14 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariant>? ListType14 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariant>? ListType15 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelListItem>? ListType15 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelListItem>? ListType16 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.Repository>? ListType16 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.Repository>? ListType17 { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
/// </summary>
public string ToJson()
{
return ToJson(global::CursorAgents.SourceGenerationContext.Default);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return ToJson(global::CursorAgents.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
Expand All @@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::CursorAgents.Agent?;
}

/// <summary>
/// Deserializes a JSON string using the generated default JsonSerializerContext.
/// </summary>
public static global::CursorAgents.Agent? FromJson(
string json)
{
return FromJson(
json,
global::CursorAgents.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJson(
json,
global::CursorAgents.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Deserialize<global::CursorAgents.Agent>(
json,
jsonSerializerOptions);
Expand All @@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.Agent?;
}

/// <summary>
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
/// </summary>
public static global::System.Threading.Tasks.ValueTask<global::CursorAgents.Agent?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream)
{
return FromJsonStreamAsync(
jsonStream,
global::CursorAgents.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJsonStreamAsync(
jsonStream,
global::CursorAgents.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::CursorAgents.Agent?>(
jsonStream,
jsonSerializerOptions);
Expand Down
Loading