Class: OnebusawaySDK::Resources::ReportProblemWithTrip

Inherits:
Object
  • Object
show all
Defined in:
lib/onebusaway_sdk/resources/report_problem_with_trip.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ReportProblemWithTrip

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ReportProblemWithTrip.

Parameters:



61
62
63
# File 'lib/onebusaway_sdk/resources/report_problem_with_trip.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(trip_id, code: nil, service_date: nil, stop_id: nil, user_comment: nil, user_lat: nil, user_location_accuracy: nil, user_lon: nil, user_on_vehicle: nil, user_vehicle_number: nil, vehicle_id: nil, request_options: {}) ⇒ OnebusawaySDK::Models::ResponseWrapper

Submit a user-generated problem report for a particular trip.

Parameters:

  • trip_id (String)

    The ID of the trip

  • code (Symbol, OnebusawaySDK::Models::ReportProblemWithTripRetrieveParams::Code)

    A string code identifying the nature of the problem

  • service_date (Integer)

    The service date of the trip

  • stop_id (String)

    A stop ID indicating where the user is experiencing the problem

  • user_comment (String)

    Additional comment text supplied by the user describing the problem

  • user_lat (Float)

    The reporting user’s current latitude

  • user_location_accuracy (Float)

    The reporting user’s location accuracy, in meters

  • user_lon (Float)

    The reporting user’s current longitude

  • user_on_vehicle (Boolean)

    Indicator if the user is on the transit vehicle experiencing the problem

  • user_vehicle_number (String)

    The vehicle number, as reported by the user

  • vehicle_id (String)

    The vehicle actively serving the trip

  • request_options (OnebusawaySDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/onebusaway_sdk/resources/report_problem_with_trip.rb', line 37

def retrieve(trip_id, params = {})
  parsed, options = OnebusawaySDK::ReportProblemWithTripRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/where/report-problem-with-trip/%1$s.json", trip_id],
    query: parsed.transform_keys(
      service_date: "serviceDate",
      stop_id: "stopID",
      user_comment: "userComment",
      user_lat: "userLat",
      user_location_accuracy: "userLocationAccuracy",
      user_lon: "userLon",
      user_on_vehicle: "userOnVehicle",
      user_vehicle_number: "userVehicleNumber",
      vehicle_id: "vehicleID"
    ),
    model: OnebusawaySDK::ResponseWrapper,
    options: options
  )
end