Table of Contents

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

Type LifecycleConditionType

The type of condition (Age or Date).

MaxAge int?

The age in seconds after which the transition occurs. Used when Type is Age.

Date DateTime?

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

DateTime?

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

LifecycleConditionType

Methods

AfterDays(int)

Creates an age-based lifecycle condition using days.

public static LifecycleCondition AfterDays(int days)

Parameters

days int

The 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

seconds int

The 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

date DateTime

The date on which the transition should occur.

Returns

LifecycleCondition

A new LifecycleCondition with Date type.