Class Expiration (4.0.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
TypeDescription
Nullable<DateTime>

None

public static Expiration None { get; }

An Expiration with no timeout or deadline.

Property Value
TypeDescription
Expiration
Remarks

Indicates that no expiration is required.

Timeout

public TimeSpan? Timeout { get; }

If not null, the relative timeout of this expiration.

Property Value
TypeDescription
Nullable<TimeSpan>

Type

public ExpirationType Type { get; }

What ExpirationType is contained in this Expiration.

Property Value
TypeDescription
ExpirationType

Methods

FromDeadline(DateTime)

public static Expiration FromDeadline(DateTime deadline)

Create an Expiration with an absolute deadline.

Parameter
NameDescription
deadlineDateTime

The absolute deadline. Should be a UTC datetime.

Returns
TypeDescription
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
NameDescription
timeoutTimeSpan

The relative timeout.

Returns
TypeDescription
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