Skip to content

Commit

Permalink
Tidy up table
Browse files Browse the repository at this point in the history
  • Loading branch information
tascord committed Apr 8, 2024
1 parent b8313a7 commit d8a2e65
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 67 deletions.
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@

## Status
🟩 ; Complete, 🟦 ; To be tested ([you can help!](https://github.com/tascord/ptvrs/issues/new)), 🟨 ; Needs work, 🟥 ; Avoid use in current state ; ❌ Not implemented, yet.
| Feature | Endpoint<br> | Status | Notes |
|-------------------|----------------------------------------|--------|---------------------------------------|
| **Departures** | /departures/stop/{}<br> | 🟦 | |
| | /departures/route_type/{}/stop/{} | 🟦 | |
| **Directions** | /directions/{} | 🟦 | |
| | /directions/route/{} | 🟦 | |
| | /directions/{}/route_type/{} | 🟦 | |
| **Disruptions** | /disruptions/route/{} | 🟦 | |
| | /disruptions/route/{}/stop/{} | 🟦 | |
| | /disruptions/stop/{} | 🟦 | |
| | /disruptions/{} | 🟦 | |
| **Fare Estimate** | /fare_estimate/min_zone/{}/max_zone/{} | 🟥 | Not enough docs.<br> |
| **Outlets** | /outlets | 🟦 | |
| | /outlets/location/{}/{} | 🟦 | |
| **Patterns** | /pattern/run/{}/route_type/{} | 🟦 | |
| **Routes** | /routes | 🟨 | Types not yet concrete. See docs. |
| | /routes/{} | 🟨 | " |
| **Runs** | /runs/route/{}/route_type/{} | 🟨 | " |
| | /runs/{} | 🟨 | " |
| | /runs/{}/route_type/{} | 🟨 | " |
| | /runs/route/{} | 🟨 | " |
| **Search** | /search/{} || Not implemented |
| **Stops** | /stops/{}/route_type/{} || " |
| | /stops/route/{}/route_type/{ || " |
| | /stops/location/{}/{} || " |
| Feature | Endpoint | Status | Notes |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------- |
| **Departures** | [/departures/route_type/stop/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.departures_stop) | 🟦 | |
| | [/departures/route_type/{}/stop/{}/route/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.departures_stop_route) | 🟦 | |
| **Directions** | [/directions/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.directions_id) | 🟦 | |
| | [/directions/route/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.directions_route) | 🟦 | |
| | [/directions/{}/route_type/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.directions_id_route) | 🟦 | |
| **Disruptions** | [/disruptions](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.disruptions) | 🟦 | |
| | [/disruptions/route/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.disruptions_route) | 🟦 | |
| | [/disruptions/route/{}/stop/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.disruptions_route_stop) | 🟦 | |
| | [/disruptions/stop/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.disruptions_stop) | 🟦 | |
| **Disruptions** | [/disruptions/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.disruptions_id) | 🟦 | |
| **Fare Estimate** | [/fare_estimate/min_zone/{}/max_zone/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.fare_estimate) | 🟥 | Not enough docs. |
| **Outlets** | [/outlets](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.outlets) | 🟦 | |
| | [/outlets/location/{}/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.outlets_lat_long) | 🟦 | |
| **Patterns** | [/pattern/run/{}/route_type/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.patterns_run_route) | 🟦 | |
| **Routes** | [/routes](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.routes) | 🟨 | Types not yet concrete. See docs. |
| | [/routes/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.routes_id) | 🟨 | " |
| **Runs** | [/runs/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.runs_ref) | 🟨 | " |
| | [/runs/route/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.runs_id) | 🟨 | " |
| | [/runs/{}/route_type/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.runs_ref_type) | 🟨 | " |
| | [/runs/route/{}/route_type/{}](https://docs.rs/ptv/latest/ptv/struct.Client.html#method.runs_id_type) | 🟨 | " |
| **Search** | /search/{} || Not implemented |
| **Stops** | /stops/{}/route_type/{} || " |
| | /stops/route/{}/route_type/{} || " |
| | /stops/location/{}/{} || " |
67 changes: 25 additions & 42 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ impl Client {

/* > Directions */

/// View directions that a route travels in
pub async fn directions_route(&self, route_id: i32) -> Result<DirectionsResponse> {
self.rq(format!("v3/directions/route/{}", route_id)).await
}

/// View all routes for a direction of travel
pub async fn directions_id(&self, direction_id: i32) -> Result<DirectionsResponse> {
self.rq(format!("v3/directions/{}", direction_id)).await
}

/// View directions that a route travels in
pub async fn directions_route(&self, route_id: i32) -> Result<DirectionsResponse> {
self.rq(format!("v3/directions/route/{}", route_id)).await
}

/// View all routes of a particular type for a direction of travel
pub async fn directions_id_route(
&self,
Expand All @@ -109,8 +109,7 @@ impl Client {
) -> Result<DirectionsResponse> {
self.rq(format!(
"v3/directions/{}/route_type/{}",
direction_id,
route_type
direction_id, route_type
))
.await
}
Expand Down Expand Up @@ -248,60 +247,44 @@ impl Client {

/* > Runs */

/// View all trip/service runs for a specific route ID
pub async fn runs_id(
&self,
run_id: i32,
options: RunsIdOpts,
) -> Result<RunsResponse> {
self.rq(format!(
"v3/runs/route/{}?{}",
run_id,
to_query(options)
))
.await
/// View all trip/service runs for a specific run_ref
pub async fn runs_ref(&self, run_ref: String, options: RunsRefOpts) -> Result<RunsResponse> {
self.rq(format!("v3/runs/{}?{}", run_ref, to_query(options)))
.await
}

/// View all trip/service runs for a specific run ID and route type
pub async fn runs_id_type(
&self,
run_id: i32,
route_type: RouteType,
options: RunsIdOpts,
) -> Result<RunsResponse> {
self.rq(format!(
"v3/runs/route/{}/route_type/{}?{}",
run_id,
route_type,
to_query(options)
))
.await
/// View all trip/service runs for a specific route ID
pub async fn runs_id(&self, run_id: i32, options: RunsIdOpts) -> Result<RunsResponse> {
self.rq(format!("v3/runs/route/{}?{}", run_id, to_query(options)))
.await
}

/// View all trip/service runs for a specific run_ref
pub async fn runs_ref(
/// View all trip/service runs for a specific run_ref and route type
pub async fn runs_ref_type(
&self,
run_ref: String,
route_type: RouteType,
options: RunsRefOpts,
) -> Result<RunsResponse> {
self.rq(format!(
"v3/runs/{}?{}",
"v3/runs/{}/route_type/{}?{}",
run_ref,
route_type,
to_query(options)
))
.await
}

/// View all trip/service runs for a specific run_ref and route type
pub async fn runs_ref_type(
/// View all trip/service runs for a specific run ID and route type
pub async fn runs_id_type(
&self,
run_ref: String,
run_id: i32,
route_type: RouteType,
options: RunsRefOpts,
options: RunsIdOpts,
) -> Result<RunsResponse> {
self.rq(format!(
"v3/runs/{}/route_type/{}?{}",
run_ref,
"v3/runs/route/{}/route_type/{}?{}",
run_id,
route_type,
to_query(options)
))
Expand Down

0 comments on commit d8a2e65

Please sign in to comment.