[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document provides information about the \u003ccode\u003eExpiration\u003c/code\u003e class in the \u003ccode\u003eGoogle.Api.Gax\u003c/code\u003e namespace, which is used to specify timeouts or deadlines for operations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExpiration\u003c/code\u003e class can represent either a relative timeout using \u003ccode\u003eTimeSpan\u003c/code\u003e or an absolute deadline using \u003ccode\u003eDateTime\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExpiration.None\u003c/code\u003e property indicates that no expiration is required for an operation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFromDeadline\u003c/code\u003e and \u003ccode\u003eFromTimeout\u003c/code\u003e methods provide static factory methods to create \u003ccode\u003eExpiration\u003c/code\u003e instances with either an absolute deadline or a relative timeout, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe class can be used to ensure actions are completed in a certain time frame, and can cause immediate failure of an operation when a timeout or passed deadline is encountered.\u003c/p\u003e\n"]]],[],null,["# Class Expiration (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Expiration)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.Expiration)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.Expiration)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.Expiration)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.Expiration)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.Expiration)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.Expiration) \n\n public sealed class Expiration\n\nExpiration specified by relative timeout or absolute deadline. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Expiration \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Api.Gax](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax)\n\nAssembly\n--------\n\nGoogle.Api.Gax.dll\n\nProperties\n----------\n\n### Deadline\n\n public DateTime? Deadline { get; }\n\nIf not null, the absolute deadline of this expiration.\n\n### None\n\n public static Expiration None { get; }\n\nAn [Expiration](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Expiration) with no timeout or deadline.\n\n**Remarks** \nIndicates that no expiration is required.\n\n### Timeout\n\n public TimeSpan? Timeout { get; }\n\nIf not null, the relative timeout of this expiration.\n\n### Type\n\n public ExpirationType Type { get; }\n\nWhat [ExpirationType](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ExpirationType) is contained in this [Expiration](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Expiration).\n\nMethods\n-------\n\n### FromDeadline(DateTime)\n\n public static Expiration FromDeadline(DateTime deadline)\n\nCreate an [Expiration](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Expiration) with an absolute deadline.\n\n**Remarks** \nDeadlines in the past are valid, and will cause immediate failure of the operation being performed.\n\n### FromTimeout(TimeSpan)\n\n public static Expiration FromTimeout(TimeSpan timeout)\n\nCreate an [Expiration](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Expiration) with a relative timeout.\n\n**Remarks** \nZero or negative timeouts are valid, and will cause immediate failure of the operation being performed.\n\nExtension Method\n----------------\n\n[ExpirationExtensions.CalculateDeadline(Expiration, IClock)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ExpirationExtensions#Google_Api_Gax_ExpirationExtensions_CalculateDeadline_Google_Api_Gax_Expiration_Google_Api_Gax_IClock_)"]]