RetentionPolicy
AgentPrism.Abstractions.dllAn age- and volume-based retention rule for a target.
public sealed record RetentionPolicy : IEquatable<RetentionPolicy>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”If no record exists, nothing is deleted for the target (see
AgentPrismRetentionOptions’ configuration-based defaults — they
take effect only when the database has no record).
Constructors
Section titled “Constructors”RetentionPolicy()
Section titled “ RetentionPolicy()”public RetentionPolicy()Properties
Section titled “Properties”Archive
Section titled “ Archive”Whether to archive with IArchiveSink before deleting. If no
sink is registered, no row is deleted even if this field is
true.
public bool Archive { 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 policy is enabled.
public bool Enabled { get; init; }Property Value
Section titled “Property Value”The policy identifier.
public required Guid Id { get; init; }Property Value
Section titled “Property Value”MaxAgeDays
Section titled “ MaxAgeDays”Rows older than this age are candidates for deletion. If
null, age-based deletion does not apply (only
MaxRows, if set, applies).
public int? MaxAgeDays { get; init; }Property Value
Section titled “Property Value”int?
MaxRows
Section titled “ MaxRows”The maximum number of rows to keep in the target table. The oldest
rows over the limit are deleted. If null,
volume-based deletion does not apply (only MaxAgeDays,
if set, applies).
public long? MaxRows { get; init; }Property Value
Section titled “Property Value”long?
Target
Section titled “ Target”The target table name. See RetentionTargets.
public required string Target { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”The tenant identifier. "*" means the default for all tenants.
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(RetentionPolicy?)
Section titled “ Equals(RetentionPolicy?)”public bool Equals(RetentionPolicy? other)Parameters
Section titled “Parameters”other RetentionPolicy?
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 ==(RetentionPolicy?, RetentionPolicy?)
Section titled “ operator ==(RetentionPolicy?, RetentionPolicy?)”public static bool operator ==(RetentionPolicy? left, RetentionPolicy? right)Parameters
Section titled “Parameters”left RetentionPolicy?
right RetentionPolicy?
Returns
Section titled “Returns”operator !=(RetentionPolicy?, RetentionPolicy?)
Section titled “ operator !=(RetentionPolicy?, RetentionPolicy?)”public static bool operator !=(RetentionPolicy? left, RetentionPolicy? right)Parameters
Section titled “Parameters”left RetentionPolicy?
right RetentionPolicy?