-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdetailed_photo.rb
More file actions
90 lines (69 loc) · 2.91 KB
/
detailed_photo.rb
File metadata and controls
90 lines (69 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# frozen_string_literal: true
module Strava
module Models
#
# 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.
#
# @example 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 Strava::Api::Client#activity_photos
#
class DetailedPhoto < Strava::Models::Response
# @return [String] Unique identifier for the photo/video
property 'unique_id'
# @return [Integer] ID of the athlete who uploaded the photo
property 'athlete_id'
# @return [Integer] ID of the activity this photo is attached to
property 'activity_id'
# @return [String] Name of the activity
property 'activity_name'
# @return [Integer, nil] Post identifier if photo is from a social post
property 'post_id'
# @return [Integer] Resource state indicator
property 'resource_state'
# @return [String, nil] Photo caption/description
property 'caption'
# @return [Integer] Type of media (1=photo, 2=video)
property 'type'
# @return [Integer] Source of the photo (1=native Strava upload, 2=Instagram)
property 'source'
# @return [String] Processing status
property 'status'
# @return [Time] When the photo was uploaded to Strava
property 'uploaded_at', transform_with: ->(v) { Time.parse(v) }
# @return [Time] When the photo was created/taken
property 'created_at', transform_with: ->(v) { Time.parse(v) }
# @return [Time] Local time when photo was created
property 'created_at_local', transform_with: ->(v) { Time.parse(v) }
# @return [Hash] Map of size keys to photo URLs (e.g., {"0" => "https://...", "1000" => "https://..."})
property 'urls'
# @return [String, nil] URL to placeholder/thumbnail image
property 'placeholder_image'
# @return [Hash] Map of size keys to dimensions [width, height]
property 'sizes'
# @return [Boolean] Whether this is the default/cover photo for the activity
property 'default_photo'
# @return [String, nil] Pagination cursor for photo listing
property 'cursor'
# @return [Float, nil] Duration in seconds (for videos)
property 'duration'
# @return [String, nil] Direct URL to video file
property 'video_url'
# @return [Array<Float>, nil] Geographic location [latitude, longitude] where photo was taken
property 'location'
end
end
end