strava

package module
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

README

Go API client for swagger

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 swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 3.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://www.strava.com/api/v3

Class Method HTTP request Description
ActivitiesApi CreateActivity Post /activities Create an Activity
ActivitiesApi GetActivityById Get /activities/{id} Get Activity
ActivitiesApi GetCommentsByActivityId Get /activities/{id}/comments List Activity Comments
ActivitiesApi GetKudoersByActivityId Get /activities/{id}/kudos List Activity Kudoers
ActivitiesApi GetLapsByActivityId Get /activities/{id}/laps List Activity Laps
ActivitiesApi GetLoggedInAthleteActivities Get /athlete/activities List Athlete Activities
ActivitiesApi GetZonesByActivityId Get /activities/{id}/zones Get Activity Zones
ActivitiesApi UpdateActivityById Put /activities/{id} Update Activity
AthletesApi GetLoggedInAthlete Get /athlete Get Authenticated Athlete
AthletesApi GetLoggedInAthleteZones Get /athlete/zones Get Zones
AthletesApi GetStats Get /athletes/{id}/stats Get Athlete Stats
AthletesApi UpdateLoggedInAthlete Put /athlete Update Athlete
ClubsApi GetClubActivitiesById Get /clubs/{id}/activities List Club Activities
ClubsApi GetClubAdminsById Get /clubs/{id}/admins List Club Administrators.
ClubsApi GetClubById Get /clubs/{id} Get Club
ClubsApi GetClubMembersById Get /clubs/{id}/members List Club Members
ClubsApi GetLoggedInAthleteClubs Get /athlete/clubs List Athlete Clubs
GearsApi GetGearById Get /gear/{id} Get Equipment
RoutesApi GetRouteAsGPX Get /routes/{id}/export_gpx Export Route GPX
RoutesApi GetRouteAsTCX Get /routes/{id}/export_tcx Export Route TCX
RoutesApi GetRouteById Get /routes/{id} Get Route
RoutesApi GetRoutesByAthleteId Get /athletes/{id}/routes List Athlete Routes
RunningRacesApi GetRunningRaceById Get /running_races/{id} Get Running Race
RunningRacesApi GetRunningRaces Get /running_races List Running Races
SegmentEffortsApi GetEffortsBySegmentId Get /segments/{id}/all_efforts List Segment Efforts
SegmentEffortsApi GetSegmentEffortById Get /segment_efforts/{id} Get Segment Effort
SegmentsApi ExploreSegments Get /segments/explore Explore segments
SegmentsApi GetLeaderboardBySegmentId Get /segments/{id}/leaderboard Get Segment Leaderboard
SegmentsApi GetLoggedInAthleteStarredSegments Get /segments/starred List Starred Segments
SegmentsApi GetSegmentById Get /segments/{id} Get Segment
SegmentsApi StarSegment Put /segments/{id}/starred Star Segment
StreamsApi GetActivityStreams Get /activities/{id}/streams Get Activity Streams
StreamsApi GetRouteStreams Get /routes/{id}/streams Get Route Streams
StreamsApi GetSegmentEffortStreams Get /segment_efforts/{id}/streams Get Segment Effort Streams
StreamsApi GetSegmentStreams Get /segments/{id}/streams Get Segment Streams
UploadsApi CreateUpload Post /uploads Upload Activity
UploadsApi GetUploadById Get /uploads/{uploadId} Get Upload

Documentation For Models

Documentation For Authorization

strava_oauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://www.strava.com/api/v3/oauth/authorize
  • Scopes:
  • read: Read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
  • read_all: Read private routes, private segments, and private events for the user
  • profile:read_all: Read all profile information even if the user has set their profile visibility to Followers or Only You
  • profile:write: Update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
  • activity:read: Read the user's activity data for activities that are visible to Everyone and Followers, excluding privacy zone data
  • activity:read_all: The same access as activity:read, plus privacy zone data and access to read the user's activities with visibility set to Only You
  • activity:write: Access to create manual activities and uploads, and access to edit any activities that are visible to the app, based on activity read access level

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	ActivitiesApi *ActivitiesApiService

	AthletesApi *AthletesApiService

	ClubsApi *ClubsApiService

	GearsApi *GearsApiService

	RoutesApi *RoutesApiService

	RunningRacesApi *RunningRacesApiService

	SegmentEffortsApi *SegmentEffortsApiService

	SegmentsApi *SegmentsApiService

	StreamsApi *StreamsApiService

	UploadsApi *UploadsApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Strava API v3 API v3.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type ActivitiesApiService

type ActivitiesApiService service

func (*ActivitiesApiService) CreateActivity

func (a *ActivitiesApiService) CreateActivity(ctx context.Context, name string, type_ string, startDateLocal interface{}, elapsedTime int32, localVarOptionals *CreateActivityOpts) (DetailedActivity, *http.Response, error)

func (*ActivitiesApiService) GetActivityById

func (a *ActivitiesApiService) GetActivityById(ctx context.Context, id int64, localVarOptionals *GetActivityByIdOpts) (DetailedActivity, *http.Response, error)

func (*ActivitiesApiService) GetCommentsByActivityId

func (a *ActivitiesApiService) GetCommentsByActivityId(ctx context.Context, id int64, localVarOptionals *GetCommentsByActivityIdOpts) ([]Comment, *http.Response, error)

func (*ActivitiesApiService) GetKudoersByActivityId

func (a *ActivitiesApiService) GetKudoersByActivityId(ctx context.Context, id int32, localVarOptionals *GetKudoersByActivityIdOpts) ([]SummaryAthlete, *http.Response, error)

func (*ActivitiesApiService) GetLapsByActivityId

func (a *ActivitiesApiService) GetLapsByActivityId(ctx context.Context, id int64) ([]Lap, *http.Response, error)

ActivitiesApiService List Activity Laps Returns the laps of an activity identified by an identifier. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the activity.

@return []Lap

func (*ActivitiesApiService) GetLoggedInAthleteActivities

func (a *ActivitiesApiService) GetLoggedInAthleteActivities(ctx context.Context, localVarOptionals *GetLoggedInAthleteActivitiesOpts) ([]SummaryActivity, *http.Response, error)

func (*ActivitiesApiService) GetZonesByActivityId

func (a *ActivitiesApiService) GetZonesByActivityId(ctx context.Context, id int32) ([]ActivityZone, *http.Response, error)

ActivitiesApiService Get Activity Zones Summit Feature. Returns the zones of a given activity. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the activity.

@return []ActivityZone

func (*ActivitiesApiService) UpdateActivityById

func (a *ActivitiesApiService) UpdateActivityById(ctx context.Context, id int64, localVarOptionals *UpdateActivityByIdOpts) (DetailedActivity, *http.Response, error)

type ActivityStats

type ActivityStats struct {
	// The longest distance ridden by the athlete.
	BiggestRideDistance float64 `json:"biggest_ride_distance,omitempty"`
	// The highest climb ridden by the athlete.
	BiggestClimbElevationGain float64 `json:"biggest_climb_elevation_gain,omitempty"`
	// The recent (last 4 weeks) ride stats for the athlete.
	RecentRideTotals *ActivityTotal `json:"recent_ride_totals,omitempty"`
	// The recent (last 4 weeks) run stats for the athlete.
	RecentRunTotals *ActivityTotal `json:"recent_run_totals,omitempty"`
	// The recent (last 4 weeks) swim stats for the athlete.
	RecentSwimTotals *ActivityTotal `json:"recent_swim_totals,omitempty"`
	// The year to date ride stats for the athlete.
	YtdRideTotals *ActivityTotal `json:"ytd_ride_totals,omitempty"`
	// The year to date run stats for the athlete.
	YtdRunTotals *ActivityTotal `json:"ytd_run_totals,omitempty"`
	// The year to date swim stats for the athlete.
	YtdSwimTotals *ActivityTotal `json:"ytd_swim_totals,omitempty"`
	// The all time ride stats for the athlete.
	AllRideTotals *ActivityTotal `json:"all_ride_totals,omitempty"`
	// The all time run stats for the athlete.
	AllRunTotals *ActivityTotal `json:"all_run_totals,omitempty"`
	// The all time swim stats for the athlete.
	AllSwimTotals *ActivityTotal `json:"all_swim_totals,omitempty"`
}

A set of rolled-up statistics and totals for an athlete

type ActivityTotal

type ActivityTotal struct {
	// The number of activities considered in this total.
	Count int32 `json:"count,omitempty"`
	// The total distance covered by the considered activities.
	Distance float32 `json:"distance,omitempty"`
	// The total moving time of the considered activities.
	MovingTime int32 `json:"moving_time,omitempty"`
	// The total elapsed time of the considered activities.
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The total elevation gain of the considered activities.
	ElevationGain float32 `json:"elevation_gain,omitempty"`
	// The total number of achievements of the considered activities.
	AchievementCount int32 `json:"achievement_count,omitempty"`
}

A roll-up of metrics pertaining to a set of activities. Values are in seconds and meters.

type ActivityType

type ActivityType string

ActivityType : An enumeration of the types an activity may have.

const (
	ALPINE_SKI_ActivityType        ActivityType = "AlpineSki"
	BACKCOUNTRY_SKI_ActivityType   ActivityType = "BackcountrySki"
	CANOEING_ActivityType          ActivityType = "Canoeing"
	CROSSFIT_ActivityType          ActivityType = "Crossfit"
	E_BIKE_RIDE_ActivityType       ActivityType = "EBikeRide"
	ELLIPTICAL_ActivityType        ActivityType = "Elliptical"
	GOLF_ActivityType              ActivityType = "Golf"
	HANDCYCLE_ActivityType         ActivityType = "Handcycle"
	HIKE_ActivityType              ActivityType = "Hike"
	ICE_SKATE_ActivityType         ActivityType = "IceSkate"
	INLINE_SKATE_ActivityType      ActivityType = "InlineSkate"
	KAYAKING_ActivityType          ActivityType = "Kayaking"
	KITESURF_ActivityType          ActivityType = "Kitesurf"
	NORDIC_SKI_ActivityType        ActivityType = "NordicSki"
	RIDE_ActivityType              ActivityType = "Ride"
	ROCK_CLIMBING_ActivityType     ActivityType = "RockClimbing"
	ROLLER_SKI_ActivityType        ActivityType = "RollerSki"
	ROWING_ActivityType            ActivityType = "Rowing"
	RUN_ActivityType               ActivityType = "Run"
	SAIL_ActivityType              ActivityType = "Sail"
	SKATEBOARD_ActivityType        ActivityType = "Skateboard"
	SNOWBOARD_ActivityType         ActivityType = "Snowboard"
	SNOWSHOE_ActivityType          ActivityType = "Snowshoe"
	SOCCER_ActivityType            ActivityType = "Soccer"
	STAIR_STEPPER_ActivityType     ActivityType = "StairStepper"
	STAND_UP_PADDLING_ActivityType ActivityType = "StandUpPaddling"
	SURFING_ActivityType           ActivityType = "Surfing"
	SWIM_ActivityType              ActivityType = "Swim"
	VELOMOBILE_ActivityType        ActivityType = "Velomobile"
	VIRTUAL_RIDE_ActivityType      ActivityType = "VirtualRide"
	VIRTUAL_RUN_ActivityType       ActivityType = "VirtualRun"
	WALK_ActivityType              ActivityType = "Walk"
	WEIGHT_TRAINING_ActivityType   ActivityType = "WeightTraining"
	WHEELCHAIR_ActivityType        ActivityType = "Wheelchair"
	WINDSURF_ActivityType          ActivityType = "Windsurf"
	WORKOUT_ActivityType           ActivityType = "Workout"
	YOGA_ActivityType              ActivityType = "Yoga"
)

List of ActivityType

type ActivityZone

type ActivityZone struct {
	Score               int32                  `json:"score,omitempty"`
	DistributionBuckets *TimedZoneDistribution `json:"distribution_buckets,omitempty"`
	Type_               string                 `json:"type,omitempty"`
	SensorBased         bool                   `json:"sensor_based,omitempty"`
	Points              int32                  `json:"points,omitempty"`
	CustomZones         bool                   `json:"custom_zones,omitempty"`
	Max                 int32                  `json:"max,omitempty"`
}

type AltitudeStream

type AltitudeStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of altitude values for this stream, in meters
	Data []float32 `json:"data,omitempty"`
}

type AthletesApiService

type AthletesApiService service

func (*AthletesApiService) GetLoggedInAthlete

func (a *AthletesApiService) GetLoggedInAthlete(ctx context.Context) (DetailedAthlete, *http.Response, error)

AthletesApiService Get Authenticated Athlete Returns the currently authenticated athlete. Tokens with profile:read_all scope will receive a detailed athlete representation; all others will receive a summary representation.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return DetailedAthlete

func (*AthletesApiService) GetLoggedInAthleteZones

func (a *AthletesApiService) GetLoggedInAthleteZones(ctx context.Context) (Zones, *http.Response, error)

AthletesApiService Get Zones Returns the the authenticated athlete's heart rate and power zones. Requires profile:read_all.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Zones

func (*AthletesApiService) GetStats

func (a *AthletesApiService) GetStats(ctx context.Context, id int32, localVarOptionals *GetStatsOpts) (ActivityStats, *http.Response, error)

func (*AthletesApiService) UpdateLoggedInAthlete

func (a *AthletesApiService) UpdateLoggedInAthlete(ctx context.Context, weight float32) (DetailedAthlete, *http.Response, error)

AthletesApiService Update Athlete Update the currently authenticated athlete. Requires profile:write scope.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param weight The weight of the athlete in kilograms.

@return DetailedAthlete

type BaseStream

type BaseStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
}

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type CadenceStream

type CadenceStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of cadence values for this stream, in rotations per minute
	Data []int32 `json:"data,omitempty"`
}

type ClubsApiService

type ClubsApiService service

func (*ClubsApiService) GetClubActivitiesById

func (a *ClubsApiService) GetClubActivitiesById(ctx context.Context, id int32, localVarOptionals *GetClubActivitiesByIdOpts) ([]SummaryActivity, *http.Response, error)

func (*ClubsApiService) GetClubAdminsById

func (a *ClubsApiService) GetClubAdminsById(ctx context.Context, id int32, localVarOptionals *GetClubAdminsByIdOpts) ([]SummaryAthlete, *http.Response, error)

func (*ClubsApiService) GetClubById

func (a *ClubsApiService) GetClubById(ctx context.Context, id int32) (DetailedClub, *http.Response, error)

ClubsApiService Get Club Returns a given club using its identifier.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the club.

@return DetailedClub

func (*ClubsApiService) GetClubMembersById

func (a *ClubsApiService) GetClubMembersById(ctx context.Context, id int32, localVarOptionals *GetClubMembersByIdOpts) ([]SummaryAthlete, *http.Response, error)

func (*ClubsApiService) GetLoggedInAthleteClubs

func (a *ClubsApiService) GetLoggedInAthleteClubs(ctx context.Context, localVarOptionals *GetLoggedInAthleteClubsOpts) ([]SummaryClub, *http.Response, error)

type Comment

type Comment struct {
	// The unique identifier of this comment
	Id int64 `json:"id,omitempty"`
	// The identifier of the activity this comment is related to
	ActivityId int64 `json:"activity_id,omitempty"`
	// The content of the comment
	Text    string          `json:"text,omitempty"`
	Athlete *SummaryAthlete `json:"athlete,omitempty"`
	// The time at which this comment was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
}

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type CreateActivityOpts

type CreateActivityOpts struct {
	Description optional.String
	Distance    optional.Float32
	Trainer     optional.Int32
	Commute     optional.Int32
}

type CreateUploadOpts

type CreateUploadOpts struct {
	File        optional.Interface
	Name        optional.String
	Description optional.String
	Trainer     optional.String
	Commute     optional.String
	DataType    optional.String
	ExternalId  optional.String
}

type DetailedActivity

type DetailedActivity struct {
	// The unique identifier of the activity
	Id int64 `json:"id,omitempty"`
	// The identifier provided at upload time
	ExternalId string `json:"external_id,omitempty"`
	// The identifier of the upload that resulted in this activity
	UploadId int64        `json:"upload_id,omitempty"`
	Athlete  *MetaAthlete `json:"athlete,omitempty"`
	// The name of the activity
	Name string `json:"name,omitempty"`
	// The activity's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The activity's moving time, in seconds
	MovingTime int32 `json:"moving_time,omitempty"`
	// The activity's elapsed time, in seconds
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The activity's total elevation gain.
	TotalElevationGain float32 `json:"total_elevation_gain,omitempty"`
	// The activity's highest elevation, in meters
	ElevHigh float32 `json:"elev_high,omitempty"`
	// The activity's lowest elevation, in meters
	ElevLow float32       `json:"elev_low,omitempty"`
	Type_   *ActivityType `json:"type,omitempty"`
	// The time at which the activity was started.
	StartDate time.Time `json:"start_date,omitempty"`
	// The time at which the activity was started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The timezone of the activity
	Timezone    string  `json:"timezone,omitempty"`
	StartLatlng *LatLng `json:"start_latlng,omitempty"`
	EndLatlng   *LatLng `json:"end_latlng,omitempty"`
	// The number of achievements gained during this activity
	AchievementCount int32 `json:"achievement_count,omitempty"`
	// The number of kudos given for this activity
	KudosCount int32 `json:"kudos_count,omitempty"`
	// The number of comments for this activity
	CommentCount int32 `json:"comment_count,omitempty"`
	// The number of athletes for taking part in a group activity
	AthleteCount int32 `json:"athlete_count,omitempty"`
	// The number of Instagram photos for this activity
	PhotoCount int32 `json:"photo_count,omitempty"`
	// The number of Instagram and Strava photos for this activity
	TotalPhotoCount int32        `json:"total_photo_count,omitempty"`
	Map_            *PolylineMap `json:"map,omitempty"`
	// Whether this activity was recorded on a training machine
	Trainer bool `json:"trainer,omitempty"`
	// Whether this activity is a commute
	Commute bool `json:"commute,omitempty"`
	// Whether this activity was created manually
	Manual bool `json:"manual,omitempty"`
	// Whether this activity is private
	Private bool `json:"private,omitempty"`
	// Whether this activity is flagged
	Flagged bool `json:"flagged,omitempty"`
	// The activity's workout type
	WorkoutType int32 `json:"workout_type,omitempty"`
	// The unique identifier of the upload in string format
	UploadIdStr string `json:"upload_id_str,omitempty"`
	// The activity's average speed, in meters per second
	AverageSpeed float32 `json:"average_speed,omitempty"`
	// The activity's max speed, in meters per second
	MaxSpeed float32 `json:"max_speed,omitempty"`
	// Whether the logged-in athlete has kudoed this activity
	HasKudoed bool `json:"has_kudoed,omitempty"`
	// The id of the gear for the activity
	GearId string `json:"gear_id,omitempty"`
	// The total work done in kilojoules during this activity. Rides only
	Kilojoules float32 `json:"kilojoules,omitempty"`
	// Average power output in watts during this activity. Rides only
	AverageWatts float32 `json:"average_watts,omitempty"`
	// Whether the watts are from a power meter, false if estimated
	DeviceWatts bool `json:"device_watts,omitempty"`
	// Rides with power meter data only
	MaxWatts int32 `json:"max_watts,omitempty"`
	// Similar to Normalized Power. Rides with power meter data only
	WeightedAverageWatts int32 `json:"weighted_average_watts,omitempty"`
	// The description of the activity
	Description string         `json:"description,omitempty"`
	Photos      *PhotosSummary `json:"photos,omitempty"`
	Gear        *SummaryGear   `json:"gear,omitempty"`
	// The number of kilocalories consumed during this activity
	Calories       float32                 `json:"calories,omitempty"`
	SegmentEfforts []DetailedSegmentEffort `json:"segment_efforts,omitempty"`
	// The name of the device used to record the activity
	DeviceName string `json:"device_name,omitempty"`
	// The token used to embed a Strava activity
	EmbedToken string `json:"embed_token,omitempty"`
	// The splits of this activity in metric units (for runs)
	SplitsMetric []Split `json:"splits_metric,omitempty"`
	// The splits of this activity in imperial units (for runs)
	SplitsStandard []Split                 `json:"splits_standard,omitempty"`
	Laps           []Lap                   `json:"laps,omitempty"`
	BestEfforts    []DetailedSegmentEffort `json:"best_efforts,omitempty"`
}

type DetailedAthlete

type DetailedAthlete struct {
	// The unique identifier of the athlete
	Id int32 `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 1 -> \"meta\", 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// The athlete's first name.
	Firstname string `json:"firstname,omitempty"`
	// The athlete's last name.
	Lastname string `json:"lastname,omitempty"`
	// URL to a 62x62 pixel profile picture.
	ProfileMedium string `json:"profile_medium,omitempty"`
	// URL to a 124x124 pixel profile picture.
	Profile string `json:"profile,omitempty"`
	// The athlete's city.
	City string `json:"city,omitempty"`
	// The athlete's state or geographical region.
	State string `json:"state,omitempty"`
	// The athlete's country.
	Country string `json:"country,omitempty"`
	// The athlete's sex.
	Sex string `json:"sex,omitempty"`
	// Whether the currently logged-in athlete follows this athlete.
	Friend string `json:"friend,omitempty"`
	// Whether this athlete follows the currently logged-in athlete.
	Follower string `json:"follower,omitempty"`
	// Deprecated.  Use summit field instead. Whether the athlete has any Summit subscription.
	Premium bool `json:"premium,omitempty"`
	// Whether the athlete has any Summit subscription.
	Summit bool `json:"summit,omitempty"`
	// The time at which the athlete was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// The time at which the athlete was last updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The athlete's follower count.
	FollowerCount int32 `json:"follower_count,omitempty"`
	// The athlete's friend count.
	FriendCount int32 `json:"friend_count,omitempty"`
	// The number or athletes mutually followed by this athlete and the currently logged-in athlete.
	MutualFriendCount int32 `json:"mutual_friend_count,omitempty"`
	// The athlete's preferred unit system.
	MeasurementPreference string `json:"measurement_preference,omitempty"`
	// The athlete's FTP (Functional Threshold Power).
	Ftp int32 `json:"ftp,omitempty"`
	// The athlete's weight.
	Weight float32 `json:"weight,omitempty"`
	// The athlete's clubs.
	Clubs []SummaryClub `json:"clubs,omitempty"`
	// The athlete's bikes.
	Bikes []SummaryGear `json:"bikes,omitempty"`
	// The athlete's shoes.
	Shoes []SummaryGear `json:"shoes,omitempty"`
}

type DetailedClub

type DetailedClub struct {
	// The club's unique identifier.
	Id int32 `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 1 -> \"meta\", 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// The club's name.
	Name string `json:"name,omitempty"`
	// URL to a 60x60 pixel profile picture.
	ProfileMedium string `json:"profile_medium,omitempty"`
	// URL to a ~1185x580 pixel cover photo.
	CoverPhoto string `json:"cover_photo,omitempty"`
	// URL to a ~360x176  pixel cover photo.
	CoverPhotoSmall string `json:"cover_photo_small,omitempty"`
	SportType       string `json:"sport_type,omitempty"`
	// The club's city.
	City string `json:"city,omitempty"`
	// The club's state or geographical region.
	State string `json:"state,omitempty"`
	// The club's country.
	Country string `json:"country,omitempty"`
	// Whether the club is private.
	Private bool `json:"private,omitempty"`
	// The club's member count.
	MemberCount int32 `json:"member_count,omitempty"`
	// Whether the club is featured or not.
	Featured bool `json:"featured,omitempty"`
	// Whether the club is verified or not.
	Verified bool `json:"verified,omitempty"`
	// The club's vanity URL.
	Url string `json:"url,omitempty"`
	// The membership status of the logged-in athlete.
	Membership string `json:"membership,omitempty"`
	// Whether the currently logged-in athlete is an administrator of this club.
	Admin bool `json:"admin,omitempty"`
	// Whether the currently logged-in athlete is the owner of this club.
	Owner bool `json:"owner,omitempty"`
	// The number of athletes in the club that the logged-in athlete follows.
	FollowingCount int32 `json:"following_count,omitempty"`
}

type DetailedGear

type DetailedGear struct {
	// The gear's unique identifier.
	Id string `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// Whether this gear's is the owner's default one.
	Primary bool `json:"primary,omitempty"`
	// The gear's name.
	Name string `json:"name,omitempty"`
	// The distance logged with this gear.
	Distance float32 `json:"distance,omitempty"`
	// The gear's brand name.
	BrandName string `json:"brand_name,omitempty"`
	// The gear's model name.
	ModelName string `json:"model_name,omitempty"`
	// The gear's frame type (bike only).
	FrameType int32 `json:"frame_type,omitempty"`
	// The gear's description.
	Description string `json:"description,omitempty"`
}

type DetailedSegment

type DetailedSegment struct {
	// The unique identifier of this segment
	Id int64 `json:"id,omitempty"`
	// The name of this segment
	Name         string `json:"name,omitempty"`
	ActivityType string `json:"activity_type,omitempty"`
	// The segment's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The segment's average grade, in percents
	AverageGrade float32 `json:"average_grade,omitempty"`
	// The segments's maximum grade, in percents
	MaximumGrade float32 `json:"maximum_grade,omitempty"`
	// The segments's highest elevation, in meters
	ElevationHigh float32 `json:"elevation_high,omitempty"`
	// The segments's lowest elevation, in meters
	ElevationLow float32 `json:"elevation_low,omitempty"`
	StartLatlng  *LatLng `json:"start_latlng,omitempty"`
	EndLatlng    *LatLng `json:"end_latlng,omitempty"`
	// The category of the climb [0, 5]. Higher is harder ie. 5 is Hors catégorie, 0 is uncategorized in climb_category.
	ClimbCategory int32 `json:"climb_category,omitempty"`
	// The segments's city.
	City string `json:"city,omitempty"`
	// The segments's state or geographical region.
	State string `json:"state,omitempty"`
	// The segment's country.
	Country string `json:"country,omitempty"`
	// Whether this segment is private.
	Private         bool                  `json:"private,omitempty"`
	AthletePrEffort *SummarySegmentEffort `json:"athlete_pr_effort,omitempty"`
	// The time at which the segment was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// The time at which the segment was last updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The segment's total elevation gain.
	TotalElevationGain float32      `json:"total_elevation_gain,omitempty"`
	Map_               *PolylineMap `json:"map,omitempty"`
	// The total number of efforts for this segment
	EffortCount int32 `json:"effort_count,omitempty"`
	// The number of unique athletes who have an effort for this segment
	AthleteCount int32 `json:"athlete_count,omitempty"`
	// Whether this segment is considered hazardous
	Hazardous bool `json:"hazardous,omitempty"`
	// The number of stars for this segment
	StarCount int32 `json:"star_count,omitempty"`
}

type DetailedSegmentEffort

type DetailedSegmentEffort struct {
	// The unique identifier of this effort
	Id int64 `json:"id,omitempty"`
	// The effort's elapsed time
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The time at which the effort was started.
	StartDate time.Time `json:"start_date,omitempty"`
	// The time at which the effort was started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The effort's distance in meters
	Distance float32 `json:"distance,omitempty"`
	// Whether this effort is the current best on the leaderboard
	IsKom bool `json:"is_kom,omitempty"`
	// The name of the segment on which this effort was performed
	Name     string        `json:"name,omitempty"`
	Activity *MetaActivity `json:"activity,omitempty"`
	Athlete  *MetaAthlete  `json:"athlete,omitempty"`
	// The effort's moving time
	MovingTime int32 `json:"moving_time,omitempty"`
	// The start index of this effort in its activity's stream
	StartIndex int32 `json:"start_index,omitempty"`
	// The end index of this effort in its activity's stream
	EndIndex int32 `json:"end_index,omitempty"`
	// The effort's average cadence
	AverageCadence float32 `json:"average_cadence,omitempty"`
	// The average wattage of this effort
	AverageWatts float32 `json:"average_watts,omitempty"`
	// For riding efforts, whether the wattage was reported by a dedicated recording device
	DeviceWatts bool `json:"device_watts,omitempty"`
	// The heart heart rate of the athlete during this effort
	AverageHeartrate float32 `json:"average_heartrate,omitempty"`
	// The maximum heart rate of the athlete during this effort
	MaxHeartrate float32         `json:"max_heartrate,omitempty"`
	Segment      *SummarySegment `json:"segment,omitempty"`
	// The rank of the effort on the global leaderboard if it belongs in the top 10 at the time of upload
	KomRank int32 `json:"kom_rank,omitempty"`
	// The rank of the effort on the athlete's leaderboard if it belongs in the top 3 at the time of upload
	PrRank int32 `json:"pr_rank,omitempty"`
	// Whether this effort should be hidden when viewed within an activity
	Hidden bool `json:"hidden,omitempty"`
}

type DistanceStream

type DistanceStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of distance values for this stream, in meters
	Data []float32 `json:"data,omitempty"`
}

type ExploreSegmentsOpts

type ExploreSegmentsOpts struct {
	ActivityType optional.String
	MinCat       optional.Int32
	MaxCat       optional.Int32
}

type ExplorerResponse

type ExplorerResponse struct {
	// The set of segments matching an explorer request
	Segments []ExplorerSegment `json:"segments,omitempty"`
}

type ExplorerSegment

type ExplorerSegment struct {
	// The unique identifier of this segment
	Id int64 `json:"id,omitempty"`
	// The name of this segment
	Name string `json:"name,omitempty"`
	// The category of the climb [0, 5]. Higher is harder ie. 5 is Hors catégorie, 0 is uncategorized in climb_category. If climb_category = 5, climb_category_desc = HC. If climb_category = 2, climb_category_desc = 3.
	ClimbCategory int32 `json:"climb_category,omitempty"`
	// The description for the category of the climb
	ClimbCategoryDesc string `json:"climb_category_desc,omitempty"`
	// The segment's average grade, in percents
	AvgGrade    float32 `json:"avg_grade,omitempty"`
	StartLatlng *LatLng `json:"start_latlng,omitempty"`
	EndLatlng   *LatLng `json:"end_latlng,omitempty"`
	// The segments's evelation difference, in meters
	ElevDifference float32 `json:"elev_difference,omitempty"`
	// The segment's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The polyline of the segment
	Points string `json:"points,omitempty"`
}

type Fault

type Fault struct {
	// The set of specific errors associated with this fault, if any.
	Errors []ModelError `json:"errors,omitempty"`
	// The message of the fault.
	Message string `json:"message,omitempty"`
}

Encapsulates the errors that may be returned from the API.

type GearsApiService

type GearsApiService service

func (*GearsApiService) GetGearById

func (a *GearsApiService) GetGearById(ctx context.Context, id string) (DetailedGear, *http.Response, error)

GearsApiService Get Equipment Returns an equipment using its identifier.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the gear.

@return DetailedGear

type GenericSwaggerError

type GenericSwaggerError struct {
	// contains filtered or unexported fields
}

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type GetActivityByIdOpts

type GetActivityByIdOpts struct {
	IncludeAllEfforts optional.Bool
}

type GetClubActivitiesByIdOpts

type GetClubActivitiesByIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetClubAdminsByIdOpts

type GetClubAdminsByIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetClubMembersByIdOpts

type GetClubMembersByIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetCommentsByActivityIdOpts

type GetCommentsByActivityIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetEffortsBySegmentIdOpts

type GetEffortsBySegmentIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetKudoersByActivityIdOpts

type GetKudoersByActivityIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetLeaderboardBySegmentIdOpts

type GetLeaderboardBySegmentIdOpts struct {
	Gender         optional.String
	AgeGroup       optional.String
	WeightClass    optional.String
	Following      optional.Bool
	ClubId         optional.Int64
	DateRange      optional.String
	ContextEntries optional.Int32
	Page           optional.Int32
	PerPage        optional.Int32
}

type GetLoggedInAthleteActivitiesOpts

type GetLoggedInAthleteActivitiesOpts struct {
	Before  optional.Int64
	After   optional.Int64
	Page    optional.Int32
	PerPage optional.Int32
}

type GetLoggedInAthleteClubsOpts

type GetLoggedInAthleteClubsOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetLoggedInAthleteStarredSegmentsOpts

type GetLoggedInAthleteStarredSegmentsOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetRoutesByAthleteIdOpts

type GetRoutesByAthleteIdOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type GetRunningRacesOpts

type GetRunningRacesOpts struct {
	Year optional.Int32
}

type GetStatsOpts

type GetStatsOpts struct {
	Page    optional.Int32
	PerPage optional.Int32
}

type HeartRateZoneRanges

type HeartRateZoneRanges struct {
	// Whether the athlete has set their own custom heart rate zones
	CustomZones bool        `json:"custom_zones,omitempty"`
	Zones       *ZoneRanges `json:"zones,omitempty"`
}

type HeartrateStream

type HeartrateStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of heart rate values for this stream, in beats per minute
	Data []int32 `json:"data,omitempty"`
}

type Lap

type Lap struct {
	// The unique identifier of this lap
	Id       int64         `json:"id,omitempty"`
	Activity *MetaActivity `json:"activity,omitempty"`
	Athlete  *MetaAthlete  `json:"athlete,omitempty"`
	// The lap's average cadence
	AverageCadence float32 `json:"average_cadence,omitempty"`
	// The lap's average speed
	AverageSpeed float32 `json:"average_speed,omitempty"`
	// The lap's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The lap's elapsed time, in seconds
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The start index of this effort in its activity's stream
	StartIndex int32 `json:"start_index,omitempty"`
	// The end index of this effort in its activity's stream
	EndIndex int32 `json:"end_index,omitempty"`
	// The index of this lap in the activity it belongs to
	LapIndex int32 `json:"lap_index,omitempty"`
	// The maximum speed of this lat, in meters per second
	MaxSpeed float32 `json:"max_speed,omitempty"`
	// The lap's moving time, in seconds
	MovingTime int32 `json:"moving_time,omitempty"`
	// The name of the lap
	Name string `json:"name,omitempty"`
	// The athlete's pace zone during this lap
	PaceZone int32 `json:"pace_zone,omitempty"`
	Split    int32 `json:"split,omitempty"`
	// The time at which the lap was started.
	StartDate time.Time `json:"start_date,omitempty"`
	// The time at which the lap was started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The elevation gain of this lap, in meters
	TotalElevationGain float32 `json:"total_elevation_gain,omitempty"`
}

type LatLng

type LatLng [2]float64

A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.

type LatLngStream

type LatLngStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of lat/long values for this stream
	Data []LatLng `json:"data,omitempty"`
}

type MetaActivity

type MetaActivity struct {
	// The unique identifier of the activity
	Id int64 `json:"id,omitempty"`
}

type MetaAthlete

type MetaAthlete struct {
	// The unique identifier of the athlete
	Id int32 `json:"id,omitempty"`
}

type MetaClub

type MetaClub struct {
	// The club's unique identifier.
	Id int32 `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 1 -> \"meta\", 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// The club's name.
	Name string `json:"name,omitempty"`
}

type ModelError

type ModelError struct {
	// The code associated with this error.
	Code string `json:"code,omitempty"`
	// The specific field or aspect of the resource associated with this error.
	Field string `json:"field,omitempty"`
	// The type of resource associated with this error.
	Resource string `json:"resource,omitempty"`
}

type MovingStream

type MovingStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of moving values for this stream, as boolean values
	Data []bool `json:"data,omitempty"`
}

type PhotosSummary

type PhotosSummary struct {
	// The number of photos
	Count   int32                 `json:"count,omitempty"`
	Primary *PhotosSummaryPrimary `json:"primary,omitempty"`
}

type PhotosSummaryPrimary

type PhotosSummaryPrimary struct {
	Id       int64             `json:"id,omitempty"`
	Source   int32             `json:"source,omitempty"`
	UniqueId string            `json:"unique_id,omitempty"`
	Urls     map[string]string `json:"urls,omitempty"`
}

type PolylineMap

type PolylineMap struct {
	// The identifier of the map
	Id string `json:"id,omitempty"`
	// The polyline of the map, only returned on detailed representation of an object
	Polyline string `json:"polyline,omitempty"`
	// The summary polyline of the map
	SummaryPolyline string `json:"summary_polyline,omitempty"`
}

type PowerStream

type PowerStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of power values for this stream, in watts
	Data []int32 `json:"data,omitempty"`
}

type PowerZoneRanges

type PowerZoneRanges struct {
	Zones *ZoneRanges `json:"zones,omitempty"`
}

type Route

type Route struct {
	Athlete *SummaryAthlete `json:"athlete,omitempty"`
	// The description of the route
	Description string `json:"description,omitempty"`
	// The route's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The route's elevation gain.
	ElevationGain float32 `json:"elevation_gain,omitempty"`
	// The unique identifier of this route
	Id   int32        `json:"id,omitempty"`
	Map_ *PolylineMap `json:"map,omitempty"`
	// The name of this route
	Name string `json:"name,omitempty"`
	// Whether this route is private
	Private bool `json:"private,omitempty"`
	// Whether this route is starred by the logged-in athlete
	Starred bool `json:"starred,omitempty"`
	// An epoch timestamp of when the route was created
	Timestamp int32 `json:"timestamp,omitempty"`
	// This route's type (1 for ride, 2 for runs)
	Type_ int32 `json:"type,omitempty"`
	// This route's sub-type (1 for road, 2 for mountain bike, 3 for cross, 4 for trail, 5 for mixed)
	SubType int32 `json:"sub_type,omitempty"`
	// The segments traversed by this route
	Segments []SummarySegment `json:"segments,omitempty"`
}

type RoutesApiService

type RoutesApiService service

func (*RoutesApiService) GetRouteAsGPX

func (a *RoutesApiService) GetRouteAsGPX(ctx context.Context, id int32) (*http.Response, error)

RoutesApiService Export Route GPX Returns a GPX file of the route. Requires read_all scope for private routes.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the route.

func (*RoutesApiService) GetRouteAsTCX

func (a *RoutesApiService) GetRouteAsTCX(ctx context.Context, id int32) (*http.Response, error)

RoutesApiService Export Route TCX Returns a TCX file of the route. Requires read_all scope for private routes.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the route.

func (*RoutesApiService) GetRouteById

func (a *RoutesApiService) GetRouteById(ctx context.Context, id int32) (Route, *http.Response, error)

RoutesApiService Get Route Returns a route using its identifier. Requires read_all scope for private routes.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the route.

@return Route

func (*RoutesApiService) GetRoutesByAthleteId

func (a *RoutesApiService) GetRoutesByAthleteId(ctx context.Context, id int32, localVarOptionals *GetRoutesByAthleteIdOpts) ([]Route, *http.Response, error)

type RunningRace

type RunningRace struct {
	// The unique identifier of this race.
	Id int32 `json:"id,omitempty"`
	// The name of this race.
	Name string `json:"name,omitempty"`
	// The type of this race.
	RunningRaceType int32 `json:"running_race_type,omitempty"`
	// The race's distance, in meters.
	Distance float32 `json:"distance,omitempty"`
	// The time at which the race begins started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The name of the city in which the race is taking place.
	City string `json:"city,omitempty"`
	// The name of the state or geographical region in which the race is taking place.
	State string `json:"state,omitempty"`
	// The name of the country in which the race is taking place.
	Country string `json:"country,omitempty"`
	// The set of routes that cover this race's course.
	RouteIds []int32 `json:"route_ids,omitempty"`
	// The unit system in which the race should be displayed.
	MeasurementPreference string `json:"measurement_preference,omitempty"`
	// The vanity URL of this race on Strava.
	Url string `json:"url,omitempty"`
	// The URL of this race's website.
	WebsiteUrl string `json:"website_url,omitempty"`
}

type RunningRacesApiService

type RunningRacesApiService service

func (*RunningRacesApiService) GetRunningRaceById

func (a *RunningRacesApiService) GetRunningRaceById(ctx context.Context, id int32) (RunningRace, *http.Response, error)

RunningRacesApiService Get Running Race Returns a running race for a given identifier.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the running race.

@return RunningRace

func (*RunningRacesApiService) GetRunningRaces

func (a *RunningRacesApiService) GetRunningRaces(ctx context.Context, localVarOptionals *GetRunningRacesOpts) ([]RunningRace, *http.Response, error)

type SegmentEffortsApiService

type SegmentEffortsApiService service

func (*SegmentEffortsApiService) GetEffortsBySegmentId

func (a *SegmentEffortsApiService) GetEffortsBySegmentId(ctx context.Context, id int32, localVarOptionals *GetEffortsBySegmentIdOpts) ([]DetailedSegmentEffort, *http.Response, error)

func (*SegmentEffortsApiService) GetSegmentEffortById

func (a *SegmentEffortsApiService) GetSegmentEffortById(ctx context.Context, id int64) (DetailedSegmentEffort, *http.Response, error)

SegmentEffortsApiService Get Segment Effort Returns a segment effort from an activity that is owned by the authenticated athlete.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the segment effort.

@return DetailedSegmentEffort

type SegmentLeaderboard

type SegmentLeaderboard struct {
	// The total number of entries for this leaderboard
	EntryCount int32 `json:"entry_count,omitempty"`
	// Deprecated, use entry_count
	EffortCount int32                     `json:"effort_count,omitempty"`
	KomType     string                    `json:"kom_type,omitempty"`
	Entries     []SegmentLeaderboardEntry `json:"entries,omitempty"`
}

A

type SegmentLeaderboardEntry

type SegmentLeaderboardEntry struct {
	// The public name of the athlete
	AthleteName string `json:"athlete_name,omitempty"`
	// The elapsed of the segment effort associated with this entry
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The moving of the segment effort associated with this entry
	MovingTime int32 `json:"moving_time,omitempty"`
	// The time at which the effort was started.
	StartDate time.Time `json:"start_date,omitempty"`
	// The time at which the effort was started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The rank of this entry in the leaderboard
	Rank int32 `json:"rank,omitempty"`
}

A row in a segment leaderboard

type SegmentsApiService

type SegmentsApiService service

func (*SegmentsApiService) ExploreSegments

func (a *SegmentsApiService) ExploreSegments(ctx context.Context, bounds []float32, localVarOptionals *ExploreSegmentsOpts) (ExplorerResponse, *http.Response, error)

func (*SegmentsApiService) GetLeaderboardBySegmentId

func (a *SegmentsApiService) GetLeaderboardBySegmentId(ctx context.Context, id int64, localVarOptionals *GetLeaderboardBySegmentIdOpts) (SegmentLeaderboard, *http.Response, error)

func (*SegmentsApiService) GetLoggedInAthleteStarredSegments

func (a *SegmentsApiService) GetLoggedInAthleteStarredSegments(ctx context.Context, localVarOptionals *GetLoggedInAthleteStarredSegmentsOpts) ([]SummarySegment, *http.Response, error)

func (*SegmentsApiService) GetSegmentById

func (a *SegmentsApiService) GetSegmentById(ctx context.Context, id int64) (DetailedSegment, *http.Response, error)

SegmentsApiService Get Segment Returns the specified segment. read_all scope required in order to retrieve athlete-specific segment information, or to retrieve private segments.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the segment.

@return DetailedSegment

func (*SegmentsApiService) StarSegment

func (a *SegmentsApiService) StarSegment(ctx context.Context, id int64, starred bool) (DetailedSegment, *http.Response, error)

SegmentsApiService Star Segment Stars/Unstars the given segment for the authenticated athlete. Requires profile:write scope.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the segment to star.
  • @param starred If true, star the segment; if false, unstar the segment.

@return DetailedSegment

type SmoothGradeStream

type SmoothGradeStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of grade values for this stream, as percents of a grade
	Data []float32 `json:"data,omitempty"`
}

type SmoothVelocityStream

type SmoothVelocityStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of velocity values for this stream, in meters per second
	Data []float32 `json:"data,omitempty"`
}

type Split

type Split struct {
	// The average speed of this split, in meters per second
	AverageSpeed float32 `json:"average_speed,omitempty"`
	// The distance of this split, in meters
	Distance float32 `json:"distance,omitempty"`
	// The elapsed time of this split, in seconds
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The elevation difference of this split, in meters
	ElevationDifference float32 `json:"elevation_difference,omitempty"`
	// The pacing zone of this split
	PaceZone int32 `json:"pace_zone,omitempty"`
	// The moving time of this split, in seconds
	MovingTime int32 `json:"moving_time,omitempty"`
	// N/A
	Split int32 `json:"split,omitempty"`
}

type StreamSet

type StreamSet struct {
	Time           *TimeStream           `json:"time,omitempty"`
	Distance       *DistanceStream       `json:"distance,omitempty"`
	Latlng         *LatLngStream         `json:"latlng,omitempty"`
	Altitude       *AltitudeStream       `json:"altitude,omitempty"`
	VelocitySmooth *SmoothVelocityStream `json:"velocity_smooth,omitempty"`
	Heartrate      *HeartrateStream      `json:"heartrate,omitempty"`
	Cadence        *CadenceStream        `json:"cadence,omitempty"`
	Watts          *PowerStream          `json:"watts,omitempty"`
	Temp           *TemperatureStream    `json:"temp,omitempty"`
	Moving         *MovingStream         `json:"moving,omitempty"`
	GradeSmooth    *SmoothGradeStream    `json:"grade_smooth,omitempty"`
}

type StreamsApiService

type StreamsApiService service

func (*StreamsApiService) GetActivityStreams

func (a *StreamsApiService) GetActivityStreams(ctx context.Context, id int64, keys []string, keyByType bool) (StreamSet, *http.Response, error)

StreamsApiService Get Activity Streams Returns the given activity's streams. Requires activity:read scope. Requires activity:read_all scope for Only Me activities.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the activity.
  • @param keys Desired stream types.
  • @param keyByType Must be true.

@return StreamSet

func (*StreamsApiService) GetRouteStreams

func (a *StreamsApiService) GetRouteStreams(ctx context.Context, id int64) (StreamSet, *http.Response, error)

StreamsApiService Get Route Streams Returns the given route's streams. Requires read_all scope for private routes.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the route.

@return StreamSet

func (*StreamsApiService) GetSegmentEffortStreams

func (a *StreamsApiService) GetSegmentEffortStreams(ctx context.Context, id int64, keys []string, keyByType bool) (StreamSet, *http.Response, error)

StreamsApiService Get Segment Effort Streams Returns a set of streams for a segment effort completed by the authenticated athlete. Requires read_all scope.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the segment effort.
  • @param keys The types of streams to return.
  • @param keyByType Must be true.

@return StreamSet

func (*StreamsApiService) GetSegmentStreams

func (a *StreamsApiService) GetSegmentStreams(ctx context.Context, id int64, keys []string, keyByType bool) (StreamSet, *http.Response, error)

StreamsApiService Get Segment Streams Returns the given segment's streams. Requires read_all scope for private segments.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The identifier of the segment.
  • @param keys The types of streams to return.
  • @param keyByType Must be true.

@return StreamSet

type SummaryActivity

type SummaryActivity struct {
	// The unique identifier of the activity
	Id int64 `json:"id,omitempty"`
	// The identifier provided at upload time
	ExternalId string `json:"external_id,omitempty"`
	// The identifier of the upload that resulted in this activity
	UploadId int64        `json:"upload_id,omitempty"`
	Athlete  *MetaAthlete `json:"athlete,omitempty"`
	// The name of the activity
	Name string `json:"name,omitempty"`
	// The activity's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The activity's moving time, in seconds
	MovingTime int32 `json:"moving_time,omitempty"`
	// The activity's elapsed time, in seconds
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The activity's total elevation gain.
	TotalElevationGain float32 `json:"total_elevation_gain,omitempty"`
	// The activity's highest elevation, in meters
	ElevHigh float32 `json:"elev_high,omitempty"`
	// The activity's lowest elevation, in meters
	ElevLow float32       `json:"elev_low,omitempty"`
	Type_   *ActivityType `json:"type,omitempty"`
	// The time at which the activity was started.
	StartDate time.Time `json:"start_date,omitempty"`
	// The time at which the activity was started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The timezone of the activity
	Timezone    string  `json:"timezone,omitempty"`
	StartLatlng *LatLng `json:"start_latlng,omitempty"`
	EndLatlng   *LatLng `json:"end_latlng,omitempty"`
	// The number of achievements gained during this activity
	AchievementCount int32 `json:"achievement_count,omitempty"`
	// The number of kudos given for this activity
	KudosCount int32 `json:"kudos_count,omitempty"`
	// The number of comments for this activity
	CommentCount int32 `json:"comment_count,omitempty"`
	// The number of athletes for taking part in a group activity
	AthleteCount int32 `json:"athlete_count,omitempty"`
	// The number of Instagram photos for this activity
	PhotoCount int32 `json:"photo_count,omitempty"`
	// The number of Instagram and Strava photos for this activity
	TotalPhotoCount int32        `json:"total_photo_count,omitempty"`
	Map_            *PolylineMap `json:"map,omitempty"`
	// Whether this activity was recorded on a training machine
	Trainer bool `json:"trainer,omitempty"`
	// Whether this activity is a commute
	Commute bool `json:"commute,omitempty"`
	// Whether this activity was created manually
	Manual bool `json:"manual,omitempty"`
	// Whether this activity is private
	Private bool `json:"private,omitempty"`
	// Whether this activity is flagged
	Flagged bool `json:"flagged,omitempty"`
	// The activity's workout type
	WorkoutType int32 `json:"workout_type,omitempty"`
	// The unique identifier of the upload in string format
	UploadIdStr string `json:"upload_id_str,omitempty"`
	// The activity's average speed, in meters per second
	AverageSpeed float32 `json:"average_speed,omitempty"`
	// The activity's max speed, in meters per second
	MaxSpeed float32 `json:"max_speed,omitempty"`
	// Whether the logged-in athlete has kudoed this activity
	HasKudoed bool `json:"has_kudoed,omitempty"`
	// The id of the gear for the activity
	GearId string `json:"gear_id,omitempty"`
	// The total work done in kilojoules during this activity. Rides only
	Kilojoules float32 `json:"kilojoules,omitempty"`
	// Average power output in watts during this activity. Rides only
	AverageWatts float32 `json:"average_watts,omitempty"`
	// Whether the watts are from a power meter, false if estimated
	DeviceWatts bool `json:"device_watts,omitempty"`
	// Rides with power meter data only
	MaxWatts int32 `json:"max_watts,omitempty"`
	// Similar to Normalized Power. Rides with power meter data only
	WeightedAverageWatts int32 `json:"weighted_average_watts,omitempty"`
}

type SummaryAthlete

type SummaryAthlete struct {
	// The unique identifier of the athlete
	Id int32 `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 1 -> \"meta\", 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// The athlete's first name.
	Firstname string `json:"firstname,omitempty"`
	// The athlete's last name.
	Lastname string `json:"lastname,omitempty"`
	// URL to a 62x62 pixel profile picture.
	ProfileMedium string `json:"profile_medium,omitempty"`
	// URL to a 124x124 pixel profile picture.
	Profile string `json:"profile,omitempty"`
	// The athlete's city.
	City string `json:"city,omitempty"`
	// The athlete's state or geographical region.
	State string `json:"state,omitempty"`
	// The athlete's country.
	Country string `json:"country,omitempty"`
	// The athlete's sex.
	Sex string `json:"sex,omitempty"`
	// Whether the currently logged-in athlete follows this athlete.
	Friend string `json:"friend,omitempty"`
	// Whether this athlete follows the currently logged-in athlete.
	Follower string `json:"follower,omitempty"`
	// Deprecated.  Use summit field instead. Whether the athlete has any Summit subscription.
	Premium bool `json:"premium,omitempty"`
	// Whether the athlete has any Summit subscription.
	Summit bool `json:"summit,omitempty"`
	// The time at which the athlete was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// The time at which the athlete was last updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

type SummaryClub

type SummaryClub struct {
	// The club's unique identifier.
	Id int32 `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 1 -> \"meta\", 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// The club's name.
	Name string `json:"name,omitempty"`
	// URL to a 60x60 pixel profile picture.
	ProfileMedium string `json:"profile_medium,omitempty"`
	// URL to a ~1185x580 pixel cover photo.
	CoverPhoto string `json:"cover_photo,omitempty"`
	// URL to a ~360x176  pixel cover photo.
	CoverPhotoSmall string `json:"cover_photo_small,omitempty"`
	SportType       string `json:"sport_type,omitempty"`
	// The club's city.
	City string `json:"city,omitempty"`
	// The club's state or geographical region.
	State string `json:"state,omitempty"`
	// The club's country.
	Country string `json:"country,omitempty"`
	// Whether the club is private.
	Private bool `json:"private,omitempty"`
	// The club's member count.
	MemberCount int32 `json:"member_count,omitempty"`
	// Whether the club is featured or not.
	Featured bool `json:"featured,omitempty"`
	// Whether the club is verified or not.
	Verified bool `json:"verified,omitempty"`
	// The club's vanity URL.
	Url string `json:"url,omitempty"`
}

type SummaryGear

type SummaryGear struct {
	// The gear's unique identifier.
	Id string `json:"id,omitempty"`
	// Resource state, indicates level of detail. Possible values: 2 -> \"summary\", 3 -> \"detail\"
	ResourceState int32 `json:"resource_state,omitempty"`
	// Whether this gear's is the owner's default one.
	Primary bool `json:"primary,omitempty"`
	// The gear's name.
	Name string `json:"name,omitempty"`
	// The distance logged with this gear.
	Distance float32 `json:"distance,omitempty"`
}

type SummarySegment

type SummarySegment struct {
	// The unique identifier of this segment
	Id int64 `json:"id,omitempty"`
	// The name of this segment
	Name         string `json:"name,omitempty"`
	ActivityType string `json:"activity_type,omitempty"`
	// The segment's distance, in meters
	Distance float32 `json:"distance,omitempty"`
	// The segment's average grade, in percents
	AverageGrade float32 `json:"average_grade,omitempty"`
	// The segments's maximum grade, in percents
	MaximumGrade float32 `json:"maximum_grade,omitempty"`
	// The segments's highest elevation, in meters
	ElevationHigh float32 `json:"elevation_high,omitempty"`
	// The segments's lowest elevation, in meters
	ElevationLow float32 `json:"elevation_low,omitempty"`
	StartLatlng  *LatLng `json:"start_latlng,omitempty"`
	EndLatlng    *LatLng `json:"end_latlng,omitempty"`
	// The category of the climb [0, 5]. Higher is harder ie. 5 is Hors catégorie, 0 is uncategorized in climb_category.
	ClimbCategory int32 `json:"climb_category,omitempty"`
	// The segments's city.
	City string `json:"city,omitempty"`
	// The segments's state or geographical region.
	State string `json:"state,omitempty"`
	// The segment's country.
	Country string `json:"country,omitempty"`
	// Whether this segment is private.
	Private         bool                  `json:"private,omitempty"`
	AthletePrEffort *SummarySegmentEffort `json:"athlete_pr_effort,omitempty"`
}

type SummarySegmentEffort

type SummarySegmentEffort struct {
	// The unique identifier of this effort
	Id int64 `json:"id,omitempty"`
	// The effort's elapsed time
	ElapsedTime int32 `json:"elapsed_time,omitempty"`
	// The time at which the effort was started.
	StartDate time.Time `json:"start_date,omitempty"`
	// The time at which the effort was started in the local timezone.
	StartDateLocal time.Time `json:"start_date_local,omitempty"`
	// The effort's distance in meters
	Distance float32 `json:"distance,omitempty"`
	// Whether this effort is the current best on the leaderboard
	IsKom bool `json:"is_kom,omitempty"`
}

type TemperatureStream

type TemperatureStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of temperature values for this stream, in celsius degrees
	Data []int32 `json:"data,omitempty"`
}

type TimeStream

type TimeStream struct {
	// The number of data points in this stream
	OriginalSize int32 `json:"original_size,omitempty"`
	// The level of detail (sampling) in which this stream was returned
	Resolution string `json:"resolution,omitempty"`
	// The base series used in the case the stream was downsampled
	SeriesType string `json:"series_type,omitempty"`
	// The sequence of time values for this stream, in seconds
	Data []int32 `json:"data,omitempty"`
}

type TimedZoneDistribution

type TimedZoneDistribution []TimedZoneRange

Stores the exclusive ranges representing zones and the time spent in each.

type TimedZoneRange

type TimedZoneRange struct {
	// The minimum value in the range.
	Min int32 `json:"min,omitempty"`
	// The maximum value in the range.
	Max int32 `json:"max,omitempty"`
	// The number of seconds spent in this zone
	Time int32 `json:"time,omitempty"`
}

A union type representing the time spent in a given zone.

type UpdatableActivity

type UpdatableActivity struct {
	// Whether this activity is a commute
	Commute bool `json:"commute,omitempty"`
	// Whether this activity was recorded on a training machine
	Trainer bool `json:"trainer,omitempty"`
	// The description of the activity
	Description string `json:"description,omitempty"`
	// The name of the activity
	Name  string        `json:"name,omitempty"`
	Type_ *ActivityType `json:"type,omitempty"`
	// Identifier for the gear associated with the activity. ‘none’ clears gear from activity
	GearId string `json:"gear_id,omitempty"`
}

type UpdateActivityByIdOpts

type UpdateActivityByIdOpts struct {
	Body optional.Interface
}

type Upload

type Upload struct {
	// The unique identifier of the upload
	Id int64 `json:"id,omitempty"`
	// The unique identifier of the upload in string format
	IdStr string `json:"id_str,omitempty"`
	// The external identifier of the upload
	ExternalId string `json:"external_id,omitempty"`
	// The error associated with this upload
	Error_ string `json:"error,omitempty"`
	// The status of this upload
	Status string `json:"status,omitempty"`
	// The identifier of the activity this upload resulted into
	ActivityId int64 `json:"activity_id,omitempty"`
}

type UploadsApiService

type UploadsApiService service

func (*UploadsApiService) CreateUpload

func (a *UploadsApiService) CreateUpload(ctx context.Context, localVarOptionals *CreateUploadOpts) (Upload, *http.Response, error)

func (*UploadsApiService) GetUploadById

func (a *UploadsApiService) GetUploadById(ctx context.Context, uploadId int64) (Upload, *http.Response, error)

UploadsApiService Get Upload Returns an upload for a given identifier. Requires activity:write scope.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param uploadId The identifier of the upload.

@return Upload

type ZoneRange

type ZoneRange struct {
	// The minimum value in the range.
	Min int32 `json:"min,omitempty"`
	// The maximum value in the range.
	Max int32 `json:"max,omitempty"`
}

type ZoneRanges

type ZoneRanges []ZoneRange

type Zones

type Zones struct {
	HeartRate *HeartRateZoneRanges `json:"heart_rate,omitempty"`
	Power     *PowerZoneRanges     `json:"power,omitempty"`
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL