Skip to content

QuotaDecision

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The result of a quota check.

public sealed record QuotaDecision : IEquatable<QuotaDecision>

objectQuotaDecision

IEquatable<QuotaDecision>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The check happens before the run starts; consumption is written after the run ends. This means concurrent runs can push a quota slightly over — the quota is approximate.

public QuotaDecision()

The exceeded rule’s scope: the agent name, or null for tenant-wide.

public string? AgentName { get; init; }

string?

The result reporting that no rule was exceeded.

public static QuotaDecision Allowed { get; }

QuotaDecision

true if a monetary rule fell back to tokens because pricing was undefined.

public bool CostFellBackToTokens { get; init; }

bool

Whether the run is allowed.

public required bool IsAllowed { get; init; }

bool

The exceeded limit value.

public decimal? Limit { get; init; }

decimal?

The exceeded metric. null if allowed.

public QuotaMetric? Metric { get; init; }

QuotaMetric?

The exceeded rule’s period. null if allowed.

public QuotaPeriod? Period { get; init; }

QuotaPeriod?

The explanation shown to the user. null if allowed.

public string? Reason { get; init; }

string?

The time the counter resets (UTC). Reflected to the client as Retry-After.

public DateTimeOffset? ResetsAt { get; init; }

DateTimeOffset?

The consumption at check time.

public decimal? Used { get; init; }

decimal?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(QuotaDecision? other)

other QuotaDecision?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(QuotaDecision?, QuotaDecision?)

Section titled “ operator ==(QuotaDecision?, QuotaDecision?)”
public static bool operator ==(QuotaDecision? left, QuotaDecision? right)

left QuotaDecision?

right QuotaDecision?

bool

operator !=(QuotaDecision?, QuotaDecision?)

Section titled “ operator !=(QuotaDecision?, QuotaDecision?)”
public static bool operator !=(QuotaDecision? left, QuotaDecision? right)

left QuotaDecision?

right QuotaDecision?

bool