Table of Contents

Class Interval

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

public record Interval : IEquatable<Interval>
Inheritance
Interval
Implements
Inherited Members

Properties

EndTime

Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.

[JsonPropertyName("endTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? EndTime { get; set; }

Property Value

DateTime?

StartTime

Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.

[JsonPropertyName("startTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? StartTime { get; set; }

Property Value

DateTime?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a Interval object.

public static Interval? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

Interval

The deserialized Interval object, or null if deserialization fails.