Class Expiration
Expiration specified by relative timeout or absolute deadline.
Inheritance
Inherited Members
Namespace: Google.Api.Gax
Assembly: Google.Api.Gax.dll
Syntax
public sealed class Expiration
Properties
Deadline
If not null, the absolute deadline of this expiration.
Declaration
public DateTime? Deadline { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
None
An Expiration with no timeout or deadline.
Declaration
public static Expiration None { get; }
Property Value
Type | Description |
---|---|
Expiration |
Remarks
Indicates that no expiration is required.
Timeout
If not null, the relative timeout of this expiration.
Declaration
public TimeSpan? Timeout { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.TimeSpan> |
Type
What ExpirationType is contained in this Expiration.
Declaration
public ExpirationType Type { get; }
Property Value
Type | Description |
---|---|
ExpirationType |
Methods
FromDeadline(DateTime)
Create an Expiration with an absolute deadline.
Declaration
public static Expiration FromDeadline(DateTime deadline)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | deadline | 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)
Create an Expiration with a relative timeout.
Declaration
public static Expiration FromTimeout(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeout | 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.