Geminix.V1beta.Interval (geminix v0.2.0)

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.

Fields:

  • :end_time (DateTime.t/0) - Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.
  • :start_time (DateTime.t/0) - Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.

Summary

Functions

Create a Geminix.V1beta.Interval.t/0 from a map returned by the Gemini API.

Types

t()

@type t() :: %Geminix.V1beta.Interval{
  __meta__: term(),
  end_time: DateTime.t(),
  start_time: DateTime.t()
}

Functions

from_map(schema \\ %__MODULE__{}, map)

@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Create a Geminix.V1beta.Interval.t/0 from a map returned by the Gemini API.

Sometimes, this function should not be applied to the full response body, but instead it should be applied to the correct part of the map in the response body. This depends on the concrete API call.