lib/mbta/model/schedule_resource.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.1.0 (https://openapi-generator.tech).
# Do not edit this file manually.

defmodule MBTA.Model.ScheduleResource do
  @moduledoc """
  A schedule is the arrival drop off (`*/attributes/drop_off_type`) time (`*/attributes/arrival_time`) and departure pick up (`*/attributes/pickup_type`) time (`*/attributes/departure_time`) to/from a stop (`*/relationships/stop/data/id`) at a given sequence (`*/attributes/stop_sequence`) along a trip (`*/relationships/trip/data/id`) going in a direction (`*/attributes/direction_id`) on a route (`*/relationships/route/data/id`) when the trip is following a service (`*/relationships/service/data/id`) to determine when it is active.  See [GTFS `stop_times.txt`](https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md#stop_timestxt) for base specification. 
  """

  @derive Jason.Encoder
  defstruct [
    :type,
    :relationships,
    :links,
    :id,
    :attributes
  ]

  @type t :: %__MODULE__{
    :type => String.t | nil,
    :relationships => MBTA.Model.ScheduleResourceRelationships.t | nil,
    :links => map() | nil,
    :id => String.t | nil,
    :attributes => MBTA.Model.ScheduleResourceAttributes.t | nil
  }

  alias MBTA.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:relationships, :struct, MBTA.Model.ScheduleResourceRelationships)
     |> Deserializer.deserialize(:attributes, :struct, MBTA.Model.ScheduleResourceAttributes)
  end
end