Table of Contents

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

Type BucketLockConditionType

The type of lock condition (Age, Date, or Indefinite).

MaxAgeSeconds int?

The retention duration in seconds. Used when Type is Age.

Date DateTime?

The date until which objects are locked. Used when Type is Date.

Properties

Date

The date until which objects are locked. Used when Type is Date.

[JsonPropertyName("date")]
public DateTime? Date { get; init; }

Property Value

DateTime?

MaxAgeSeconds

The retention duration in seconds. Used when Type is Age.

[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

BucketLockConditionType

Methods

ForDays(int)

Creates an age-based lock condition using days.

public static BucketLockCondition ForDays(int days)

Parameters

days int

The 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

seconds int

The 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

date DateTime

The date until which objects should be locked.

Returns

BucketLockCondition

A new BucketLockCondition with Date type.