1 unstable release
0.1.0 | Jan 6, 2022 |
---|
#290 in HTTP client
340KB
5K
SLoC
Rust API client for Strava
The Swagger Playground is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with different endpoints depending on the authorization scope you receive from your athletes. To use the Playground, go to https://www.strava.com/settings/api and change your “Authorization Callback Domain” to developers.strava.com. Please note, we only support Swagger 2.0. There is a known issue where you can only select one scope at a time. For more information, please check the section “client code” at https://developers.strava.com/docs.
Overview
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
- API version: 3.0.0
- Package version: 3.0.0
- Build package:
org.openapitools.codegen.languages.RustClientCodegen
docker run --rm -it \
-v "${PWD}:/host" \
openapitools/openapi-generator-cli \
"generate" \
"-i" "https://developers.strava.com/swagger/swagger.json" \
"-g" "rust" \
"-o" "/host/strava-client" \
"--additional-properties=supportMultipleResponses=true,useSingleRequestParameter=true,packageName=strava_client" \
"--skip-validate-spec"
Installation
Put the package under your project folder in a directory named strava_client
and add the following to Cargo.toml
under [dependencies]
:
strava_client = { path = "./strava_client" }
Documentation for API Endpoints
All URIs are relative to https://www.strava.com/api/v3
Class | Method | HTTP request | Description |
---|---|---|---|
ActivitiesApi | create_activity | POST /activities | Create an Activity |
ActivitiesApi | get_activity_by_id | GET /activities/{id} | Get Activity |
ActivitiesApi | get_comments_by_activity_id | GET /activities/{id}/comments | List Activity Comments |
ActivitiesApi | get_kudoers_by_activity_id | GET /activities/{id}/kudos | List Activity Kudoers |
ActivitiesApi | get_laps_by_activity_id | GET /activities/{id}/laps | List Activity Laps |
ActivitiesApi | get_logged_in_athlete_activities | GET /athlete/activities | List Athlete Activities |
ActivitiesApi | get_zones_by_activity_id | GET /activities/{id}/zones | Get Activity Zones |
ActivitiesApi | update_activity_by_id | PUT /activities/{id} | Update Activity |
AthletesApi | get_logged_in_athlete | GET /athlete | Get Authenticated Athlete |
AthletesApi | get_logged_in_athlete_zones | GET /athlete/zones | Get Zones |
AthletesApi | get_stats | GET /athletes/{id}/stats | Get Athlete Stats |
AthletesApi | update_logged_in_athlete | PUT /athlete | Update Athlete |
ClubsApi | get_club_activities_by_id | GET /clubs/{id}/activities | List Club Activities |
ClubsApi | get_club_admins_by_id | GET /clubs/{id}/admins | List Club Administrators |
ClubsApi | get_club_by_id | GET /clubs/{id} | Get Club |
ClubsApi | get_club_members_by_id | GET /clubs/{id}/members | List Club Members |
ClubsApi | get_logged_in_athlete_clubs | GET /athlete/clubs | List Athlete Clubs |
GearsApi | get_gear_by_id | GET /gear/{id} | Get Equipment |
RoutesApi | get_route_as_gpx | GET /routes/{id}/export_gpx | Export Route GPX |
RoutesApi | get_route_as_tcx | GET /routes/{id}/export_tcx | Export Route TCX |
RoutesApi | get_route_by_id | GET /routes/{id} | Get Route |
RoutesApi | get_routes_by_athlete_id | GET /athletes/{id}/routes | List Athlete Routes |
SegmentEffortsApi | get_efforts_by_segment_id | GET /segment_efforts | List Segment Efforts |
SegmentEffortsApi | get_segment_effort_by_id | GET /segment_efforts/{id} | Get Segment Effort |
SegmentsApi | explore_segments | GET /segments/explore | Explore segments |
SegmentsApi | get_logged_in_athlete_starred_segments | GET /segments/starred | List Starred Segments |
SegmentsApi | get_segment_by_id | GET /segments/{id} | Get Segment |
SegmentsApi | star_segment | PUT /segments/{id}/starred | Star Segment |
StreamsApi | get_activity_streams | GET /activities/{id}/streams | Get Activity Streams |
StreamsApi | get_route_streams | GET /routes/{id}/streams | Get Route Streams |
StreamsApi | get_segment_effort_streams | GET /segment_efforts/{id}/streams | Get Segment Effort Streams |
StreamsApi | get_segment_streams | GET /segments/{id}/streams | Get Segment Streams |
UploadsApi | create_upload | POST /uploads | Upload Activity |
UploadsApi | get_upload_by_id | GET /uploads/{uploadId} | Get Upload |
Documentation For Models
- ActivityStats
- ActivityTotal
- ActivityType
- ActivityZone
- AltitudeStream
- AltitudeStreamAllOf
- BaseStream
- CadenceStream
- CadenceStreamAllOf
- Comment
- DetailedActivity
- DetailedActivityAllOf
- DetailedAthlete
- DetailedAthleteAllOf
- DetailedClub
- DetailedClubAllOf
- DetailedGear
- DetailedGearAllOf
- DetailedSegment
- DetailedSegmentAllOf
- DetailedSegmentEffort
- DetailedSegmentEffortAllOf
- DistanceStream
- DistanceStreamAllOf
- Error
- ExplorerResponse
- ExplorerSegment
- Fault
- HeartRateZoneRanges
- HeartrateStream
- HeartrateStreamAllOf
- Lap
- LatLngStream
- LatLngStreamAllOf
- MetaActivity
- MetaAthlete
- MetaClub
- MovingStream
- MovingStreamAllOf
- PhotosSummary
- PhotosSummaryPrimary
- PolylineMap
- PowerStream
- PowerStreamAllOf
- PowerZoneRanges
- Route
- SmoothGradeStream
- SmoothGradeStreamAllOf
- SmoothVelocityStream
- SmoothVelocityStreamAllOf
- Split
- StreamSet
- SummaryActivity
- SummaryActivityAllOf
- SummaryAthlete
- SummaryAthleteAllOf
- SummaryClub
- SummaryClubAllOf
- SummaryGear
- SummaryPrSegmentEffort
- SummarySegment
- SummarySegmentEffort
- TemperatureStream
- TemperatureStreamAllOf
- TimeStream
- TimeStreamAllOf
- TimedZoneRange
- TimedZoneRangeAllOf
- UpdatableActivity
- Upload
- ZoneRange
- Zones
To get access to the crate's generated documentation, use:
cargo doc --open
Author
Dependencies
~5–20MB
~234K SLoC