Class Expiration (4.8.0)

public sealed class Expiration

Expiration specified by relative timeout or absolute deadline.

Inheritance

object > Expiration

Namespace

Google.Api.Gax

Assembly

Google.Api.Gax.dll

Properties

Deadline

public DateTime? Deadline { get; }

If not null, the absolute deadline of this expiration.

Property Value
Type Description
DateTime

None

public static Expiration None { get; }

An Expiration with no timeout or deadline.

Property Value
Type Description
Expiration
Remarks

Indicates that no expiration is required.

Timeout

public TimeSpan? Timeout { get; }

If not null, the relative timeout of this expiration.

Property Value
Type Description
TimeSpan

Type

public ExpirationType Type { get; }

What ExpirationType is contained in this Expiration.

Property Value
Type Description
ExpirationType

Methods

FromDeadline(DateTime)

public static Expiration FromDeadline(DateTime deadline)

Create an Expiration with an absolute deadline.

Parameter
Name Description
deadline DateTime

The absolute deadline. Should be a UTC datetime.

Returns
Type Description
Expiration

An Expiration with the specified absolute deadline.

Remarks

Deadlines in the past are valid, and will cause immediate failure of the operation being performed.

FromTimeout(TimeSpan)

public static Expiration FromTimeout(TimeSpan timeout)

Create an Expiration with a relative timeout.

Parameter
Name Description
timeout TimeSpan

The relative timeout.

Returns
Type Description
Expiration

An Expiration with the specified relative timeout.

Remarks

Zero or negative timeouts are valid, and will cause immediate failure of the operation being performed.

Extension Method