class OnebusawaySDK::Client

def auth_query

Returns:
  • (Hash{String=>String}) -

Other tags:
    Api: - private
def auth_query
 => @api_key}

def initialize(

Parameters:
  • max_retry_delay (Float) --
  • initial_retry_delay (Float) --
  • timeout (Float) --
  • max_retries (Integer) -- Max number of retries to attempt after a failed retryable request.
  • base_url (String, nil) -- Override the default base URL for the API, e.g.,
  • api_key (String, nil) -- Defaults to `ENV["ONEBUSAWAY_API_KEY"]`
def initialize(
  api_key: ENV["ONEBUSAWAY_API_KEY"],
  base_url: ENV["ONEBUSAWAY_SDK_BASE_URL"],
  max_retries: self.class::DEFAULT_MAX_RETRIES,
  timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
  initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY,
  max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY
)
  base_url ||= "https://api.pugetsound.onebusaway.org"
  if api_key.nil?
    raise ArgumentError.new("api_key is required, and can be set via environ: \"ONEBUSAWAY_API_KEY\"")
  end
  @api_key = api_key.to_s
  super(
    base_url: base_url,
    timeout: timeout,
    max_retries: max_retries,
    initial_retry_delay: initial_retry_delay,
    max_retry_delay: max_retry_delay
  )
  @agencies_with_coverage = OnebusawaySDK::Resources::AgenciesWithCoverage.new(client: self)
  @agency = OnebusawaySDK::Resources::Agency.new(client: self)
  @vehicles_for_agency = OnebusawaySDK::Resources::VehiclesForAgency.new(client: self)
  @config = OnebusawaySDK::Resources::Config.new(client: self)
  @current_time = OnebusawaySDK::Resources::CurrentTime.new(client: self)
  @stops_for_location = OnebusawaySDK::Resources::StopsForLocation.new(client: self)
  @stops_for_route = OnebusawaySDK::Resources::StopsForRoute.new(client: self)
  @stops_for_agency = OnebusawaySDK::Resources::StopsForAgency.new(client: self)
  @stop = OnebusawaySDK::Resources::Stop.new(client: self)
  @stop_ids_for_agency = OnebusawaySDK::Resources::StopIDsForAgency.new(client: self)
  @schedule_for_stop = OnebusawaySDK::Resources::ScheduleForStop.new(client: self)
  @route = OnebusawaySDK::Resources::Route.new(client: self)
  @route_ids_for_agency = OnebusawaySDK::Resources::RouteIDsForAgency.new(client: self)
  @routes_for_location = OnebusawaySDK::Resources::RoutesForLocation.new(client: self)
  @routes_for_agency = OnebusawaySDK::Resources::RoutesForAgency.new(client: self)
  @schedule_for_route = OnebusawaySDK::Resources::ScheduleForRoute.new(client: self)
  @arrival_and_departure = OnebusawaySDK::Resources::ArrivalAndDeparture.new(client: self)
  @trip = OnebusawaySDK::Resources::Trip.new(client: self)
  @trips_for_location = OnebusawaySDK::Resources::TripsForLocation.new(client: self)
  @trip_details = OnebusawaySDK::Resources::TripDetails.new(client: self)
  @trip_for_vehicle = OnebusawaySDK::Resources::TripForVehicle.new(client: self)
  @trips_for_route = OnebusawaySDK::Resources::TripsForRoute.new(client: self)
  @report_problem_with_stop = OnebusawaySDK::Resources::ReportProblemWithStop.new(client: self)
  @report_problem_with_trip = OnebusawaySDK::Resources::ReportProblemWithTrip.new(client: self)
  @search_for_stop = OnebusawaySDK::Resources::SearchForStop.new(client: self)
  @search_for_route = OnebusawaySDK::Resources::SearchForRoute.new(client: self)
  @block = OnebusawaySDK::Resources::Block.new(client: self)
  @shape = OnebusawaySDK::Resources::Shape.new(client: self)
end