This commit is contained in:
2025-09-21 11:03:52 -07:00
parent 667790030e
commit e04cd5160e
138 changed files with 17338 additions and 0 deletions

71
internal/users/profile.go Normal file
View File

@@ -0,0 +1,71 @@
package users
import (
"time"
)
type UserProfile struct {
ID int `json:"id"`
ProfileID int `json:"profileId"`
GarminGUID string `json:"garminGuid"`
DisplayName string `json:"displayName"`
FullName string `json:"fullName"`
UserName string `json:"userName"`
ProfileImageType *string `json:"profileImageType"`
ProfileImageURLLarge *string `json:"profileImageUrlLarge"`
ProfileImageURLMedium *string `json:"profileImageUrlMedium"`
ProfileImageURLSmall *string `json:"profileImageUrlSmall"`
Location *string `json:"location"`
FacebookURL *string `json:"facebookUrl"`
TwitterURL *string `json:"twitterUrl"`
PersonalWebsite *string `json:"personalWebsite"`
Motivation *string `json:"motivation"`
Bio *string `json:"bio"`
PrimaryActivity *string `json:"primaryActivity"`
FavoriteActivityTypes []string `json:"favoriteActivityTypes"`
RunningTrainingSpeed float64 `json:"runningTrainingSpeed"`
CyclingTrainingSpeed float64 `json:"cyclingTrainingSpeed"`
FavoriteCyclingActivityTypes []string `json:"favoriteCyclingActivityTypes"`
CyclingClassification *string `json:"cyclingClassification"`
CyclingMaxAvgPower float64 `json:"cyclingMaxAvgPower"`
SwimmingTrainingSpeed float64 `json:"swimmingTrainingSpeed"`
ProfileVisibility string `json:"profileVisibility"`
ActivityStartVisibility string `json:"activityStartVisibility"`
ActivityMapVisibility string `json:"activityMapVisibility"`
CourseVisibility string `json:"courseVisibility"`
ActivityHeartRateVisibility string `json:"activityHeartRateVisibility"`
ActivityPowerVisibility string `json:"activityPowerVisibility"`
BadgeVisibility string `json:"badgeVisibility"`
ShowAge bool `json:"showAge"`
ShowWeight bool `json:"showWeight"`
ShowHeight bool `json:"showHeight"`
ShowWeightClass bool `json:"showWeightClass"`
ShowAgeRange bool `json:"showAgeRange"`
ShowGender bool `json:"showGender"`
ShowActivityClass bool `json:"showActivityClass"`
ShowVO2Max bool `json:"showVo2Max"`
ShowPersonalRecords bool `json:"showPersonalRecords"`
ShowLast12Months bool `json:"showLast12Months"`
ShowLifetimeTotals bool `json:"showLifetimeTotals"`
ShowUpcomingEvents bool `json:"showUpcomingEvents"`
ShowRecentFavorites bool `json:"showRecentFavorites"`
ShowRecentDevice bool `json:"showRecentDevice"`
ShowRecentGear bool `json:"showRecentGear"`
ShowBadges bool `json:"showBadges"`
OtherActivity *string `json:"otherActivity"`
OtherPrimaryActivity *string `json:"otherPrimaryActivity"`
OtherMotivation *string `json:"otherMotivation"`
UserRoles []string `json:"userRoles"`
NameApproved bool `json:"nameApproved"`
UserProfileFullName string `json:"userProfileFullName"`
MakeGolfScorecardsPrivate bool `json:"makeGolfScorecardsPrivate"`
AllowGolfLiveScoring bool `json:"allowGolfLiveScoring"`
AllowGolfScoringByConnections bool `json:"allowGolfScoringByConnections"`
UserLevel int `json:"userLevel"`
UserPoint int `json:"userPoint"`
LevelUpdateDate time.Time `json:"levelUpdateDate"`
LevelIsViewed bool `json:"levelIsViewed"`
LevelPointThreshold int `json:"levelPointThreshold"`
UserPointOffset int `json:"userPointOffset"`
UserPro bool `json:"userPro"`
}

View File

@@ -0,0 +1,95 @@
package users
import (
"time"
"go-garth/internal/api/client"
)
type PowerFormat struct {
FormatID int `json:"formatId"`
FormatKey string `json:"formatKey"`
MinFraction int `json:"minFraction"`
MaxFraction int `json:"maxFraction"`
GroupingUsed bool `json:"groupingUsed"`
DisplayFormat *string `json:"displayFormat"`
}
type FirstDayOfWeek struct {
DayID int `json:"dayId"`
DayName string `json:"dayName"`
SortOrder int `json:"sortOrder"`
IsPossibleFirstDay bool `json:"isPossibleFirstDay"`
}
type WeatherLocation struct {
UseFixedLocation *bool `json:"useFixedLocation"`
Latitude *float64 `json:"latitude"`
Longitude *float64 `json:"longitude"`
LocationName *string `json:"locationName"`
ISOCountryCode *string `json:"isoCountryCode"`
PostalCode *string `json:"postalCode"`
}
type UserData struct {
Gender string `json:"gender"`
Weight float64 `json:"weight"`
Height float64 `json:"height"`
TimeFormat string `json:"timeFormat"`
BirthDate time.Time `json:"birthDate"`
MeasurementSystem string `json:"measurementSystem"`
ActivityLevel *string `json:"activityLevel"`
Handedness string `json:"handedness"`
PowerFormat PowerFormat `json:"powerFormat"`
HeartRateFormat PowerFormat `json:"heartRateFormat"`
FirstDayOfWeek FirstDayOfWeek `json:"firstDayOfWeek"`
VO2MaxRunning *float64 `json:"vo2MaxRunning"`
VO2MaxCycling *float64 `json:"vo2MaxCycling"`
LactateThresholdSpeed *float64 `json:"lactateThresholdSpeed"`
LactateThresholdHeartRate *float64 `json:"lactateThresholdHeartRate"`
DiveNumber *int `json:"diveNumber"`
IntensityMinutesCalcMethod string `json:"intensityMinutesCalcMethod"`
ModerateIntensityMinutesHRZone int `json:"moderateIntensityMinutesHrZone"`
VigorousIntensityMinutesHRZone int `json:"vigorousIntensityMinutesHrZone"`
HydrationMeasurementUnit string `json:"hydrationMeasurementUnit"`
HydrationContainers []map[string]interface{} `json:"hydrationContainers"`
HydrationAutoGoalEnabled bool `json:"hydrationAutoGoalEnabled"`
FirstbeatMaxStressScore *float64 `json:"firstbeatMaxStressScore"`
FirstbeatCyclingLTTimestamp *int64 `json:"firstbeatCyclingLtTimestamp"`
FirstbeatRunningLTTimestamp *int64 `json:"firstbeatRunningLtTimestamp"`
ThresholdHeartRateAutoDetected bool `json:"thresholdHeartRateAutoDetected"`
FTPAutoDetected *bool `json:"ftpAutoDetected"`
TrainingStatusPausedDate *string `json:"trainingStatusPausedDate"`
WeatherLocation *WeatherLocation `json:"weatherLocation"`
GolfDistanceUnit *string `json:"golfDistanceUnit"`
GolfElevationUnit *string `json:"golfElevationUnit"`
GolfSpeedUnit *string `json:"golfSpeedUnit"`
ExternalBottomTime *float64 `json:"externalBottomTime"`
}
type UserSleep struct {
SleepTime int `json:"sleepTime"`
DefaultSleepTime bool `json:"defaultSleepTime"`
WakeTime int `json:"wakeTime"`
DefaultWakeTime bool `json:"defaultWakeTime"`
}
type UserSleepWindow struct {
SleepWindowFrequency string `json:"sleepWindowFrequency"`
StartSleepTimeSecondsFromMidnight int `json:"startSleepTimeSecondsFromMidnight"`
EndSleepTimeSecondsFromMidnight int `json:"endSleepTimeSecondsFromMidnight"`
}
type UserSettings struct {
ID int `json:"id"`
UserData UserData `json:"userData"`
UserSleep UserSleep `json:"userSleep"`
ConnectDate *string `json:"connectDate"`
SourceType *string `json:"sourceType"`
UserSleepWindows []UserSleepWindow `json:"userSleepWindows,omitempty"`
}
func GetSettings(c *client.Client) (*UserSettings, error) {
// Implementation will be added in client.go
return nil, nil
}