QuotaDefinition
AgentPrism.Abstractions.dllA quota rule defined for a tenant or an agent.
public sealed record QuotaDefinition : IEquatable<QuotaDefinition>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”A quota is at day/month scale and is counted in the database. The rate limit that smooths bursty load is a separate mechanism and lives in memory; the two must not be confused.
All three limits may be null: only the ones that are set are enforced. If all three are empty, the rule does nothing.
Constructors
Section titled “Constructors”QuotaDefinition()
Section titled “ QuotaDefinition()”public QuotaDefinition()Properties
Section titled “Properties”AgentName
Section titled “ AgentName”The agent the rule is bound to. If null, the rule applies to all of the tenant’s runs.
public string? AgentName { get; init; }Property Value
Section titled “Property Value”CreatedAt
Section titled “ CreatedAt”The creation time (UTC).
public required DateTimeOffset CreatedAt { get; init; }Property Value
Section titled “Property Value”Enabled
Section titled “ Enabled”Whether the rule is enabled.
public bool Enabled { get; init; }Property Value
Section titled “Property Value”The rule identifier.
public required Guid Id { get; init; }Property Value
Section titled “Property Value”MaxCost
Section titled “ MaxCost”The maximum monetary amount per period. Unlimited if null.
public decimal? MaxCost { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”This limit cannot be enforced on a model with undefined pricing: since the cost is unknown, the quota falls back to tokens. See PricingSource.Unknown.
MaxRuns
Section titled “ MaxRuns”The maximum number of runs per period. Unlimited if null.
public long? MaxRuns { get; init; }Property Value
Section titled “Property Value”long?
MaxTokens
Section titled “ MaxTokens”The maximum tokens per period. Unlimited if null.
public long? MaxTokens { get; init; }Property Value
Section titled “Property Value”long?
Period
Section titled “ Period”The counter’s reset interval.
public required QuotaPeriod Period { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”The tenant the rule belongs to.
public required string TenantId { get; init; }Property Value
Section titled “Property Value”UpdatedAt
Section titled “ UpdatedAt”The last-updated time (UTC).
public required DateTimeOffset UpdatedAt { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(QuotaDefinition?)
Section titled “ Equals(QuotaDefinition?)”public bool Equals(QuotaDefinition? other)Parameters
Section titled “Parameters”other QuotaDefinition?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(QuotaDefinition?, QuotaDefinition?)
Section titled “ operator ==(QuotaDefinition?, QuotaDefinition?)”public static bool operator ==(QuotaDefinition? left, QuotaDefinition? right)Parameters
Section titled “Parameters”left QuotaDefinition?
right QuotaDefinition?
Returns
Section titled “Returns”operator !=(QuotaDefinition?, QuotaDefinition?)
Section titled “ operator !=(QuotaDefinition?, QuotaDefinition?)”public static bool operator !=(QuotaDefinition? left, QuotaDefinition? right)Parameters
Section titled “Parameters”left QuotaDefinition?
right QuotaDefinition?