Class LifecycleCondition
- Namespace
- Cloudflare.NET.Accounts.Models
- Assembly
- Cloudflare.NET.dll
Represents a condition that triggers a lifecycle transition.
public record LifecycleCondition : IEquatable<LifecycleCondition>
- Inheritance
-
LifecycleCondition
- Implements
- Inherited Members
Constructors
LifecycleCondition(LifecycleConditionType, int?, DateTime?)
Represents a condition that triggers a lifecycle transition.
public LifecycleCondition(LifecycleConditionType Type, int? MaxAge = null, DateTime? Date = null)
Parameters
TypeLifecycleConditionTypeThe type of condition (Age or Date).
MaxAgeint?The age in seconds after which the transition occurs. Used when Type is Age.
DateDateTime?The date on which the transition occurs. Used when Type is Date.
Properties
Date
The date on which the transition occurs. Used when Type is Date.
[JsonPropertyName("date")]
public DateTime? Date { get; init; }
Property Value
MaxAge
The age in seconds after which the transition occurs. Used when Type is Age.
[JsonPropertyName("maxAge")]
public int? MaxAge { get; init; }
Property Value
- int?
Type
The type of condition (Age or Date).
[JsonPropertyName("type")]
public LifecycleConditionType Type { get; init; }
Property Value
Methods
AfterDays(int)
Creates an age-based lifecycle condition using days.
public static LifecycleCondition AfterDays(int days)
Parameters
daysintThe number of days after object creation.
Returns
- LifecycleCondition
A new LifecycleCondition with Age type and MaxAge in seconds.
AfterSeconds(int)
Creates an age-based lifecycle condition using seconds.
public static LifecycleCondition AfterSeconds(int seconds)
Parameters
secondsintThe number of seconds after object creation.
Returns
- LifecycleCondition
A new LifecycleCondition with Age type and MaxAge in seconds.
OnDate(DateTime)
Creates a date-based lifecycle condition.
public static LifecycleCondition OnDate(DateTime date)
Parameters
dateDateTimeThe date on which the transition should occur.
Returns
- LifecycleCondition
A new LifecycleCondition with Date type.