Class BucketLockCondition
- Namespace
- Cloudflare.NET.Accounts.Models
- Assembly
- Cloudflare.NET.dll
Represents the condition that determines how long objects are locked.
public record BucketLockCondition : IEquatable<BucketLockCondition>
- Inheritance
-
BucketLockCondition
- Implements
- Inherited Members
Constructors
BucketLockCondition(BucketLockConditionType, int?, DateTime?)
Represents the condition that determines how long objects are locked.
public BucketLockCondition(BucketLockConditionType Type, int? MaxAgeSeconds = null, DateTime? Date = null)
Parameters
TypeBucketLockConditionTypeThe type of lock condition (Age, Date, or Indefinite).
MaxAgeSecondsint?DateDateTime?The date until which objects are locked. Used when Type is Date.
Properties
Date
[JsonPropertyName("date")]
public DateTime? Date { get; init; }
Property Value
MaxAgeSeconds
[JsonPropertyName("maxAgeSeconds")]
public int? MaxAgeSeconds { get; init; }
Property Value
- int?
Type
The type of lock condition (Age, Date, or Indefinite).
[JsonPropertyName("type")]
public BucketLockConditionType Type { get; init; }
Property Value
Methods
ForDays(int)
Creates an age-based lock condition using days.
public static BucketLockCondition ForDays(int days)
Parameters
daysintThe number of days to retain objects.
Returns
- BucketLockCondition
A new BucketLockCondition with Age type and MaxAgeSeconds in seconds.
ForSeconds(int)
Creates an age-based lock condition using seconds.
public static BucketLockCondition ForSeconds(int seconds)
Parameters
secondsintThe number of seconds to retain objects.
Returns
- BucketLockCondition
A new BucketLockCondition with Age type and MaxAgeSeconds.
Indefinitely()
Creates an indefinite lock condition (permanent retention).
public static BucketLockCondition Indefinitely()
Returns
- BucketLockCondition
A new BucketLockCondition with Indefinite type.
UntilDate(DateTime)
Creates a date-based lock condition.
public static BucketLockCondition UntilDate(DateTime date)
Parameters
dateDateTimeThe date until which objects should be locked.
Returns
- BucketLockCondition
A new BucketLockCondition with Date type.