-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_sport_type.go
207 lines (185 loc) · 5.82 KB
/
model_sport_type.go
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/*
Strava API v3
The [Swagger Playground](https://developers.strava.com/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.
API version: 3.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package strava3golang
import (
"encoding/json"
"fmt"
)
// SportType An enumeration of the sport types an activity may have. Distinct from ActivityType in that it has new types (e.g. MountainBikeRide)
type SportType string
// List of SportType
const (
SPORTTYPE_ALPINE_SKI SportType = "AlpineSki"
SPORTTYPE_BACKCOUNTRY_SKI SportType = "BackcountrySki"
SPORTTYPE_BADMINTON SportType = "Badminton"
SPORTTYPE_CANOEING SportType = "Canoeing"
SPORTTYPE_CROSSFIT SportType = "Crossfit"
SPORTTYPE_E_BIKE_RIDE SportType = "EBikeRide"
SPORTTYPE_ELLIPTICAL SportType = "Elliptical"
SPORTTYPE_E_MOUNTAIN_BIKE_RIDE SportType = "EMountainBikeRide"
SPORTTYPE_GOLF SportType = "Golf"
SPORTTYPE_GRAVEL_RIDE SportType = "GravelRide"
SPORTTYPE_HANDCYCLE SportType = "Handcycle"
SPORTTYPE_HIGH_INTENSITY_INTERVAL_TRAINING SportType = "HighIntensityIntervalTraining"
SPORTTYPE_HIKE SportType = "Hike"
SPORTTYPE_ICE_SKATE SportType = "IceSkate"
SPORTTYPE_INLINE_SKATE SportType = "InlineSkate"
SPORTTYPE_KAYAKING SportType = "Kayaking"
SPORTTYPE_KITESURF SportType = "Kitesurf"
SPORTTYPE_MOUNTAIN_BIKE_RIDE SportType = "MountainBikeRide"
SPORTTYPE_NORDIC_SKI SportType = "NordicSki"
SPORTTYPE_PICKLEBALL SportType = "Pickleball"
SPORTTYPE_PILATES SportType = "Pilates"
SPORTTYPE_RACQUETBALL SportType = "Racquetball"
SPORTTYPE_RIDE SportType = "Ride"
SPORTTYPE_ROCK_CLIMBING SportType = "RockClimbing"
SPORTTYPE_ROLLER_SKI SportType = "RollerSki"
SPORTTYPE_ROWING SportType = "Rowing"
SPORTTYPE_RUN SportType = "Run"
SPORTTYPE_SAIL SportType = "Sail"
SPORTTYPE_SKATEBOARD SportType = "Skateboard"
SPORTTYPE_SNOWBOARD SportType = "Snowboard"
SPORTTYPE_SNOWSHOE SportType = "Snowshoe"
SPORTTYPE_SOCCER SportType = "Soccer"
SPORTTYPE_SQUASH SportType = "Squash"
SPORTTYPE_STAIR_STEPPER SportType = "StairStepper"
SPORTTYPE_STAND_UP_PADDLING SportType = "StandUpPaddling"
SPORTTYPE_SURFING SportType = "Surfing"
SPORTTYPE_SWIM SportType = "Swim"
SPORTTYPE_TABLE_TENNIS SportType = "TableTennis"
SPORTTYPE_TENNIS SportType = "Tennis"
SPORTTYPE_TRAIL_RUN SportType = "TrailRun"
SPORTTYPE_VELOMOBILE SportType = "Velomobile"
SPORTTYPE_VIRTUAL_RIDE SportType = "VirtualRide"
SPORTTYPE_VIRTUAL_ROW SportType = "VirtualRow"
SPORTTYPE_VIRTUAL_RUN SportType = "VirtualRun"
SPORTTYPE_WALK SportType = "Walk"
SPORTTYPE_WEIGHT_TRAINING SportType = "WeightTraining"
SPORTTYPE_WHEELCHAIR SportType = "Wheelchair"
SPORTTYPE_WINDSURF SportType = "Windsurf"
SPORTTYPE_WORKOUT SportType = "Workout"
SPORTTYPE_YOGA SportType = "Yoga"
)
// All allowed values of SportType enum
var AllowedSportTypeEnumValues = []SportType{
"AlpineSki",
"BackcountrySki",
"Badminton",
"Canoeing",
"Crossfit",
"EBikeRide",
"Elliptical",
"EMountainBikeRide",
"Golf",
"GravelRide",
"Handcycle",
"HighIntensityIntervalTraining",
"Hike",
"IceSkate",
"InlineSkate",
"Kayaking",
"Kitesurf",
"MountainBikeRide",
"NordicSki",
"Pickleball",
"Pilates",
"Racquetball",
"Ride",
"RockClimbing",
"RollerSki",
"Rowing",
"Run",
"Sail",
"Skateboard",
"Snowboard",
"Snowshoe",
"Soccer",
"Squash",
"StairStepper",
"StandUpPaddling",
"Surfing",
"Swim",
"TableTennis",
"Tennis",
"TrailRun",
"Velomobile",
"VirtualRide",
"VirtualRow",
"VirtualRun",
"Walk",
"WeightTraining",
"Wheelchair",
"Windsurf",
"Workout",
"Yoga",
}
func (v *SportType) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := SportType(value)
for _, existing := range AllowedSportTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid SportType", value)
}
// NewSportTypeFromValue returns a pointer to a valid SportType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewSportTypeFromValue(v string) (*SportType, error) {
ev := SportType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for SportType: valid values are %v", v, AllowedSportTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v SportType) IsValid() bool {
for _, existing := range AllowedSportTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to SportType value
func (v SportType) Ptr() *SportType {
return &v
}
type NullableSportType struct {
value *SportType
isSet bool
}
func (v NullableSportType) Get() *SportType {
return v.value
}
func (v *NullableSportType) Set(val *SportType) {
v.value = val
v.isSet = true
}
func (v NullableSportType) IsSet() bool {
return v.isSet
}
func (v *NullableSportType) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSportType(val *SportType) *NullableSportType {
return &NullableSportType{value: val, isSet: true}
}
func (v NullableSportType) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSportType) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}