Class: Strava::Models::DetailedPhoto

Inherits:
Response show all
Defined in:
lib/strava/models/detailed_photo.rb

Overview

Represents a photo or video attached to an activity.

Photos can be uploaded directly to Strava or linked from Instagram. This model contains URLs to various sizes of the media, timestamps, and metadata about the photo or video.

Note: This is an undocumented Strava API endpoint.

Examples:

List activity photos

photos = client.activity_photos(1234567890)
photos.each do |photo|
  puts photo.caption if photo.caption
  puts "Uploaded: #{photo.uploaded_at}"
  puts "URL: #{photo.urls['0']}" if photo.urls
  puts "Video: #{photo.video_url}" if photo.video_url
end

See Also:

  • Api::Client#activity_photos

Instance Method Summary collapse

Instance Method Details

#activity_idInteger

Returns ID of the activity this photo is attached to.

Returns:

  • (Integer)

    ID of the activity this photo is attached to



33
# File 'lib/strava/models/detailed_photo.rb', line 33

property 'activity_id'

#activity_nameString

Returns Name of the activity.

Returns:

  • (String)

    Name of the activity



36
# File 'lib/strava/models/detailed_photo.rb', line 36

property 'activity_name'

#athlete_idInteger

Returns ID of the athlete who uploaded the photo.

Returns:

  • (Integer)

    ID of the athlete who uploaded the photo



30
# File 'lib/strava/models/detailed_photo.rb', line 30

property 'athlete_id'

#captionString?

Returns Photo caption/description.

Returns:

  • (String, nil)

    Photo caption/description



45
# File 'lib/strava/models/detailed_photo.rb', line 45

property 'caption'

#created_atTime

Returns When the photo was created/taken.

Returns:

  • (Time)

    When the photo was created/taken



60
# File 'lib/strava/models/detailed_photo.rb', line 60

property 'created_at', transform_with: ->(v) { Time.parse(v) }

#created_at_localTime

Returns Local time when photo was created.

Returns:

  • (Time)

    Local time when photo was created



63
# File 'lib/strava/models/detailed_photo.rb', line 63

property 'created_at_local', transform_with: ->(v) { Time.parse(v) }

#cursorString?

Returns Pagination cursor for photo listing.

Returns:

  • (String, nil)

    Pagination cursor for photo listing



78
# File 'lib/strava/models/detailed_photo.rb', line 78

property 'cursor'

#default_photoBoolean

Returns Whether this is the default/cover photo for the activity.

Returns:

  • (Boolean)

    Whether this is the default/cover photo for the activity



75
# File 'lib/strava/models/detailed_photo.rb', line 75

property 'default_photo'

#durationFloat?

Returns Duration in seconds (for videos).

Returns:

  • (Float, nil)

    Duration in seconds (for videos)



81
# File 'lib/strava/models/detailed_photo.rb', line 81

property 'duration'

#locationArray<Float>?

Returns Geographic location [latitude, longitude] where photo was taken.

Returns:

  • (Array<Float>, nil)

    Geographic location [latitude, longitude] where photo was taken



87
# File 'lib/strava/models/detailed_photo.rb', line 87

property 'location'

#placeholder_imageString?

Returns URL to placeholder/thumbnail image.

Returns:

  • (String, nil)

    URL to placeholder/thumbnail image



69
# File 'lib/strava/models/detailed_photo.rb', line 69

property 'placeholder_image'

#post_idInteger?

Returns Post identifier if photo is from a social post.

Returns:

  • (Integer, nil)

    Post identifier if photo is from a social post



39
# File 'lib/strava/models/detailed_photo.rb', line 39

property 'post_id'

#resource_stateInteger

Returns Resource state indicator.

Returns:

  • (Integer)

    Resource state indicator



42
# File 'lib/strava/models/detailed_photo.rb', line 42

property 'resource_state'

#sizesHash

Returns Map of size keys to dimensions [width, height].

Returns:

  • (Hash)

    Map of size keys to dimensions [width, height]



72
# File 'lib/strava/models/detailed_photo.rb', line 72

property 'sizes'

#sourceInteger

Returns Source of the photo (1=native Strava upload, 2=Instagram).

Returns:

  • (Integer)

    Source of the photo (1=native Strava upload, 2=Instagram)



51
# File 'lib/strava/models/detailed_photo.rb', line 51

property 'source'

#statusString

Returns Processing status.

Returns:

  • (String)

    Processing status



54
# File 'lib/strava/models/detailed_photo.rb', line 54

property 'status'

#typeInteger

Returns Type of media (1=photo, 2=video).

Returns:

  • (Integer)

    Type of media (1=photo, 2=video)



48
# File 'lib/strava/models/detailed_photo.rb', line 48

property 'type'

#unique_idString

Returns Unique identifier for the photo/video.

Returns:

  • (String)

    Unique identifier for the photo/video



27
# File 'lib/strava/models/detailed_photo.rb', line 27

property 'unique_id'

#uploaded_atTime

Returns When the photo was uploaded to Strava.

Returns:

  • (Time)

    When the photo was uploaded to Strava



57
# File 'lib/strava/models/detailed_photo.rb', line 57

property 'uploaded_at', transform_with: ->(v) { Time.parse(v) }

#urlsHash

Returns Map of size keys to photo URLs (e.g., => "https://...", "1000" => "https://...").

Returns:

  • (Hash)

    Map of size keys to photo URLs (e.g., => "https://...", "1000" => "https://...")



66
# File 'lib/strava/models/detailed_photo.rb', line 66

property 'urls'

#video_urlString?

Returns Direct URL to video file.

Returns:

  • (String, nil)

    Direct URL to video file



84
# File 'lib/strava/models/detailed_photo.rb', line 84

property 'video_url'