| 1 | // Copyright 2026 Google LLC. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Code generated file. DO NOT EDIT. |
| 6 | |
| 7 | // Package health provides access to the Google Health API. |
| 8 | // |
| 9 | // For product documentation, see: https://developers.google.com/health |
| 10 | // |
| 11 | // # Library status |
| 12 | // |
| 13 | // These client libraries are officially supported by Google. However, this |
| 14 | // library is considered complete and is in maintenance mode. This means |
| 15 | // that we will address critical bugs and security issues but will not add |
| 16 | // any new features. |
| 17 | // |
| 18 | // When possible, we recommend using our newer |
| 19 | // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) |
| 20 | // that are still actively being worked and iterated on. |
| 21 | // |
| 22 | // # Creating a client |
| 23 | // |
| 24 | // Usage example: |
| 25 | // |
| 26 | // import "google.golang.org/api/health/v4" |
| 27 | // ... |
| 28 | // ctx := context.Background() |
| 29 | // healthService, err := health.NewService(ctx) |
| 30 | // |
| 31 | // In this example, Google Application Default Credentials are used for |
| 32 | // authentication. For information on how to create and obtain Application |
| 33 | // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. |
| 34 | // |
| 35 | // # Other authentication options |
| 36 | // |
| 37 | // To use an API key for authentication (note: some APIs do not support API |
| 38 | // keys), use [google.golang.org/api/option.WithAPIKey]: |
| 39 | // |
| 40 | // healthService, err := health.NewService(ctx, option.WithAPIKey("AIza...")) |
| 41 | // |
| 42 | // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth |
| 43 | // flow, use [google.golang.org/api/option.WithTokenSource]: |
| 44 | // |
| 45 | // config := &oauth2.Config{...} |
| 46 | // // ... |
| 47 | // token, err := config.Exchange(ctx, ...) |
| 48 | // healthService, err := health.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) |
| 49 | // |
| 50 | // See [google.golang.org/api/option.ClientOption] for details on options. |
| 51 | package health // import "google.golang.org/api/health/v4" |
| 52 | |
| 53 | import ( |
| 54 | "bytes" |
| 55 | "context" |
| 56 | "encoding/json" |
| 57 | "errors" |
| 58 | "fmt" |
| 59 | "io" |
| 60 | "log/slog" |
| 61 | "net/http" |
| 62 | "net/url" |
| 63 | "strconv" |
| 64 | "strings" |
| 65 | |
| 66 | "github.com/googleapis/gax-go/v2/internallog" |
| 67 | googleapi "google.golang.org/api/googleapi" |
| 68 | internal "google.golang.org/api/internal" |
| 69 | gensupport "google.golang.org/api/internal/gensupport" |
| 70 | option "google.golang.org/api/option" |
| 71 | internaloption "google.golang.org/api/option/internaloption" |
| 72 | htransport "google.golang.org/api/transport/http" |
| 73 | ) |
| 74 | |
| 75 | // Always reference these packages, just in case the auto-generated code |
| 76 | // below doesn't. |
| 77 | var _ = bytes.NewBuffer |
| 78 | var _ = strconv.Itoa |
| 79 | var _ = fmt.Sprintf |
| 80 | var _ = json.NewDecoder |
| 81 | var _ = io.Copy |
| 82 | var _ = url.Parse |
| 83 | var _ = gensupport.MarshalJSON |
| 84 | var _ = googleapi.Version |
| 85 | var _ = errors.New |
| 86 | var _ = strings.Replace |
| 87 | var _ = context.Canceled |
| 88 | var _ = internaloption.WithDefaultEndpoint |
| 89 | var _ = internal.Version |
| 90 | var _ = internallog.New |
| 91 | |
| 92 | const apiId = "health:v4" |
| 93 | const apiName = "health" |
| 94 | const apiVersion = "v4" |
| 95 | const basePath = "https://health.googleapis.com/" |
| 96 | const basePathTemplate = "https://health.UNIVERSE_DOMAIN/" |
| 97 | const mtlsBasePath = "https://health.mtls.googleapis.com/" |
| 98 | |
| 99 | // NewService creates a new Service. |
| 100 | func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { |
| 101 | opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) |
| 102 | opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) |
| 103 | opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) |
| 104 | opts = append(opts, internaloption.EnableNewAuthLibrary()) |
| 105 | client, endpoint, err := htransport.NewClient(ctx, opts...) |
| 106 | if err != nil { |
| 107 | return nil, err |
| 108 | } |
| 109 | s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} |
| 110 | s.Users = NewUsersService(s) |
| 111 | if endpoint != "" { |
| 112 | s.BasePath = endpoint |
| 113 | } |
| 114 | return s, nil |
| 115 | } |
| 116 | |
| 117 | // New creates a new Service. It uses the provided http.Client for requests. |
| 118 | // |
| 119 | // Deprecated: please use NewService instead. |
| 120 | // To provide a custom HTTP client, use option.WithHTTPClient. |
| 121 | // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. |
| 122 | func New(client *http.Client) (*Service, error) { |
| 123 | if client == nil { |
| 124 | return nil, errors.New("client is nil") |
| 125 | } |
| 126 | return NewService(context.TODO(), option.WithHTTPClient(client)) |
| 127 | } |
| 128 | |
| 129 | type Service struct { |
| 130 | client *http.Client |
| 131 | logger *slog.Logger |
| 132 | BasePath string // API endpoint base URL |
| 133 | UserAgent string // optional additional User-Agent fragment |
| 134 | |
| 135 | Users *UsersService |
| 136 | } |
| 137 | |
| 138 | func (s *Service) userAgent() string { |
| 139 | if s.UserAgent == "" { |
| 140 | return googleapi.UserAgent |
| 141 | } |
| 142 | return googleapi.UserAgent + " " + s.UserAgent |
| 143 | } |
| 144 | |
| 145 | func NewUsersService(s *Service) *UsersService { |
| 146 | rs := &UsersService{s: s} |
| 147 | rs.DataTypes = NewUsersDataTypesService(s) |
| 148 | return rs |
| 149 | } |
| 150 | |
| 151 | type UsersService struct { |
| 152 | s *Service |
| 153 | |
| 154 | DataTypes *UsersDataTypesService |
| 155 | } |
| 156 | |
| 157 | func NewUsersDataTypesService(s *Service) *UsersDataTypesService { |
| 158 | rs := &UsersDataTypesService{s: s} |
| 159 | rs.DataPoints = NewUsersDataTypesDataPointsService(s) |
| 160 | return rs |
| 161 | } |
| 162 | |
| 163 | type UsersDataTypesService struct { |
| 164 | s *Service |
| 165 | |
| 166 | DataPoints *UsersDataTypesDataPointsService |
| 167 | } |
| 168 | |
| 169 | func NewUsersDataTypesDataPointsService(s *Service) *UsersDataTypesDataPointsService { |
| 170 | rs := &UsersDataTypesDataPointsService{s: s} |
| 171 | return rs |
| 172 | } |
| 173 | |
| 174 | type UsersDataTypesDataPointsService struct { |
| 175 | s *Service |
| 176 | } |
| 177 | |
| 178 | // ActiveMinutes: Record of active minutes in a given time interval. |
| 179 | type ActiveMinutes struct { |
| 180 | // ActiveMinutesByActivityLevel: Required. Active minutes by activity level. At |
| 181 | // most one record per activity level is allowed. |
| 182 | ActiveMinutesByActivityLevel []*ActiveMinutesByActivityLevel `json:"activeMinutesByActivityLevel,omitempty"` |
| 183 | // Interval: Required. Observed interval. |
| 184 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 185 | // ForceSendFields is a list of field names (e.g. |
| 186 | // "ActiveMinutesByActivityLevel") to unconditionally include in API requests. |
| 187 | // By default, fields with empty or default values are omitted from API |
| 188 | // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields |
| 189 | // for more details. |
| 190 | ForceSendFields []string `json:"-"` |
| 191 | // NullFields is a list of field names (e.g. "ActiveMinutesByActivityLevel") to |
| 192 | // include in API requests with the JSON null value. By default, fields with |
| 193 | // empty values are omitted from API requests. See |
| 194 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 195 | NullFields []string `json:"-"` |
| 196 | } |
| 197 | |
| 198 | func (s ActiveMinutes) MarshalJSON() ([]byte, error) { |
| 199 | type NoMethod ActiveMinutes |
| 200 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 201 | } |
| 202 | |
| 203 | // ActiveMinutesByActivityLevel: Active minutes at a given activity level. |
| 204 | type ActiveMinutesByActivityLevel struct { |
| 205 | // ActiveMinutes: Required. Number of whole minutes spent in activity. |
| 206 | ActiveMinutes int64 `json:"activeMinutes,omitempty,string"` |
| 207 | // ActivityLevel: Required. The level of activity. |
| 208 | // |
| 209 | // Possible values: |
| 210 | // "ACTIVITY_LEVEL_UNSPECIFIED" - Activity level is unspecified. |
| 211 | // "LIGHT" - Light activity level. |
| 212 | // "MODERATE" - Moderate activity level. |
| 213 | // "VIGOROUS" - Vigorous activity level. |
| 214 | ActivityLevel string `json:"activityLevel,omitempty"` |
| 215 | // ForceSendFields is a list of field names (e.g. "ActiveMinutes") to |
| 216 | // unconditionally include in API requests. By default, fields with empty or |
| 217 | // default values are omitted from API requests. See |
| 218 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 219 | // details. |
| 220 | ForceSendFields []string `json:"-"` |
| 221 | // NullFields is a list of field names (e.g. "ActiveMinutes") to include in API |
| 222 | // requests with the JSON null value. By default, fields with empty values are |
| 223 | // omitted from API requests. See |
| 224 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 225 | NullFields []string `json:"-"` |
| 226 | } |
| 227 | |
| 228 | func (s ActiveMinutesByActivityLevel) MarshalJSON() ([]byte, error) { |
| 229 | type NoMethod ActiveMinutesByActivityLevel |
| 230 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 231 | } |
| 232 | |
| 233 | // ActiveMinutesRollupByActivityLevel: Active minutes by activity level. |
| 234 | type ActiveMinutesRollupByActivityLevel struct { |
| 235 | // ActiveMinutesSum: Number of whole minutes spent in activity. |
| 236 | ActiveMinutesSum int64 `json:"activeMinutesSum,omitempty,string"` |
| 237 | // ActivityLevel: The level of activity. |
| 238 | // |
| 239 | // Possible values: |
| 240 | // "ACTIVITY_LEVEL_UNSPECIFIED" - Activity level is unspecified. |
| 241 | // "LIGHT" - Light activity level. |
| 242 | // "MODERATE" - Moderate activity level. |
| 243 | // "VIGOROUS" - Vigorous activity level. |
| 244 | ActivityLevel string `json:"activityLevel,omitempty"` |
| 245 | // ForceSendFields is a list of field names (e.g. "ActiveMinutesSum") to |
| 246 | // unconditionally include in API requests. By default, fields with empty or |
| 247 | // default values are omitted from API requests. See |
| 248 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 249 | // details. |
| 250 | ForceSendFields []string `json:"-"` |
| 251 | // NullFields is a list of field names (e.g. "ActiveMinutesSum") to include in |
| 252 | // API requests with the JSON null value. By default, fields with empty values |
| 253 | // are omitted from API requests. See |
| 254 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 255 | NullFields []string `json:"-"` |
| 256 | } |
| 257 | |
| 258 | func (s ActiveMinutesRollupByActivityLevel) MarshalJSON() ([]byte, error) { |
| 259 | type NoMethod ActiveMinutesRollupByActivityLevel |
| 260 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 261 | } |
| 262 | |
| 263 | // ActiveMinutesRollupValue: Represents the result of the rollup of the active |
| 264 | // minutes data type. |
| 265 | type ActiveMinutesRollupValue struct { |
| 266 | // ActiveMinutesRollupByActivityLevel: Active minutes by activity level. At |
| 267 | // most one record per activity level is allowed. |
| 268 | ActiveMinutesRollupByActivityLevel []*ActiveMinutesRollupByActivityLevel `json:"activeMinutesRollupByActivityLevel,omitempty"` |
| 269 | // ForceSendFields is a list of field names (e.g. |
| 270 | // "ActiveMinutesRollupByActivityLevel") to unconditionally include in API |
| 271 | // requests. By default, fields with empty or default values are omitted from |
| 272 | // API requests. See |
| 273 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 274 | // details. |
| 275 | ForceSendFields []string `json:"-"` |
| 276 | // NullFields is a list of field names (e.g. |
| 277 | // "ActiveMinutesRollupByActivityLevel") to include in API requests with the |
| 278 | // JSON null value. By default, fields with empty values are omitted from API |
| 279 | // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for |
| 280 | // more details. |
| 281 | NullFields []string `json:"-"` |
| 282 | } |
| 283 | |
| 284 | func (s ActiveMinutesRollupValue) MarshalJSON() ([]byte, error) { |
| 285 | type NoMethod ActiveMinutesRollupValue |
| 286 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 287 | } |
| 288 | |
| 289 | // ActiveZoneMinutes: Record of active zone minutes in a given time interval. |
| 290 | type ActiveZoneMinutes struct { |
| 291 | // ActiveZoneMinutes: Required. Number of Active Zone Minutes earned in the |
| 292 | // given time interval. Note: active_zone_minutes equals to 1 for low intensity |
| 293 | // (fat burn) zones or 2 for high intensity zones (cardio, peak). |
| 294 | ActiveZoneMinutes int64 `json:"activeZoneMinutes,omitempty,string"` |
| 295 | // HeartRateZone: Required. Heart rate zone in which the active zone minutes |
| 296 | // have been earned, in the given time interval. |
| 297 | // |
| 298 | // Possible values: |
| 299 | // "HEART_RATE_ZONE_UNSPECIFIED" - Unspecified heart rate zone. |
| 300 | // "FAT_BURN" - The fat burn heart rate zone. |
| 301 | // "CARDIO" - The cardio heart rate zone. |
| 302 | // "PEAK" - The peak heart rate zone. |
| 303 | HeartRateZone string `json:"heartRateZone,omitempty"` |
| 304 | // Interval: Required. Observed interval. |
| 305 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 306 | // ForceSendFields is a list of field names (e.g. "ActiveZoneMinutes") to |
| 307 | // unconditionally include in API requests. By default, fields with empty or |
| 308 | // default values are omitted from API requests. See |
| 309 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 310 | // details. |
| 311 | ForceSendFields []string `json:"-"` |
| 312 | // NullFields is a list of field names (e.g. "ActiveZoneMinutes") to include in |
| 313 | // API requests with the JSON null value. By default, fields with empty values |
| 314 | // are omitted from API requests. See |
| 315 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 316 | NullFields []string `json:"-"` |
| 317 | } |
| 318 | |
| 319 | func (s ActiveZoneMinutes) MarshalJSON() ([]byte, error) { |
| 320 | type NoMethod ActiveZoneMinutes |
| 321 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 322 | } |
| 323 | |
| 324 | // ActiveZoneMinutesRollupValue: Represents the result of the rollup of the |
| 325 | // active zone minutes data type. |
| 326 | type ActiveZoneMinutesRollupValue struct { |
| 327 | // SumInCardioHeartZone: Active zone minutes in `HeartRateZone.CARDIO`. |
| 328 | SumInCardioHeartZone int64 `json:"sumInCardioHeartZone,omitempty,string"` |
| 329 | // SumInFatBurnHeartZone: Active zone minutes in `HeartRateZone.FAT_BURN`. |
| 330 | SumInFatBurnHeartZone int64 `json:"sumInFatBurnHeartZone,omitempty,string"` |
| 331 | // SumInPeakHeartZone: Active zone minutes in `HeartRateZone.PEAK`. |
| 332 | SumInPeakHeartZone int64 `json:"sumInPeakHeartZone,omitempty,string"` |
| 333 | // ForceSendFields is a list of field names (e.g. "SumInCardioHeartZone") to |
| 334 | // unconditionally include in API requests. By default, fields with empty or |
| 335 | // default values are omitted from API requests. See |
| 336 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 337 | // details. |
| 338 | ForceSendFields []string `json:"-"` |
| 339 | // NullFields is a list of field names (e.g. "SumInCardioHeartZone") to include |
| 340 | // in API requests with the JSON null value. By default, fields with empty |
| 341 | // values are omitted from API requests. See |
| 342 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 343 | NullFields []string `json:"-"` |
| 344 | } |
| 345 | |
| 346 | func (s ActiveZoneMinutesRollupValue) MarshalJSON() ([]byte, error) { |
| 347 | type NoMethod ActiveZoneMinutesRollupValue |
| 348 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 349 | } |
| 350 | |
| 351 | // ActivityLevel: Internal type to capture activity level during a certain time |
| 352 | // interval. |
| 353 | type ActivityLevel struct { |
| 354 | // ActivityLevelType: Required. Activity level type in the given time interval. |
| 355 | // |
| 356 | // Possible values: |
| 357 | // "ACTIVITY_LEVEL_TYPE_UNSPECIFIED" - Unspecified activity level type. |
| 358 | // "SEDENTARY" - Sedentary activity level. |
| 359 | // "LIGHTLY_ACTIVE" - Lightly active activity level. |
| 360 | // "MODERATELY_ACTIVE" - Moderately active activity level. |
| 361 | // "VERY_ACTIVE" - Very active activity level. |
| 362 | ActivityLevelType string `json:"activityLevelType,omitempty"` |
| 363 | // Interval: Required. Observed interval. |
| 364 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 365 | // ForceSendFields is a list of field names (e.g. "ActivityLevelType") to |
| 366 | // unconditionally include in API requests. By default, fields with empty or |
| 367 | // default values are omitted from API requests. See |
| 368 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 369 | // details. |
| 370 | ForceSendFields []string `json:"-"` |
| 371 | // NullFields is a list of field names (e.g. "ActivityLevelType") to include in |
| 372 | // API requests with the JSON null value. By default, fields with empty values |
| 373 | // are omitted from API requests. See |
| 374 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 375 | NullFields []string `json:"-"` |
| 376 | } |
| 377 | |
| 378 | func (s ActivityLevel) MarshalJSON() ([]byte, error) { |
| 379 | type NoMethod ActivityLevel |
| 380 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 381 | } |
| 382 | |
| 383 | // ActivityLevelRollupByActivityLevelType: Represents the total duration in a |
| 384 | // specific activity level type. |
| 385 | type ActivityLevelRollupByActivityLevelType struct { |
| 386 | // ActivityLevelType: Activity level type. |
| 387 | // |
| 388 | // Possible values: |
| 389 | // "ACTIVITY_LEVEL_TYPE_UNSPECIFIED" - Unspecified activity level type. |
| 390 | // "SEDENTARY" - Sedentary activity level. |
| 391 | // "LIGHTLY_ACTIVE" - Lightly active activity level. |
| 392 | // "MODERATELY_ACTIVE" - Moderately active activity level. |
| 393 | // "VERY_ACTIVE" - Very active activity level. |
| 394 | ActivityLevelType string `json:"activityLevelType,omitempty"` |
| 395 | // TotalDuration: Total duration in the activity level type. |
| 396 | TotalDuration string `json:"totalDuration,omitempty"` |
| 397 | // ForceSendFields is a list of field names (e.g. "ActivityLevelType") to |
| 398 | // unconditionally include in API requests. By default, fields with empty or |
| 399 | // default values are omitted from API requests. See |
| 400 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 401 | // details. |
| 402 | ForceSendFields []string `json:"-"` |
| 403 | // NullFields is a list of field names (e.g. "ActivityLevelType") to include in |
| 404 | // API requests with the JSON null value. By default, fields with empty values |
| 405 | // are omitted from API requests. See |
| 406 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 407 | NullFields []string `json:"-"` |
| 408 | } |
| 409 | |
| 410 | func (s ActivityLevelRollupByActivityLevelType) MarshalJSON() ([]byte, error) { |
| 411 | type NoMethod ActivityLevelRollupByActivityLevelType |
| 412 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 413 | } |
| 414 | |
| 415 | // ActivityLevelRollupValue: Represents the result of the rollup of the |
| 416 | // activity level data type. |
| 417 | type ActivityLevelRollupValue struct { |
| 418 | // ActivityLevelRollupsByActivityLevelType: List of total durations in each |
| 419 | // activity level type. |
| 420 | ActivityLevelRollupsByActivityLevelType []*ActivityLevelRollupByActivityLevelType `json:"activityLevelRollupsByActivityLevelType,omitempty"` |
| 421 | // ForceSendFields is a list of field names (e.g. |
| 422 | // "ActivityLevelRollupsByActivityLevelType") to unconditionally include in API |
| 423 | // requests. By default, fields with empty or default values are omitted from |
| 424 | // API requests. See |
| 425 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 426 | // details. |
| 427 | ForceSendFields []string `json:"-"` |
| 428 | // NullFields is a list of field names (e.g. |
| 429 | // "ActivityLevelRollupsByActivityLevelType") to include in API requests with |
| 430 | // the JSON null value. By default, fields with empty values are omitted from |
| 431 | // API requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields |
| 432 | // for more details. |
| 433 | NullFields []string `json:"-"` |
| 434 | } |
| 435 | |
| 436 | func (s ActivityLevelRollupValue) MarshalJSON() ([]byte, error) { |
| 437 | type NoMethod ActivityLevelRollupValue |
| 438 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 439 | } |
| 440 | |
| 441 | // Altitude: Captures the altitude gain (i.e. deltas), and not level above sea, |
| 442 | // for a user in millimeters. |
| 443 | type Altitude struct { |
| 444 | // GainMillimeters: Required. Altitude gain in millimeters over the observed |
| 445 | // interval. |
| 446 | GainMillimeters int64 `json:"gainMillimeters,omitempty,string"` |
| 447 | // Interval: Required. Observed interval. |
| 448 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 449 | // ForceSendFields is a list of field names (e.g. "GainMillimeters") to |
| 450 | // unconditionally include in API requests. By default, fields with empty or |
| 451 | // default values are omitted from API requests. See |
| 452 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 453 | // details. |
| 454 | ForceSendFields []string `json:"-"` |
| 455 | // NullFields is a list of field names (e.g. "GainMillimeters") to include in |
| 456 | // API requests with the JSON null value. By default, fields with empty values |
| 457 | // are omitted from API requests. See |
| 458 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 459 | NullFields []string `json:"-"` |
| 460 | } |
| 461 | |
| 462 | func (s Altitude) MarshalJSON() ([]byte, error) { |
| 463 | type NoMethod Altitude |
| 464 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 465 | } |
| 466 | |
| 467 | // AltitudeRollupValue: Represents the result of the rollup of the user's |
| 468 | // altitude. |
| 469 | type AltitudeRollupValue struct { |
| 470 | // GainMillimetersSum: Sum of the altitude gain in millimeters. |
| 471 | GainMillimetersSum int64 `json:"gainMillimetersSum,omitempty,string"` |
| 472 | // ForceSendFields is a list of field names (e.g. "GainMillimetersSum") to |
| 473 | // unconditionally include in API requests. By default, fields with empty or |
| 474 | // default values are omitted from API requests. See |
| 475 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 476 | // details. |
| 477 | ForceSendFields []string `json:"-"` |
| 478 | // NullFields is a list of field names (e.g. "GainMillimetersSum") to include |
| 479 | // in API requests with the JSON null value. By default, fields with empty |
| 480 | // values are omitted from API requests. See |
| 481 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 482 | NullFields []string `json:"-"` |
| 483 | } |
| 484 | |
| 485 | func (s AltitudeRollupValue) MarshalJSON() ([]byte, error) { |
| 486 | type NoMethod AltitudeRollupValue |
| 487 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 488 | } |
| 489 | |
| 490 | // Application: Optional metadata for the application that provided this data. |
| 491 | type Application struct { |
| 492 | // GoogleWebClientId: Output only. The Google OAuth 2.0 client ID of the web |
| 493 | // application or service that recorded the data. This is the client ID used |
| 494 | // during the Google OAuth flow to obtain user credentials. This field is |
| 495 | // system-populated when the data is uploaded from Google Web API. |
| 496 | GoogleWebClientId string `json:"googleWebClientId,omitempty"` |
| 497 | // PackageName: Output only. A unique identifier for the mobile application |
| 498 | // that was the source of the data. This is typically the application's package |
| 499 | // name on Android (e.g., `com.google.fitbit`) or the bundle ID on iOS. This |
| 500 | // field is informational and helps trace data origin. This field is |
| 501 | // system-populated when the data is uploaded from the Fitbit mobile |
| 502 | // application, Health Connect or Health Kit. |
| 503 | PackageName string `json:"packageName,omitempty"` |
| 504 | // WebClientId: Output only. The client ID of the application that recorded the |
| 505 | // data. This ID is a legacy Fitbit API client ID, which is different from a |
| 506 | // Google OAuth client ID. Example format: `ABC123`. This field is |
| 507 | // system-populated and used for tracing data from legacy Fitbit API |
| 508 | // integrations. This field is system-populated when the data is uploaded from |
| 509 | // a legacy Fitbit API integration. |
| 510 | WebClientId string `json:"webClientId,omitempty"` |
| 511 | // ForceSendFields is a list of field names (e.g. "GoogleWebClientId") to |
| 512 | // unconditionally include in API requests. By default, fields with empty or |
| 513 | // default values are omitted from API requests. See |
| 514 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 515 | // details. |
| 516 | ForceSendFields []string `json:"-"` |
| 517 | // NullFields is a list of field names (e.g. "GoogleWebClientId") to include in |
| 518 | // API requests with the JSON null value. By default, fields with empty values |
| 519 | // are omitted from API requests. See |
| 520 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 521 | NullFields []string `json:"-"` |
| 522 | } |
| 523 | |
| 524 | func (s Application) MarshalJSON() ([]byte, error) { |
| 525 | type NoMethod Application |
| 526 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 527 | } |
| 528 | |
| 529 | // BatchDeleteDataPointsRequest: Request to delete a batch of identifiable data |
| 530 | // points. |
| 531 | type BatchDeleteDataPointsRequest struct { |
| 532 | // Names: Required. The names of the DataPoints to delete. A maximum of 10000 |
| 533 | // data points can be deleted in a single request. |
| 534 | Names []string `json:"names,omitempty"` |
| 535 | // ForceSendFields is a list of field names (e.g. "Names") to unconditionally |
| 536 | // include in API requests. By default, fields with empty or default values are |
| 537 | // omitted from API requests. See |
| 538 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 539 | // details. |
| 540 | ForceSendFields []string `json:"-"` |
| 541 | // NullFields is a list of field names (e.g. "Names") to include in API |
| 542 | // requests with the JSON null value. By default, fields with empty values are |
| 543 | // omitted from API requests. See |
| 544 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 545 | NullFields []string `json:"-"` |
| 546 | } |
| 547 | |
| 548 | func (s BatchDeleteDataPointsRequest) MarshalJSON() ([]byte, error) { |
| 549 | type NoMethod BatchDeleteDataPointsRequest |
| 550 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 551 | } |
| 552 | |
| 553 | // BodyFat: Body fat measurement. |
| 554 | type BodyFat struct { |
| 555 | // Percentage: Required. Body fat percentage, in range [0, 100]. |
| 556 | Percentage float64 `json:"percentage,omitempty"` |
| 557 | // SampleTime: Required. The time at which body fat was measured. |
| 558 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 559 | // ForceSendFields is a list of field names (e.g. "Percentage") to |
| 560 | // unconditionally include in API requests. By default, fields with empty or |
| 561 | // default values are omitted from API requests. See |
| 562 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 563 | // details. |
| 564 | ForceSendFields []string `json:"-"` |
| 565 | // NullFields is a list of field names (e.g. "Percentage") to include in API |
| 566 | // requests with the JSON null value. By default, fields with empty values are |
| 567 | // omitted from API requests. See |
| 568 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 569 | NullFields []string `json:"-"` |
| 570 | } |
| 571 | |
| 572 | func (s BodyFat) MarshalJSON() ([]byte, error) { |
| 573 | type NoMethod BodyFat |
| 574 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 575 | } |
| 576 | |
| 577 | func (s *BodyFat) UnmarshalJSON(data []byte) error { |
| 578 | type NoMethod BodyFat |
| 579 | var s1 struct { |
| 580 | Percentage gensupport.JSONFloat64 `json:"percentage"` |
| 581 | *NoMethod |
| 582 | } |
| 583 | s1.NoMethod = (*NoMethod)(s) |
| 584 | if err := json.Unmarshal(data, &s1); err != nil { |
| 585 | return err |
| 586 | } |
| 587 | s.Percentage = float64(s1.Percentage) |
| 588 | return nil |
| 589 | } |
| 590 | |
| 591 | // BodyFatRollupValue: Represents the result of the rollup of the body fat data |
| 592 | // type. |
| 593 | type BodyFatRollupValue struct { |
| 594 | // BodyFatPercentageAvg: Average body fat percentage. |
| 595 | BodyFatPercentageAvg float64 `json:"bodyFatPercentageAvg,omitempty"` |
| 596 | // ForceSendFields is a list of field names (e.g. "BodyFatPercentageAvg") to |
| 597 | // unconditionally include in API requests. By default, fields with empty or |
| 598 | // default values are omitted from API requests. See |
| 599 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 600 | // details. |
| 601 | ForceSendFields []string `json:"-"` |
| 602 | // NullFields is a list of field names (e.g. "BodyFatPercentageAvg") to include |
| 603 | // in API requests with the JSON null value. By default, fields with empty |
| 604 | // values are omitted from API requests. See |
| 605 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 606 | NullFields []string `json:"-"` |
| 607 | } |
| 608 | |
| 609 | func (s BodyFatRollupValue) MarshalJSON() ([]byte, error) { |
| 610 | type NoMethod BodyFatRollupValue |
| 611 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 612 | } |
| 613 | |
| 614 | func (s *BodyFatRollupValue) UnmarshalJSON(data []byte) error { |
| 615 | type NoMethod BodyFatRollupValue |
| 616 | var s1 struct { |
| 617 | BodyFatPercentageAvg gensupport.JSONFloat64 `json:"bodyFatPercentageAvg"` |
| 618 | *NoMethod |
| 619 | } |
| 620 | s1.NoMethod = (*NoMethod)(s) |
| 621 | if err := json.Unmarshal(data, &s1); err != nil { |
| 622 | return err |
| 623 | } |
| 624 | s.BodyFatPercentageAvg = float64(s1.BodyFatPercentageAvg) |
| 625 | return nil |
| 626 | } |
| 627 | |
| 628 | // CaloriesInHeartRateZoneRollupValue: Represents the result of the rollup of |
| 629 | // the calories in heart rate zone data type. |
| 630 | type CaloriesInHeartRateZoneRollupValue struct { |
| 631 | // CaloriesInHeartRateZones: List of calories burned in each heart rate zone. |
| 632 | CaloriesInHeartRateZones []*CaloriesInHeartRateZoneValue `json:"caloriesInHeartRateZones,omitempty"` |
| 633 | // ForceSendFields is a list of field names (e.g. "CaloriesInHeartRateZones") |
| 634 | // to unconditionally include in API requests. By default, fields with empty or |
| 635 | // default values are omitted from API requests. See |
| 636 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 637 | // details. |
| 638 | ForceSendFields []string `json:"-"` |
| 639 | // NullFields is a list of field names (e.g. "CaloriesInHeartRateZones") to |
| 640 | // include in API requests with the JSON null value. By default, fields with |
| 641 | // empty values are omitted from API requests. See |
| 642 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 643 | NullFields []string `json:"-"` |
| 644 | } |
| 645 | |
| 646 | func (s CaloriesInHeartRateZoneRollupValue) MarshalJSON() ([]byte, error) { |
| 647 | type NoMethod CaloriesInHeartRateZoneRollupValue |
| 648 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 649 | } |
| 650 | |
| 651 | // CaloriesInHeartRateZoneValue: Represents the amount of kilocalories burned |
| 652 | // in a specific heart rate zone. |
| 653 | type CaloriesInHeartRateZoneValue struct { |
| 654 | // HeartRateZone: The heart rate zone. |
| 655 | // |
| 656 | // Possible values: |
| 657 | // "HEART_RATE_ZONE_TYPE_UNSPECIFIED" - Unspecified heart rate zone. |
| 658 | // "LIGHT" - The light heart rate zone. |
| 659 | // "MODERATE" - The moderate heart rate zone. |
| 660 | // "VIGOROUS" - The vigorous heart rate zone. |
| 661 | // "PEAK" - The peak heart rate zone. |
| 662 | HeartRateZone string `json:"heartRateZone,omitempty"` |
| 663 | // Kcal: The amount of kilocalories burned in the specified heart rate zone. |
| 664 | Kcal float64 `json:"kcal,omitempty"` |
| 665 | // ForceSendFields is a list of field names (e.g. "HeartRateZone") to |
| 666 | // unconditionally include in API requests. By default, fields with empty or |
| 667 | // default values are omitted from API requests. See |
| 668 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 669 | // details. |
| 670 | ForceSendFields []string `json:"-"` |
| 671 | // NullFields is a list of field names (e.g. "HeartRateZone") to include in API |
| 672 | // requests with the JSON null value. By default, fields with empty values are |
| 673 | // omitted from API requests. See |
| 674 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 675 | NullFields []string `json:"-"` |
| 676 | } |
| 677 | |
| 678 | func (s CaloriesInHeartRateZoneValue) MarshalJSON() ([]byte, error) { |
| 679 | type NoMethod CaloriesInHeartRateZoneValue |
| 680 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 681 | } |
| 682 | |
| 683 | func (s *CaloriesInHeartRateZoneValue) UnmarshalJSON(data []byte) error { |
| 684 | type NoMethod CaloriesInHeartRateZoneValue |
| 685 | var s1 struct { |
| 686 | Kcal gensupport.JSONFloat64 `json:"kcal"` |
| 687 | *NoMethod |
| 688 | } |
| 689 | s1.NoMethod = (*NoMethod)(s) |
| 690 | if err := json.Unmarshal(data, &s1); err != nil { |
| 691 | return err |
| 692 | } |
| 693 | s.Kcal = float64(s1.Kcal) |
| 694 | return nil |
| 695 | } |
| 696 | |
| 697 | // CivilDateTime: Civil time representation similar to google.type.DateTime, |
| 698 | // but ensures that neither the timezone nor the UTC offset can be set to avoid |
| 699 | // confusion between civil and physical time queries. |
| 700 | type CivilDateTime struct { |
| 701 | // Date: Required. Calendar date. |
| 702 | Date *Date `json:"date,omitempty"` |
| 703 | // Time: Optional. Time of day. Defaults to the start of the day, at midnight |
| 704 | // if omitted. |
| 705 | Time *TimeOfDay `json:"time,omitempty"` |
| 706 | // ForceSendFields is a list of field names (e.g. "Date") to unconditionally |
| 707 | // include in API requests. By default, fields with empty or default values are |
| 708 | // omitted from API requests. See |
| 709 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 710 | // details. |
| 711 | ForceSendFields []string `json:"-"` |
| 712 | // NullFields is a list of field names (e.g. "Date") to include in API requests |
| 713 | // with the JSON null value. By default, fields with empty values are omitted |
| 714 | // from API requests. See |
| 715 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 716 | NullFields []string `json:"-"` |
| 717 | } |
| 718 | |
| 719 | func (s CivilDateTime) MarshalJSON() ([]byte, error) { |
| 720 | type NoMethod CivilDateTime |
| 721 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 722 | } |
| 723 | |
| 724 | // CivilTimeInterval: Counterpart of google.type.Interval, but using |
| 725 | // CivilDateTime. |
| 726 | type CivilTimeInterval struct { |
| 727 | // End: Required. The exclusive end of the range. |
| 728 | End *CivilDateTime `json:"end,omitempty"` |
| 729 | // Start: Required. The inclusive start of the range. |
| 730 | Start *CivilDateTime `json:"start,omitempty"` |
| 731 | // ForceSendFields is a list of field names (e.g. "End") to unconditionally |
| 732 | // include in API requests. By default, fields with empty or default values are |
| 733 | // omitted from API requests. See |
| 734 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 735 | // details. |
| 736 | ForceSendFields []string `json:"-"` |
| 737 | // NullFields is a list of field names (e.g. "End") to include in API requests |
| 738 | // with the JSON null value. By default, fields with empty values are omitted |
| 739 | // from API requests. See |
| 740 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 741 | NullFields []string `json:"-"` |
| 742 | } |
| 743 | |
| 744 | func (s CivilTimeInterval) MarshalJSON() ([]byte, error) { |
| 745 | type NoMethod CivilTimeInterval |
| 746 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 747 | } |
| 748 | |
| 749 | // DailyHeartRateVariability: Represents the daily heart rate variability data |
| 750 | // type. At least one of the following fields must be set: - |
| 751 | // `average_heart_rate_variability_milliseconds` - |
| 752 | // `non_rem_heart_rate_beats_per_minute` - `entropy` - |
| 753 | // `deep_sleep_root_mean_square_of_successive_differences_milliseconds` |
| 754 | type DailyHeartRateVariability struct { |
| 755 | // AverageHeartRateVariabilityMilliseconds: Optional. A user's average heart |
| 756 | // rate variability calculated using the root mean square of successive |
| 757 | // differences (RMSSD) in times between heartbeats. |
| 758 | AverageHeartRateVariabilityMilliseconds float64 `json:"averageHeartRateVariabilityMilliseconds,omitempty"` |
| 759 | // Date: Required. Date (in the user's timezone) of heart rate variability |
| 760 | // measurement. |
| 761 | Date *Date `json:"date,omitempty"` |
| 762 | // DeepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds: Optional. The |
| 763 | // root mean square of successive differences (RMSSD) value during deep sleep. |
| 764 | DeepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds float64 `json:"deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds,omitempty"` |
| 765 | // Entropy: Optional. The Shanon entropy of heartbeat intervals. Entropy |
| 766 | // quantifies randomness or disorder in a system. High entropy indicates high |
| 767 | // HRV. Entropy is measured from the histogram of time interval between |
| 768 | // successive heart beats values measured during sleep. |
| 769 | Entropy float64 `json:"entropy,omitempty"` |
| 770 | // NonRemHeartRateBeatsPerMinute: Optional. Non-REM heart rate |
| 771 | NonRemHeartRateBeatsPerMinute int64 `json:"nonRemHeartRateBeatsPerMinute,omitempty,string"` |
| 772 | // ForceSendFields is a list of field names (e.g. |
| 773 | // "AverageHeartRateVariabilityMilliseconds") to unconditionally include in API |
| 774 | // requests. By default, fields with empty or default values are omitted from |
| 775 | // API requests. See |
| 776 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 777 | // details. |
| 778 | ForceSendFields []string `json:"-"` |
| 779 | // NullFields is a list of field names (e.g. |
| 780 | // "AverageHeartRateVariabilityMilliseconds") to include in API requests with |
| 781 | // the JSON null value. By default, fields with empty values are omitted from |
| 782 | // API requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields |
| 783 | // for more details. |
| 784 | NullFields []string `json:"-"` |
| 785 | } |
| 786 | |
| 787 | func (s DailyHeartRateVariability) MarshalJSON() ([]byte, error) { |
| 788 | type NoMethod DailyHeartRateVariability |
| 789 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 790 | } |
| 791 | |
| 792 | func (s *DailyHeartRateVariability) UnmarshalJSON(data []byte) error { |
| 793 | type NoMethod DailyHeartRateVariability |
| 794 | var s1 struct { |
| 795 | AverageHeartRateVariabilityMilliseconds gensupport.JSONFloat64 `json:"averageHeartRateVariabilityMilliseconds"` |
| 796 | DeepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds gensupport.JSONFloat64 `json:"deepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds"` |
| 797 | Entropy gensupport.JSONFloat64 `json:"entropy"` |
| 798 | *NoMethod |
| 799 | } |
| 800 | s1.NoMethod = (*NoMethod)(s) |
| 801 | if err := json.Unmarshal(data, &s1); err != nil { |
| 802 | return err |
| 803 | } |
| 804 | s.AverageHeartRateVariabilityMilliseconds = float64(s1.AverageHeartRateVariabilityMilliseconds) |
| 805 | s.DeepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds = float64(s1.DeepSleepRootMeanSquareOfSuccessiveDifferencesMilliseconds) |
| 806 | s.Entropy = float64(s1.Entropy) |
| 807 | return nil |
| 808 | } |
| 809 | |
| 810 | // DailyHeartRateZones: User's heart rate zone thresholds based on the Karvonen |
| 811 | // algorithm for a specific day. |
| 812 | type DailyHeartRateZones struct { |
| 813 | // Date: Required. Date (in user's timezone) of the heart rate zones record. |
| 814 | Date *Date `json:"date,omitempty"` |
| 815 | // HeartRateZones: Required. The heart rate zones. |
| 816 | HeartRateZones []*HeartRateZone `json:"heartRateZones,omitempty"` |
| 817 | // ForceSendFields is a list of field names (e.g. "Date") to unconditionally |
| 818 | // include in API requests. By default, fields with empty or default values are |
| 819 | // omitted from API requests. See |
| 820 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 821 | // details. |
| 822 | ForceSendFields []string `json:"-"` |
| 823 | // NullFields is a list of field names (e.g. "Date") to include in API requests |
| 824 | // with the JSON null value. By default, fields with empty values are omitted |
| 825 | // from API requests. See |
| 826 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 827 | NullFields []string `json:"-"` |
| 828 | } |
| 829 | |
| 830 | func (s DailyHeartRateZones) MarshalJSON() ([]byte, error) { |
| 831 | type NoMethod DailyHeartRateZones |
| 832 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 833 | } |
| 834 | |
| 835 | // DailyOxygenSaturation: A daily oxygen saturation (SpO2) record. Represents |
| 836 | // the user's daily oxygen saturation summary, typically calculated during |
| 837 | // sleep. |
| 838 | type DailyOxygenSaturation struct { |
| 839 | // AveragePercentage: Required. The average value of the oxygen saturation |
| 840 | // samples during the sleep. |
| 841 | AveragePercentage float64 `json:"averagePercentage,omitempty"` |
| 842 | // Date: Required. Date (in user's timezone) of the daily oxygen saturation |
| 843 | // record. |
| 844 | Date *Date `json:"date,omitempty"` |
| 845 | // LowerBoundPercentage: Required. The lower bound of the confidence interval |
| 846 | // of oxygen saturation samples during sleep. |
| 847 | LowerBoundPercentage float64 `json:"lowerBoundPercentage,omitempty"` |
| 848 | // StandardDeviationPercentage: Optional. Standard deviation of the daily |
| 849 | // oxygen saturation averages from the past 7-30 days. |
| 850 | StandardDeviationPercentage float64 `json:"standardDeviationPercentage,omitempty"` |
| 851 | // UpperBoundPercentage: Required. The upper bound of the confidence interval |
| 852 | // of oxygen saturation samples during sleep. |
| 853 | UpperBoundPercentage float64 `json:"upperBoundPercentage,omitempty"` |
| 854 | // ForceSendFields is a list of field names (e.g. "AveragePercentage") to |
| 855 | // unconditionally include in API requests. By default, fields with empty or |
| 856 | // default values are omitted from API requests. See |
| 857 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 858 | // details. |
| 859 | ForceSendFields []string `json:"-"` |
| 860 | // NullFields is a list of field names (e.g. "AveragePercentage") to include in |
| 861 | // API requests with the JSON null value. By default, fields with empty values |
| 862 | // are omitted from API requests. See |
| 863 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 864 | NullFields []string `json:"-"` |
| 865 | } |
| 866 | |
| 867 | func (s DailyOxygenSaturation) MarshalJSON() ([]byte, error) { |
| 868 | type NoMethod DailyOxygenSaturation |
| 869 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 870 | } |
| 871 | |
| 872 | func (s *DailyOxygenSaturation) UnmarshalJSON(data []byte) error { |
| 873 | type NoMethod DailyOxygenSaturation |
| 874 | var s1 struct { |
| 875 | AveragePercentage gensupport.JSONFloat64 `json:"averagePercentage"` |
| 876 | LowerBoundPercentage gensupport.JSONFloat64 `json:"lowerBoundPercentage"` |
| 877 | StandardDeviationPercentage gensupport.JSONFloat64 `json:"standardDeviationPercentage"` |
| 878 | UpperBoundPercentage gensupport.JSONFloat64 `json:"upperBoundPercentage"` |
| 879 | *NoMethod |
| 880 | } |
| 881 | s1.NoMethod = (*NoMethod)(s) |
| 882 | if err := json.Unmarshal(data, &s1); err != nil { |
| 883 | return err |
| 884 | } |
| 885 | s.AveragePercentage = float64(s1.AveragePercentage) |
| 886 | s.LowerBoundPercentage = float64(s1.LowerBoundPercentage) |
| 887 | s.StandardDeviationPercentage = float64(s1.StandardDeviationPercentage) |
| 888 | s.UpperBoundPercentage = float64(s1.UpperBoundPercentage) |
| 889 | return nil |
| 890 | } |
| 891 | |
| 892 | // DailyRespiratoryRate: A daily average respiratory rate (breaths per minute) |
| 893 | // for a day of the year. One data point per day calculated for the main sleep. |
| 894 | type DailyRespiratoryRate struct { |
| 895 | // BreathsPerMinute: Required. The average number of breaths taken per minute. |
| 896 | BreathsPerMinute float64 `json:"breathsPerMinute,omitempty"` |
| 897 | // Date: Required. The date on which the respiratory rate was measured. |
| 898 | Date *Date `json:"date,omitempty"` |
| 899 | // ForceSendFields is a list of field names (e.g. "BreathsPerMinute") to |
| 900 | // unconditionally include in API requests. By default, fields with empty or |
| 901 | // default values are omitted from API requests. See |
| 902 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 903 | // details. |
| 904 | ForceSendFields []string `json:"-"` |
| 905 | // NullFields is a list of field names (e.g. "BreathsPerMinute") to include in |
| 906 | // API requests with the JSON null value. By default, fields with empty values |
| 907 | // are omitted from API requests. See |
| 908 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 909 | NullFields []string `json:"-"` |
| 910 | } |
| 911 | |
| 912 | func (s DailyRespiratoryRate) MarshalJSON() ([]byte, error) { |
| 913 | type NoMethod DailyRespiratoryRate |
| 914 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 915 | } |
| 916 | |
| 917 | func (s *DailyRespiratoryRate) UnmarshalJSON(data []byte) error { |
| 918 | type NoMethod DailyRespiratoryRate |
| 919 | var s1 struct { |
| 920 | BreathsPerMinute gensupport.JSONFloat64 `json:"breathsPerMinute"` |
| 921 | *NoMethod |
| 922 | } |
| 923 | s1.NoMethod = (*NoMethod)(s) |
| 924 | if err := json.Unmarshal(data, &s1); err != nil { |
| 925 | return err |
| 926 | } |
| 927 | s.BreathsPerMinute = float64(s1.BreathsPerMinute) |
| 928 | return nil |
| 929 | } |
| 930 | |
| 931 | // DailyRestingHeartRate: Measures the daily resting heart rate for a user, |
| 932 | // calculated using the all day heart rate measurements. |
| 933 | type DailyRestingHeartRate struct { |
| 934 | // BeatsPerMinute: Required. The resting heart rate value in beats per minute. |
| 935 | BeatsPerMinute int64 `json:"beatsPerMinute,omitempty,string"` |
| 936 | // DailyRestingHeartRateMetadata: Optional. Metadata for the daily resting |
| 937 | // heart rate. |
| 938 | DailyRestingHeartRateMetadata *DailyRestingHeartRateMetadata `json:"dailyRestingHeartRateMetadata,omitempty"` |
| 939 | // Date: Required. Date (in the user's timezone) of the resting heart rate |
| 940 | // measurement. |
| 941 | Date *Date `json:"date,omitempty"` |
| 942 | // ForceSendFields is a list of field names (e.g. "BeatsPerMinute") to |
| 943 | // unconditionally include in API requests. By default, fields with empty or |
| 944 | // default values are omitted from API requests. See |
| 945 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 946 | // details. |
| 947 | ForceSendFields []string `json:"-"` |
| 948 | // NullFields is a list of field names (e.g. "BeatsPerMinute") to include in |
| 949 | // API requests with the JSON null value. By default, fields with empty values |
| 950 | // are omitted from API requests. See |
| 951 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 952 | NullFields []string `json:"-"` |
| 953 | } |
| 954 | |
| 955 | func (s DailyRestingHeartRate) MarshalJSON() ([]byte, error) { |
| 956 | type NoMethod DailyRestingHeartRate |
| 957 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 958 | } |
| 959 | |
| 960 | // DailyRestingHeartRateMetadata: Metadata for the daily resting heart rate. |
| 961 | type DailyRestingHeartRateMetadata struct { |
| 962 | // CalculationMethod: Required. The method used to calculate the resting heart |
| 963 | // rate. |
| 964 | // |
| 965 | // Possible values: |
| 966 | // "CALCULATION_METHOD_UNSPECIFIED" - The calculation method is unspecified. |
| 967 | // "WITH_SLEEP" - The resting heart rate is calculated using the sleep data. |
| 968 | // "ONLY_WITH_AWAKE_DATA" - The resting heart rate is calculated using only |
| 969 | // awake data. |
| 970 | CalculationMethod string `json:"calculationMethod,omitempty"` |
| 971 | // ForceSendFields is a list of field names (e.g. "CalculationMethod") to |
| 972 | // unconditionally include in API requests. By default, fields with empty or |
| 973 | // default values are omitted from API requests. See |
| 974 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 975 | // details. |
| 976 | ForceSendFields []string `json:"-"` |
| 977 | // NullFields is a list of field names (e.g. "CalculationMethod") to include in |
| 978 | // API requests with the JSON null value. By default, fields with empty values |
| 979 | // are omitted from API requests. See |
| 980 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 981 | NullFields []string `json:"-"` |
| 982 | } |
| 983 | |
| 984 | func (s DailyRestingHeartRateMetadata) MarshalJSON() ([]byte, error) { |
| 985 | type NoMethod DailyRestingHeartRateMetadata |
| 986 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 987 | } |
| 988 | |
| 989 | // DailyRollUpDataPointsRequest: Request to roll up data points by civil time |
| 990 | // intervals. |
| 991 | type DailyRollUpDataPointsRequest struct { |
| 992 | // DataSourceFamily: Optional. The data source family name to roll up. If |
| 993 | // empty, data points from all available data sources will be rolled up. |
| 994 | // Format: `users/me/dataSourceFamilies/{data_source_family}` The supported |
| 995 | // values are: - `users/me/dataSourceFamilies/all-sources` - default value - |
| 996 | // `users/me/dataSourceFamilies/google-wearables` - tracker devices - |
| 997 | // `users/me/dataSourceFamilies/google-sources` - Google first party sources |
| 998 | DataSourceFamily string `json:"dataSourceFamily,omitempty"` |
| 999 | // PageSize: Optional. The maximum number of data points to return. If |
| 1000 | // unspecified, at most 1440 data points will be returned. The maximum page |
| 1001 | // size is 10000; values above that will be truncated accordingly. |
| 1002 | PageSize int64 `json:"pageSize,omitempty"` |
| 1003 | // PageToken: Optional. The `next_page_token` from a previous request, if any. |
| 1004 | // All other request fields need to be the same as in the initial request when |
| 1005 | // the page token is specified. |
| 1006 | PageToken string `json:"pageToken,omitempty"` |
| 1007 | // Range: Required. Closed-open range of data points that will be rolled up. |
| 1008 | // The start time must be aligned with the aggregation window. The maximum |
| 1009 | // range for `calories-in-heart-rate-zone`, `heart-rate`, `active-minutes` and |
| 1010 | // `total-calories` is 14 days. The maximum range for all other data types is |
| 1011 | // 90 days. |
| 1012 | Range *CivilTimeInterval `json:"range,omitempty"` |
| 1013 | // WindowSizeDays: Optional. Aggregation window size, in number of days. |
| 1014 | // Defaults to 1 if not specified. |
| 1015 | WindowSizeDays int64 `json:"windowSizeDays,omitempty"` |
| 1016 | // ForceSendFields is a list of field names (e.g. "DataSourceFamily") to |
| 1017 | // unconditionally include in API requests. By default, fields with empty or |
| 1018 | // default values are omitted from API requests. See |
| 1019 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1020 | // details. |
| 1021 | ForceSendFields []string `json:"-"` |
| 1022 | // NullFields is a list of field names (e.g. "DataSourceFamily") to include in |
| 1023 | // API requests with the JSON null value. By default, fields with empty values |
| 1024 | // are omitted from API requests. See |
| 1025 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1026 | NullFields []string `json:"-"` |
| 1027 | } |
| 1028 | |
| 1029 | func (s DailyRollUpDataPointsRequest) MarshalJSON() ([]byte, error) { |
| 1030 | type NoMethod DailyRollUpDataPointsRequest |
| 1031 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1032 | } |
| 1033 | |
| 1034 | // DailyRollUpDataPointsResponse: Response containing the list of rolled up |
| 1035 | // data points. |
| 1036 | type DailyRollUpDataPointsResponse struct { |
| 1037 | // RollupDataPoints: Values for each aggregation time window. |
| 1038 | RollupDataPoints []*DailyRollupDataPoint `json:"rollupDataPoints,omitempty"` |
| 1039 | |
| 1040 | // ServerResponse contains the HTTP response code and headers from the server. |
| 1041 | googleapi.ServerResponse `json:"-"` |
| 1042 | // ForceSendFields is a list of field names (e.g. "RollupDataPoints") to |
| 1043 | // unconditionally include in API requests. By default, fields with empty or |
| 1044 | // default values are omitted from API requests. See |
| 1045 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1046 | // details. |
| 1047 | ForceSendFields []string `json:"-"` |
| 1048 | // NullFields is a list of field names (e.g. "RollupDataPoints") to include in |
| 1049 | // API requests with the JSON null value. By default, fields with empty values |
| 1050 | // are omitted from API requests. See |
| 1051 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1052 | NullFields []string `json:"-"` |
| 1053 | } |
| 1054 | |
| 1055 | func (s DailyRollUpDataPointsResponse) MarshalJSON() ([]byte, error) { |
| 1056 | type NoMethod DailyRollUpDataPointsResponse |
| 1057 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1058 | } |
| 1059 | |
| 1060 | // DailyRollupDataPoint: Value of a daily rollup for a single civil time |
| 1061 | // interval (aggregation window) |
| 1062 | type DailyRollupDataPoint struct { |
| 1063 | // ActiveMinutes: Returned by default when rolling up data points from the |
| 1064 | // `active-minutes` data type, or when requested explicitly using the |
| 1065 | // `active-minutes` rollup type identifier. |
| 1066 | ActiveMinutes *ActiveMinutesRollupValue `json:"activeMinutes,omitempty"` |
| 1067 | // ActiveZoneMinutes: Returned by default when rolling up data points from the |
| 1068 | // `active-zone-minutes` data type, or when requested explicitly using the |
| 1069 | // `active-zone-minutes` rollup type identifier. |
| 1070 | ActiveZoneMinutes *ActiveZoneMinutesRollupValue `json:"activeZoneMinutes,omitempty"` |
| 1071 | // ActivityLevel: Returned by default when rolling up data points from the |
| 1072 | // `activity-level` data type, or when requested explicitly using the |
| 1073 | // `activity-level` rollup type identifier. |
| 1074 | ActivityLevel *ActivityLevelRollupValue `json:"activityLevel,omitempty"` |
| 1075 | // Altitude: Returned by default when rolling up data points from the |
| 1076 | // `altitude` data type, or when requested explicitly using the `altitude` |
| 1077 | // rollup type identifier. |
| 1078 | Altitude *AltitudeRollupValue `json:"altitude,omitempty"` |
| 1079 | // BodyFat: Returned by default when rolling up data points from the `body-fat` |
| 1080 | // data type, or when requested explicitly using the `body-fat` rollup type |
| 1081 | // identifier. |
| 1082 | BodyFat *BodyFatRollupValue `json:"bodyFat,omitempty"` |
| 1083 | // CaloriesInHeartRateZone: Returned by default when rolling up data points |
| 1084 | // from the `calories-in-heart-rate-zone` data type, or when requested |
| 1085 | // explicitly using the `calories-in-heart-rate-zone` rollup type identifier. |
| 1086 | CaloriesInHeartRateZone *CaloriesInHeartRateZoneRollupValue `json:"caloriesInHeartRateZone,omitempty"` |
| 1087 | // CivilEndTime: End time of the window this value aggregates over |
| 1088 | CivilEndTime *CivilDateTime `json:"civilEndTime,omitempty"` |
| 1089 | // CivilStartTime: Start time of the window this value aggregates over |
| 1090 | CivilStartTime *CivilDateTime `json:"civilStartTime,omitempty"` |
| 1091 | // Distance: Returned by default when rolling up data points from the |
| 1092 | // `distance` data type, or when requested explicitly using the `distance` |
| 1093 | // rollup type identifier. |
| 1094 | Distance *DistanceRollupValue `json:"distance,omitempty"` |
| 1095 | // Floors: Returned by default when rolling up data points from the `floors` |
| 1096 | // data type, or when requested explicitly using the `floors` rollup type |
| 1097 | // identifier. |
| 1098 | Floors *FloorsRollupValue `json:"floors,omitempty"` |
| 1099 | // HeartRate: Returned by default when rolling up data points from the |
| 1100 | // `heart-rate` data type, or when requested explicitly using the `heart-rate` |
| 1101 | // rollup type identifier. |
| 1102 | HeartRate *HeartRateRollupValue `json:"heartRate,omitempty"` |
| 1103 | // HeartRateVariabilityPersonalRange: Returned by default when rolling up data |
| 1104 | // points from the `daily-heart-rate-variability` data type, or when requested |
| 1105 | // explicitly using the `heart-rate-variability-personal-range` rollup type |
| 1106 | // identifier. |
| 1107 | HeartRateVariabilityPersonalRange *HeartRateVariabilityPersonalRangeRollupValue `json:"heartRateVariabilityPersonalRange,omitempty"` |
| 1108 | // HydrationLog: Returned by default when rolling up data points from the |
| 1109 | // `hydration-log` data type, or when requested explicitly using the |
| 1110 | // `hydration-log` rollup type identifier. |
| 1111 | HydrationLog *HydrationLogRollupValue `json:"hydrationLog,omitempty"` |
| 1112 | // RestingHeartRatePersonalRange: Returned by default when rolling up data |
| 1113 | // points from the `daily-resting-heart-rate` data type, or when requested |
| 1114 | // explicitly using the `resting-heart-rate-personal-range` rollup type |
| 1115 | // identifier. |
| 1116 | RestingHeartRatePersonalRange *RestingHeartRatePersonalRangeRollupValue `json:"restingHeartRatePersonalRange,omitempty"` |
| 1117 | // RunVo2Max: Returned by default when rolling up data points from the |
| 1118 | // `run-vo2-max` data type, or when requested explicitly using the |
| 1119 | // `run-vo2-max` rollup type identifier. |
| 1120 | RunVo2Max *RunVO2MaxRollupValue `json:"runVo2Max,omitempty"` |
| 1121 | // SedentaryPeriod: Returned by default when rolling up data points from the |
| 1122 | // `sedentary-period` data type, or when requested explicitly using the |
| 1123 | // `sedentary-period` rollup type identifier. |
| 1124 | SedentaryPeriod *SedentaryPeriodRollupValue `json:"sedentaryPeriod,omitempty"` |
| 1125 | // Steps: Returned by default when rolling up data points from the `steps` data |
| 1126 | // type, or when requested explicitly using the `steps` rollup type identifier. |
| 1127 | Steps *StepsRollupValue `json:"steps,omitempty"` |
| 1128 | // TimeInHeartRateZone: Returned by default when rolling up data points from |
| 1129 | // the `time-in-heart-rate-zone` data type, or when requested explicitly using |
| 1130 | // the `time-in-heart-rate-zone` rollup type identifier. |
| 1131 | TimeInHeartRateZone *TimeInHeartRateZoneRollupValue `json:"timeInHeartRateZone,omitempty"` |
| 1132 | // TotalCalories: Returned by default when rolling up data points from the |
| 1133 | // `total-calories` data type, or when requested explicitly using the |
| 1134 | // `total-calories` rollup type identifier. |
| 1135 | TotalCalories *TotalCaloriesRollupValue `json:"totalCalories,omitempty"` |
| 1136 | // Weight: Returned by default when rolling up data points from the `weight` |
| 1137 | // data type, or when requested explicitly using the `weight` rollup type |
| 1138 | // identifier. |
| 1139 | Weight *WeightRollupValue `json:"weight,omitempty"` |
| 1140 | // ForceSendFields is a list of field names (e.g. "ActiveMinutes") to |
| 1141 | // unconditionally include in API requests. By default, fields with empty or |
| 1142 | // default values are omitted from API requests. See |
| 1143 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1144 | // details. |
| 1145 | ForceSendFields []string `json:"-"` |
| 1146 | // NullFields is a list of field names (e.g. "ActiveMinutes") to include in API |
| 1147 | // requests with the JSON null value. By default, fields with empty values are |
| 1148 | // omitted from API requests. See |
| 1149 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1150 | NullFields []string `json:"-"` |
| 1151 | } |
| 1152 | |
| 1153 | func (s DailyRollupDataPoint) MarshalJSON() ([]byte, error) { |
| 1154 | type NoMethod DailyRollupDataPoint |
| 1155 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1156 | } |
| 1157 | |
| 1158 | // DailySleepTemperatureDerivations: Provides derived sleep temperature values, |
| 1159 | // calculated from skin or internal device temperature readings during sleep. |
| 1160 | type DailySleepTemperatureDerivations struct { |
| 1161 | // BaselineTemperatureCelsius: Optional. The user's baseline skin temperature. |
| 1162 | // It is the median of the user's nightly skin temperature over the past 30 |
| 1163 | // days. |
| 1164 | BaselineTemperatureCelsius float64 `json:"baselineTemperatureCelsius,omitempty"` |
| 1165 | // Date: Required. Date for which the sleep temperature derivations are |
| 1166 | // calculated. |
| 1167 | Date *Date `json:"date,omitempty"` |
| 1168 | // NightlyTemperatureCelsius: Required. The user's nightly skin temperature. It |
| 1169 | // is the mean of skin temperature samples taken from the user’s sleep. |
| 1170 | NightlyTemperatureCelsius float64 `json:"nightlyTemperatureCelsius,omitempty"` |
| 1171 | // RelativeNightlyStddev30dCelsius: Optional. The standard deviation of the |
| 1172 | // user’s relative nightly skin temperature (temperature - baseline) over the |
| 1173 | // past 30 days. |
| 1174 | RelativeNightlyStddev30dCelsius float64 `json:"relativeNightlyStddev30dCelsius,omitempty"` |
| 1175 | // ForceSendFields is a list of field names (e.g. "BaselineTemperatureCelsius") |
| 1176 | // to unconditionally include in API requests. By default, fields with empty or |
| 1177 | // default values are omitted from API requests. See |
| 1178 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1179 | // details. |
| 1180 | ForceSendFields []string `json:"-"` |
| 1181 | // NullFields is a list of field names (e.g. "BaselineTemperatureCelsius") to |
| 1182 | // include in API requests with the JSON null value. By default, fields with |
| 1183 | // empty values are omitted from API requests. See |
| 1184 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1185 | NullFields []string `json:"-"` |
| 1186 | } |
| 1187 | |
| 1188 | func (s DailySleepTemperatureDerivations) MarshalJSON() ([]byte, error) { |
| 1189 | type NoMethod DailySleepTemperatureDerivations |
| 1190 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1191 | } |
| 1192 | |
| 1193 | func (s *DailySleepTemperatureDerivations) UnmarshalJSON(data []byte) error { |
| 1194 | type NoMethod DailySleepTemperatureDerivations |
| 1195 | var s1 struct { |
| 1196 | BaselineTemperatureCelsius gensupport.JSONFloat64 `json:"baselineTemperatureCelsius"` |
| 1197 | NightlyTemperatureCelsius gensupport.JSONFloat64 `json:"nightlyTemperatureCelsius"` |
| 1198 | RelativeNightlyStddev30dCelsius gensupport.JSONFloat64 `json:"relativeNightlyStddev30dCelsius"` |
| 1199 | *NoMethod |
| 1200 | } |
| 1201 | s1.NoMethod = (*NoMethod)(s) |
| 1202 | if err := json.Unmarshal(data, &s1); err != nil { |
| 1203 | return err |
| 1204 | } |
| 1205 | s.BaselineTemperatureCelsius = float64(s1.BaselineTemperatureCelsius) |
| 1206 | s.NightlyTemperatureCelsius = float64(s1.NightlyTemperatureCelsius) |
| 1207 | s.RelativeNightlyStddev30dCelsius = float64(s1.RelativeNightlyStddev30dCelsius) |
| 1208 | return nil |
| 1209 | } |
| 1210 | |
| 1211 | // DailyVO2Max: Contains a daily summary of the user's VO2 max (cardio fitness |
| 1212 | // score), which is the maximum rate of oxygen the body can use during |
| 1213 | // exercise. |
| 1214 | type DailyVO2Max struct { |
| 1215 | // CardioFitnessLevel: Optional. Represents the user's cardio fitness level |
| 1216 | // based on their VO2 max. |
| 1217 | // |
| 1218 | // Possible values: |
| 1219 | // "CARDIO_FITNESS_LEVEL_UNSPECIFIED" - Unspecified cardio fitness level. |
| 1220 | // "POOR" - Poor cardio fitness level. |
| 1221 | // "FAIR" - Fair cardio fitness level. |
| 1222 | // "AVERAGE" - Average cardio fitness level. |
| 1223 | // "GOOD" - Good cardio fitness level. |
| 1224 | // "VERY_GOOD" - Very good cardio fitness level. |
| 1225 | // "EXCELLENT" - Excellent cardio fitness level. |
| 1226 | CardioFitnessLevel string `json:"cardioFitnessLevel,omitempty"` |
| 1227 | // Date: Required. The date for which the Daily VO2 max was measured. |
| 1228 | Date *Date `json:"date,omitempty"` |
| 1229 | // Estimated: Optional. An estimated field is added to indicate when the |
| 1230 | // confidence has decreased sufficiently to consider the value an estimation. |
| 1231 | Estimated bool `json:"estimated,omitempty"` |
| 1232 | // Vo2Max: Required. Daily VO2 max value measured as in ml consumed oxygen / kg |
| 1233 | // of body weight / min. |
| 1234 | Vo2Max float64 `json:"vo2Max,omitempty"` |
| 1235 | // Vo2MaxCovariance: Optional. The covariance of the VO2 max value. |
| 1236 | Vo2MaxCovariance float64 `json:"vo2MaxCovariance,omitempty"` |
| 1237 | // ForceSendFields is a list of field names (e.g. "CardioFitnessLevel") to |
| 1238 | // unconditionally include in API requests. By default, fields with empty or |
| 1239 | // default values are omitted from API requests. See |
| 1240 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1241 | // details. |
| 1242 | ForceSendFields []string `json:"-"` |
| 1243 | // NullFields is a list of field names (e.g. "CardioFitnessLevel") to include |
| 1244 | // in API requests with the JSON null value. By default, fields with empty |
| 1245 | // values are omitted from API requests. See |
| 1246 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1247 | NullFields []string `json:"-"` |
| 1248 | } |
| 1249 | |
| 1250 | func (s DailyVO2Max) MarshalJSON() ([]byte, error) { |
| 1251 | type NoMethod DailyVO2Max |
| 1252 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1253 | } |
| 1254 | |
| 1255 | func (s *DailyVO2Max) UnmarshalJSON(data []byte) error { |
| 1256 | type NoMethod DailyVO2Max |
| 1257 | var s1 struct { |
| 1258 | Vo2Max gensupport.JSONFloat64 `json:"vo2Max"` |
| 1259 | Vo2MaxCovariance gensupport.JSONFloat64 `json:"vo2MaxCovariance"` |
| 1260 | *NoMethod |
| 1261 | } |
| 1262 | s1.NoMethod = (*NoMethod)(s) |
| 1263 | if err := json.Unmarshal(data, &s1); err != nil { |
| 1264 | return err |
| 1265 | } |
| 1266 | s.Vo2Max = float64(s1.Vo2Max) |
| 1267 | s.Vo2MaxCovariance = float64(s1.Vo2MaxCovariance) |
| 1268 | return nil |
| 1269 | } |
| 1270 | |
| 1271 | // DataPoint: A computed or recorded metric. |
| 1272 | type DataPoint struct { |
| 1273 | // ActiveMinutes: Optional. Data for points in the `active-minutes` interval |
| 1274 | // data type collection. |
| 1275 | ActiveMinutes *ActiveMinutes `json:"activeMinutes,omitempty"` |
| 1276 | // ActiveZoneMinutes: Optional. Data for points in the `active-zone-minutes` |
| 1277 | // interval data type collection, measured in minutes. |
| 1278 | ActiveZoneMinutes *ActiveZoneMinutes `json:"activeZoneMinutes,omitempty"` |
| 1279 | // ActivityLevel: Optional. Data for points in the `activity-level` daily data |
| 1280 | // type collection. |
| 1281 | ActivityLevel *ActivityLevel `json:"activityLevel,omitempty"` |
| 1282 | // Altitude: Optional. Data for points in the `altitude` interval data type |
| 1283 | // collection. |
| 1284 | Altitude *Altitude `json:"altitude,omitempty"` |
| 1285 | // BodyFat: Optional. Data for points in the `body-fat` sample data type |
| 1286 | // collection. |
| 1287 | BodyFat *BodyFat `json:"bodyFat,omitempty"` |
| 1288 | // DailyHeartRateVariability: Optional. Data for points in the |
| 1289 | // `daily-heart-rate-variability` daily data type collection. |
| 1290 | DailyHeartRateVariability *DailyHeartRateVariability `json:"dailyHeartRateVariability,omitempty"` |
| 1291 | // DailyHeartRateZones: Optional. Data for points in the |
| 1292 | // `daily-heart-rate-zones` daily data type collection. |
| 1293 | DailyHeartRateZones *DailyHeartRateZones `json:"dailyHeartRateZones,omitempty"` |
| 1294 | // DailyOxygenSaturation: Optional. Data for points in the |
| 1295 | // `daily-oxygen-saturation` daily data type collection. |
| 1296 | DailyOxygenSaturation *DailyOxygenSaturation `json:"dailyOxygenSaturation,omitempty"` |
| 1297 | // DailyRespiratoryRate: Optional. Data for points in the |
| 1298 | // `daily-respiratory-rate` daily data type collection. |
| 1299 | DailyRespiratoryRate *DailyRespiratoryRate `json:"dailyRespiratoryRate,omitempty"` |
| 1300 | // DailyRestingHeartRate: Optional. Data for points in the |
| 1301 | // `daily-resting-heart-rate` daily data type collection. |
| 1302 | DailyRestingHeartRate *DailyRestingHeartRate `json:"dailyRestingHeartRate,omitempty"` |
| 1303 | // DailySleepTemperatureDerivations: Optional. Data for points in the |
| 1304 | // `daily-sleep-temperature-derivations` daily data type collection. |
| 1305 | DailySleepTemperatureDerivations *DailySleepTemperatureDerivations `json:"dailySleepTemperatureDerivations,omitempty"` |
| 1306 | // DailyVo2Max: Optional. Data for points in the `daily-vo2-max` daily data |
| 1307 | // type collection. |
| 1308 | DailyVo2Max *DailyVO2Max `json:"dailyVo2Max,omitempty"` |
| 1309 | // DataSource: Optional. Data source information for the metric |
| 1310 | DataSource *DataSource `json:"dataSource,omitempty"` |
| 1311 | // Distance: Optional. Data for points in the `distance` interval data type |
| 1312 | // collection. |
| 1313 | Distance *Distance `json:"distance,omitempty"` |
| 1314 | // Exercise: Optional. Data for points in the `exercise` session data type |
| 1315 | // collection. |
| 1316 | Exercise *Exercise `json:"exercise,omitempty"` |
| 1317 | // Floors: Optional. Data for points in the `floors` interval data type |
| 1318 | // collection. |
| 1319 | Floors *Floors `json:"floors,omitempty"` |
| 1320 | // HeartRate: Optional. Data for points in the `heart-rate` sample data type |
| 1321 | // collection. |
| 1322 | HeartRate *HeartRate `json:"heartRate,omitempty"` |
| 1323 | // HeartRateVariability: Optional. Data for points in the |
| 1324 | // `heart-rate-variability` sample data type collection. |
| 1325 | HeartRateVariability *HeartRateVariability `json:"heartRateVariability,omitempty"` |
| 1326 | // HydrationLog: Optional. Data for points in the `hydration-log` session data |
| 1327 | // type collection. |
| 1328 | HydrationLog *HydrationLog `json:"hydrationLog,omitempty"` |
| 1329 | // Name: Identifier. Data point name, only supported for the subset of |
| 1330 | // identifiable data types. For the majority of the data types, individual data |
| 1331 | // points do not need to be identified and this field would be empty. Format: |
| 1332 | // `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` Example: |
| 1333 | // `users/abcd1234/dataTypes/sleep/dataPoints/a1b2c3d4-e5f6-7890-1234-567890abcd |
| 1334 | // ef` The `{user}` ID is a system-generated identifier, as described in |
| 1335 | // Identity.health_user_id. The `{data_type}` ID corresponds to the kebab-case |
| 1336 | // version of the field names in the DataPoint data union field, e.g. |
| 1337 | // `total-calories` for the `total_calories` field. The `{data_point}` ID can |
| 1338 | // be client-provided or system-generated. If client-provided, it must be a |
| 1339 | // string of 4-63 characters, containing only lowercase letters, numbers, and |
| 1340 | // hyphens. |
| 1341 | Name string `json:"name,omitempty"` |
| 1342 | // OxygenSaturation: Optional. Data for points in the `oxygen-saturation` |
| 1343 | // sample data type collection. |
| 1344 | OxygenSaturation *OxygenSaturation `json:"oxygenSaturation,omitempty"` |
| 1345 | // RespiratoryRateSleepSummary: Optional. Data for points in the |
| 1346 | // `respiratory-rate-sleep-summary` sample data type collection. |
| 1347 | RespiratoryRateSleepSummary *RespiratoryRateSleepSummary `json:"respiratoryRateSleepSummary,omitempty"` |
| 1348 | // RunVo2Max: Optional. Data for points in the `run-vo2-max` sample data type |
| 1349 | // collection. |
| 1350 | RunVo2Max *RunVO2Max `json:"runVo2Max,omitempty"` |
| 1351 | // SedentaryPeriod: Optional. Data for points in the `sedentary-period` |
| 1352 | // interval data type collection. |
| 1353 | SedentaryPeriod *SedentaryPeriod `json:"sedentaryPeriod,omitempty"` |
| 1354 | // Sleep: Optional. Data for points in the `sleep` session data type |
| 1355 | // collection. |
| 1356 | Sleep *Sleep `json:"sleep,omitempty"` |
| 1357 | // Steps: Optional. Data for points in the `steps` interval data type |
| 1358 | // collection. |
| 1359 | Steps *Steps `json:"steps,omitempty"` |
| 1360 | // TimeInHeartRateZone: Optional. Data for points in the |
| 1361 | // `time-in-heart-rate-zone` interval data type collection. |
| 1362 | TimeInHeartRateZone *TimeInHeartRateZone `json:"timeInHeartRateZone,omitempty"` |
| 1363 | // Vo2Max: Optional. Data for points in the `vo2-max` sample data type |
| 1364 | // collection. |
| 1365 | Vo2Max *VO2Max `json:"vo2Max,omitempty"` |
| 1366 | // Weight: Optional. Data for points in the `weight` sample data type |
| 1367 | // collection. |
| 1368 | Weight *Weight `json:"weight,omitempty"` |
| 1369 | // ForceSendFields is a list of field names (e.g. "ActiveMinutes") to |
| 1370 | // unconditionally include in API requests. By default, fields with empty or |
| 1371 | // default values are omitted from API requests. See |
| 1372 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1373 | // details. |
| 1374 | ForceSendFields []string `json:"-"` |
| 1375 | // NullFields is a list of field names (e.g. "ActiveMinutes") to include in API |
| 1376 | // requests with the JSON null value. By default, fields with empty values are |
| 1377 | // omitted from API requests. See |
| 1378 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1379 | NullFields []string `json:"-"` |
| 1380 | } |
| 1381 | |
| 1382 | func (s DataPoint) MarshalJSON() ([]byte, error) { |
| 1383 | type NoMethod DataPoint |
| 1384 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1385 | } |
| 1386 | |
| 1387 | // DataSource: Data Source definition to track the origin of data. Each health |
| 1388 | // data point, regardless of the complexity or data model (whether a simple |
| 1389 | // step count or a detailed sleep session) must retain information about its |
| 1390 | // source of origin (e.g. the device or app that collected it). |
| 1391 | type DataSource struct { |
| 1392 | // Application: Output only. Captures metadata for the application that |
| 1393 | // provided this data. |
| 1394 | Application *Application `json:"application,omitempty"` |
| 1395 | // Device: Optional. Captures metadata for raw data points originating from |
| 1396 | // devices. We expect this data source to be used for data points written on |
| 1397 | // device sync. |
| 1398 | Device *Device `json:"device,omitempty"` |
| 1399 | // Platform: Output only. Captures the platform that uploaded the data. |
| 1400 | // |
| 1401 | // Possible values: |
| 1402 | // "PLATFORM_UNSPECIFIED" - The platform is unspecified. |
| 1403 | // "FITBIT" - The data was uploaded from Fitbit. |
| 1404 | // "HEALTH_CONNECT" - The data was uploaded from Health Connect. |
| 1405 | // "HEALTH_KIT" - The data was uploaded from Health Kit. |
| 1406 | // "FIT" - The data was uploaded from Google Fit. |
| 1407 | // "FITBIT_WEB_API" - The data was uploaded from Fitbit legacy Web API. |
| 1408 | // "NEST" - The data was uploaded from Nest devices. |
| 1409 | // "GOOGLE_WEB_API" - The data was uploaded from Google Health API. |
| 1410 | // "GOOGLE_PARTNER_INTEGRATION" - The data was uploaded from Google Partner |
| 1411 | // Integrations. |
| 1412 | Platform string `json:"platform,omitempty"` |
| 1413 | // RecordingMethod: Optional. Captures how the data was recorded. |
| 1414 | // |
| 1415 | // Possible values: |
| 1416 | // "RECORDING_METHOD_UNSPECIFIED" - The recording method is unspecified. |
| 1417 | // "MANUAL" - The data was manually entered by the user. |
| 1418 | // "PASSIVELY_MEASURED" - The data was passively measured by a device. |
| 1419 | // "DERIVED" - The data was derived from other data, e.g., by an algorithm in |
| 1420 | // the backend. |
| 1421 | // "ACTIVELY_MEASURED" - The data was actively measured by a device. |
| 1422 | // "UNKNOWN" - The recording method is unknown. This is set when the data is |
| 1423 | // uploaded from a third party app that does not provide this information. |
| 1424 | RecordingMethod string `json:"recordingMethod,omitempty"` |
| 1425 | // ForceSendFields is a list of field names (e.g. "Application") to |
| 1426 | // unconditionally include in API requests. By default, fields with empty or |
| 1427 | // default values are omitted from API requests. See |
| 1428 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1429 | // details. |
| 1430 | ForceSendFields []string `json:"-"` |
| 1431 | // NullFields is a list of field names (e.g. "Application") to include in API |
| 1432 | // requests with the JSON null value. By default, fields with empty values are |
| 1433 | // omitted from API requests. See |
| 1434 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1435 | NullFields []string `json:"-"` |
| 1436 | } |
| 1437 | |
| 1438 | func (s DataSource) MarshalJSON() ([]byte, error) { |
| 1439 | type NoMethod DataSource |
| 1440 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1441 | } |
| 1442 | |
| 1443 | // Date: Represents a whole or partial calendar date, such as a birthday. The |
| 1444 | // time of day and time zone are either specified elsewhere or are |
| 1445 | // insignificant. The date is relative to the Gregorian Calendar. This can |
| 1446 | // represent one of the following: * A full date, with non-zero year, month, |
| 1447 | // and day values. * A month and day, with a zero year (for example, an |
| 1448 | // anniversary). * A year on its own, with a zero month and a zero day. * A |
| 1449 | // year and month, with a zero day (for example, a credit card expiration |
| 1450 | // date). Related types: * google.type.TimeOfDay * google.type.DateTime * |
| 1451 | // google.protobuf.Timestamp |
| 1452 | type Date struct { |
| 1453 | // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, |
| 1454 | // or 0 to specify a year by itself or a year and month where the day isn't |
| 1455 | // significant. |
| 1456 | Day int64 `json:"day,omitempty"` |
| 1457 | // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without |
| 1458 | // a month and day. |
| 1459 | Month int64 `json:"month,omitempty"` |
| 1460 | // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date |
| 1461 | // without a year. |
| 1462 | Year int64 `json:"year,omitempty"` |
| 1463 | // ForceSendFields is a list of field names (e.g. "Day") to unconditionally |
| 1464 | // include in API requests. By default, fields with empty or default values are |
| 1465 | // omitted from API requests. See |
| 1466 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1467 | // details. |
| 1468 | ForceSendFields []string `json:"-"` |
| 1469 | // NullFields is a list of field names (e.g. "Day") to include in API requests |
| 1470 | // with the JSON null value. By default, fields with empty values are omitted |
| 1471 | // from API requests. See |
| 1472 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1473 | NullFields []string `json:"-"` |
| 1474 | } |
| 1475 | |
| 1476 | func (s Date) MarshalJSON() ([]byte, error) { |
| 1477 | type NoMethod Date |
| 1478 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1479 | } |
| 1480 | |
| 1481 | // DateTime: Represents civil time (or occasionally physical time). This type |
| 1482 | // can represent a civil time in one of a few possible ways: * When utc_offset |
| 1483 | // is set and time_zone is unset: a civil time on a calendar day with a |
| 1484 | // particular offset from UTC. * When time_zone is set and utc_offset is unset: |
| 1485 | // a civil time on a calendar day in a particular time zone. * When neither |
| 1486 | // time_zone nor utc_offset is set: a civil time on a calendar day in local |
| 1487 | // time. The date is relative to the Proleptic Gregorian Calendar. If year, |
| 1488 | // month, or day are 0, the DateTime is considered not to have a specific year, |
| 1489 | // month, or day respectively. This type may also be used to represent a |
| 1490 | // physical time if all the date and time fields are set and either case of the |
| 1491 | // `time_offset` oneof is set. Consider using `Timestamp` message for physical |
| 1492 | // time instead. If your use case also would like to store the user's timezone, |
| 1493 | // that can be done in another field. This type is more flexible than some |
| 1494 | // applications may want. Make sure to document and validate your application's |
| 1495 | // limitations. |
| 1496 | type DateTime struct { |
| 1497 | // Day: Optional. Day of month. Must be from 1 to 31 and valid for the year and |
| 1498 | // month, or 0 if specifying a datetime without a day. |
| 1499 | Day int64 `json:"day,omitempty"` |
| 1500 | // Hours: Optional. Hours of day in 24 hour format. Should be from 0 to 23, |
| 1501 | // defaults to 0 (midnight). An API may choose to allow the value "24:00:00" |
| 1502 | // for scenarios like business closing time. |
| 1503 | Hours int64 `json:"hours,omitempty"` |
| 1504 | // Minutes: Optional. Minutes of hour of day. Must be from 0 to 59, defaults to |
| 1505 | // 0. |
| 1506 | Minutes int64 `json:"minutes,omitempty"` |
| 1507 | // Month: Optional. Month of year. Must be from 1 to 12, or 0 if specifying a |
| 1508 | // datetime without a month. |
| 1509 | Month int64 `json:"month,omitempty"` |
| 1510 | // Nanos: Optional. Fractions of seconds in nanoseconds. Must be from 0 to |
| 1511 | // 999,999,999, defaults to 0. |
| 1512 | Nanos int64 `json:"nanos,omitempty"` |
| 1513 | // Seconds: Optional. Seconds of minutes of the time. Must normally be from 0 |
| 1514 | // to 59, defaults to 0. An API may allow the value 60 if it allows |
| 1515 | // leap-seconds. |
| 1516 | Seconds int64 `json:"seconds,omitempty"` |
| 1517 | // TimeZone: Time zone. |
| 1518 | TimeZone *TimeZone `json:"timeZone,omitempty"` |
| 1519 | // UtcOffset: UTC offset. Must be whole seconds, between -18 hours and +18 |
| 1520 | // hours. For example, a UTC offset of -4:00 would be represented as { seconds: |
| 1521 | // -14400 }. |
| 1522 | UtcOffset string `json:"utcOffset,omitempty"` |
| 1523 | // Year: Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a |
| 1524 | // datetime without a year. |
| 1525 | Year int64 `json:"year,omitempty"` |
| 1526 | // ForceSendFields is a list of field names (e.g. "Day") to unconditionally |
| 1527 | // include in API requests. By default, fields with empty or default values are |
| 1528 | // omitted from API requests. See |
| 1529 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1530 | // details. |
| 1531 | ForceSendFields []string `json:"-"` |
| 1532 | // NullFields is a list of field names (e.g. "Day") to include in API requests |
| 1533 | // with the JSON null value. By default, fields with empty values are omitted |
| 1534 | // from API requests. See |
| 1535 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1536 | NullFields []string `json:"-"` |
| 1537 | } |
| 1538 | |
| 1539 | func (s DateTime) MarshalJSON() ([]byte, error) { |
| 1540 | type NoMethod DateTime |
| 1541 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1542 | } |
| 1543 | |
| 1544 | // Device: Captures metadata about the device that recorded the measurement. |
| 1545 | type Device struct { |
| 1546 | // DisplayName: Optional. An optional name for the device. |
| 1547 | DisplayName string `json:"displayName,omitempty"` |
| 1548 | // FormFactor: Optional. Captures the form factor of the device. |
| 1549 | // |
| 1550 | // Possible values: |
| 1551 | // "FORM_FACTOR_UNSPECIFIED" - The form factor is unspecified. |
| 1552 | // "FITNESS_BAND" - The device is a fitness band. |
| 1553 | // "WATCH" - The device is a watch. |
| 1554 | // "PHONE" - The device is a phone. |
| 1555 | // "RING" - The device is a ring. |
| 1556 | // "CHEST_STRAP" - The device is a chest strap. |
| 1557 | // "SCALE" - The device is a scale. |
| 1558 | // "TABLET" - The device is a tablet. |
| 1559 | // "HEAD_MOUNTED" - The device is a head mounted device. |
| 1560 | // "SMART_DISPLAY" - The device is a smart display. |
| 1561 | FormFactor string `json:"formFactor,omitempty"` |
| 1562 | // Manufacturer: Optional. An optional manufacturer of the device. |
| 1563 | Manufacturer string `json:"manufacturer,omitempty"` |
| 1564 | // ForceSendFields is a list of field names (e.g. "DisplayName") to |
| 1565 | // unconditionally include in API requests. By default, fields with empty or |
| 1566 | // default values are omitted from API requests. See |
| 1567 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1568 | // details. |
| 1569 | ForceSendFields []string `json:"-"` |
| 1570 | // NullFields is a list of field names (e.g. "DisplayName") to include in API |
| 1571 | // requests with the JSON null value. By default, fields with empty values are |
| 1572 | // omitted from API requests. See |
| 1573 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1574 | NullFields []string `json:"-"` |
| 1575 | } |
| 1576 | |
| 1577 | func (s Device) MarshalJSON() ([]byte, error) { |
| 1578 | type NoMethod Device |
| 1579 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1580 | } |
| 1581 | |
| 1582 | // Distance: Distance traveled over an interval of time. |
| 1583 | type Distance struct { |
| 1584 | // Interval: Required. Observed interval. |
| 1585 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 1586 | // Millimeters: Required. Distance in millimeters over the observed interval. |
| 1587 | Millimeters int64 `json:"millimeters,omitempty,string"` |
| 1588 | // ForceSendFields is a list of field names (e.g. "Interval") to |
| 1589 | // unconditionally include in API requests. By default, fields with empty or |
| 1590 | // default values are omitted from API requests. See |
| 1591 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1592 | // details. |
| 1593 | ForceSendFields []string `json:"-"` |
| 1594 | // NullFields is a list of field names (e.g. "Interval") to include in API |
| 1595 | // requests with the JSON null value. By default, fields with empty values are |
| 1596 | // omitted from API requests. See |
| 1597 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1598 | NullFields []string `json:"-"` |
| 1599 | } |
| 1600 | |
| 1601 | func (s Distance) MarshalJSON() ([]byte, error) { |
| 1602 | type NoMethod Distance |
| 1603 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1604 | } |
| 1605 | |
| 1606 | // DistanceRollupValue: Result of the rollup of the user's distance. |
| 1607 | type DistanceRollupValue struct { |
| 1608 | // MillimetersSum: Sum of the distance in millimeters. |
| 1609 | MillimetersSum int64 `json:"millimetersSum,omitempty,string"` |
| 1610 | // ForceSendFields is a list of field names (e.g. "MillimetersSum") to |
| 1611 | // unconditionally include in API requests. By default, fields with empty or |
| 1612 | // default values are omitted from API requests. See |
| 1613 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1614 | // details. |
| 1615 | ForceSendFields []string `json:"-"` |
| 1616 | // NullFields is a list of field names (e.g. "MillimetersSum") to include in |
| 1617 | // API requests with the JSON null value. By default, fields with empty values |
| 1618 | // are omitted from API requests. See |
| 1619 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1620 | NullFields []string `json:"-"` |
| 1621 | } |
| 1622 | |
| 1623 | func (s DistanceRollupValue) MarshalJSON() ([]byte, error) { |
| 1624 | type NoMethod DistanceRollupValue |
| 1625 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1626 | } |
| 1627 | |
| 1628 | // Exercise: An exercise that stores information about a physical activity. |
| 1629 | type Exercise struct { |
| 1630 | // ActiveDuration: Optional. Duration excluding pauses. |
| 1631 | ActiveDuration string `json:"activeDuration,omitempty"` |
| 1632 | // CreateTime: Output only. Represents the timestamp of the creation of the |
| 1633 | // exercise. |
| 1634 | CreateTime string `json:"createTime,omitempty"` |
| 1635 | // DisplayName: Required. Exercise display name. |
| 1636 | DisplayName string `json:"displayName,omitempty"` |
| 1637 | // ExerciseEvents: Optional. Exercise events that happen during an exercise, |
| 1638 | // such as pause & restarts. |
| 1639 | ExerciseEvents []*ExerciseEvent `json:"exerciseEvents,omitempty"` |
| 1640 | // ExerciseMetadata: Optional. Additional exercise metadata. |
| 1641 | ExerciseMetadata *ExerciseMetadata `json:"exerciseMetadata,omitempty"` |
| 1642 | // ExerciseType: Required. The type of activity performed during an exercise. |
| 1643 | // |
| 1644 | // Possible values: |
| 1645 | // "EXERCISE_TYPE_UNSPECIFIED" - Exercise type is unspecified. |
| 1646 | // "RUNNING" - Running type. |
| 1647 | // "WALKING" - Walking type. |
| 1648 | // "BIKING" - Biking type. |
| 1649 | // "SWIMMING" - Swimming type. |
| 1650 | // "HIKING" - Hiking type. |
| 1651 | // "YOGA" - Yoga type. |
| 1652 | // "PILATES" - Pilates type. |
| 1653 | // "WORKOUT" - Workout type. |
| 1654 | // "HIIT" - HIIT type. |
| 1655 | // "WEIGHTLIFTING" - Weightlifting type. |
| 1656 | // "STRENGTH_TRAINING" - Strength training type. |
| 1657 | // "OTHER" - Other type. |
| 1658 | ExerciseType string `json:"exerciseType,omitempty"` |
| 1659 | // Interval: Required. Observed exercise interval |
| 1660 | Interval *SessionTimeInterval `json:"interval,omitempty"` |
| 1661 | // MetricsSummary: Required. Summary metrics for this exercise ( ) |
| 1662 | MetricsSummary *MetricsSummary `json:"metricsSummary,omitempty"` |
| 1663 | // Notes: Optional. Standard free-form notes captured at manual logging. |
| 1664 | Notes string `json:"notes,omitempty"` |
| 1665 | // SplitSummaries: Optional. Laps or splits recorded within an exercise. Laps |
| 1666 | // could be split based on distance or other criteria (duration, etc.) Laps |
| 1667 | // should not be overlapping with each other. |
| 1668 | SplitSummaries []*SplitSummary `json:"splitSummaries,omitempty"` |
| 1669 | // Splits: Optional. The default split is 1 km or 1 mile. - if the movement |
| 1670 | // distance is less than the default, then there are no splits - if the |
| 1671 | // movement distance is greater than or equal to the default, then we have |
| 1672 | // splits |
| 1673 | Splits []*SplitSummary `json:"splits,omitempty"` |
| 1674 | // UpdateTime: Output only. This is the timestamp of the last update to the |
| 1675 | // exercise. |
| 1676 | UpdateTime string `json:"updateTime,omitempty"` |
| 1677 | // ForceSendFields is a list of field names (e.g. "ActiveDuration") to |
| 1678 | // unconditionally include in API requests. By default, fields with empty or |
| 1679 | // default values are omitted from API requests. See |
| 1680 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1681 | // details. |
| 1682 | ForceSendFields []string `json:"-"` |
| 1683 | // NullFields is a list of field names (e.g. "ActiveDuration") to include in |
| 1684 | // API requests with the JSON null value. By default, fields with empty values |
| 1685 | // are omitted from API requests. See |
| 1686 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1687 | NullFields []string `json:"-"` |
| 1688 | } |
| 1689 | |
| 1690 | func (s Exercise) MarshalJSON() ([]byte, error) { |
| 1691 | type NoMethod Exercise |
| 1692 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1693 | } |
| 1694 | |
| 1695 | // ExerciseEvent: Represents instantaneous events that happen during an |
| 1696 | // exercise, such as start, stop, pause, split. |
| 1697 | type ExerciseEvent struct { |
| 1698 | // EventTime: Required. Exercise event time |
| 1699 | EventTime string `json:"eventTime,omitempty"` |
| 1700 | // EventUtcOffset: Required. Exercise event time offset from UTC |
| 1701 | EventUtcOffset string `json:"eventUtcOffset,omitempty"` |
| 1702 | // ExerciseEventType: Required. The type of the event, such as start, stop, |
| 1703 | // pause, resume. |
| 1704 | // |
| 1705 | // Possible values: |
| 1706 | // "EXERCISE_EVENT_TYPE_UNSPECIFIED" - Exercise event type is unspecified. |
| 1707 | // "START" - Exercise start event. |
| 1708 | // "STOP" - Exercise stop event. |
| 1709 | // "PAUSE" - Exercise pause event. |
| 1710 | // "RESUME" - Exercise resume event. |
| 1711 | // "AUTO_PAUSE" - Exercise auto-pause event. |
| 1712 | // "AUTO_RESUME" - Exercise auto-resume event. |
| 1713 | ExerciseEventType string `json:"exerciseEventType,omitempty"` |
| 1714 | // ForceSendFields is a list of field names (e.g. "EventTime") to |
| 1715 | // unconditionally include in API requests. By default, fields with empty or |
| 1716 | // default values are omitted from API requests. See |
| 1717 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1718 | // details. |
| 1719 | ForceSendFields []string `json:"-"` |
| 1720 | // NullFields is a list of field names (e.g. "EventTime") to include in API |
| 1721 | // requests with the JSON null value. By default, fields with empty values are |
| 1722 | // omitted from API requests. See |
| 1723 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1724 | NullFields []string `json:"-"` |
| 1725 | } |
| 1726 | |
| 1727 | func (s ExerciseEvent) MarshalJSON() ([]byte, error) { |
| 1728 | type NoMethod ExerciseEvent |
| 1729 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1730 | } |
| 1731 | |
| 1732 | // ExerciseMetadata: Additional exercise metadata. |
| 1733 | type ExerciseMetadata struct { |
| 1734 | // HasGps: Optional. Whether the exercise had GPS tracking. |
| 1735 | HasGps bool `json:"hasGps,omitempty"` |
| 1736 | // PoolLengthMillimeters: Optional. Pool length in millimeters. Only present in |
| 1737 | // the swimming exercises. |
| 1738 | PoolLengthMillimeters int64 `json:"poolLengthMillimeters,omitempty,string"` |
| 1739 | // ForceSendFields is a list of field names (e.g. "HasGps") to unconditionally |
| 1740 | // include in API requests. By default, fields with empty or default values are |
| 1741 | // omitted from API requests. See |
| 1742 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1743 | // details. |
| 1744 | ForceSendFields []string `json:"-"` |
| 1745 | // NullFields is a list of field names (e.g. "HasGps") to include in API |
| 1746 | // requests with the JSON null value. By default, fields with empty values are |
| 1747 | // omitted from API requests. See |
| 1748 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1749 | NullFields []string `json:"-"` |
| 1750 | } |
| 1751 | |
| 1752 | func (s ExerciseMetadata) MarshalJSON() ([]byte, error) { |
| 1753 | type NoMethod ExerciseMetadata |
| 1754 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1755 | } |
| 1756 | |
| 1757 | // ExportExerciseTcxResponse: Represents a Response for exporting exercise data |
| 1758 | // in TCX format. |
| 1759 | type ExportExerciseTcxResponse struct { |
| 1760 | // TcxData: Contains the exported TCX data. |
| 1761 | TcxData string `json:"tcxData,omitempty"` |
| 1762 | |
| 1763 | // ServerResponse contains the HTTP response code and headers from the server. |
| 1764 | googleapi.ServerResponse `json:"-"` |
| 1765 | // ForceSendFields is a list of field names (e.g. "TcxData") to unconditionally |
| 1766 | // include in API requests. By default, fields with empty or default values are |
| 1767 | // omitted from API requests. See |
| 1768 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1769 | // details. |
| 1770 | ForceSendFields []string `json:"-"` |
| 1771 | // NullFields is a list of field names (e.g. "TcxData") to include in API |
| 1772 | // requests with the JSON null value. By default, fields with empty values are |
| 1773 | // omitted from API requests. See |
| 1774 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1775 | NullFields []string `json:"-"` |
| 1776 | } |
| 1777 | |
| 1778 | func (s ExportExerciseTcxResponse) MarshalJSON() ([]byte, error) { |
| 1779 | type NoMethod ExportExerciseTcxResponse |
| 1780 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1781 | } |
| 1782 | |
| 1783 | // Floors: Gained elevation measured in floors over the time interval |
| 1784 | type Floors struct { |
| 1785 | // Count: Required. Number of floors in the recorded interval |
| 1786 | Count int64 `json:"count,omitempty,string"` |
| 1787 | // Interval: Required. Observed interval |
| 1788 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 1789 | // ForceSendFields is a list of field names (e.g. "Count") to unconditionally |
| 1790 | // include in API requests. By default, fields with empty or default values are |
| 1791 | // omitted from API requests. See |
| 1792 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1793 | // details. |
| 1794 | ForceSendFields []string `json:"-"` |
| 1795 | // NullFields is a list of field names (e.g. "Count") to include in API |
| 1796 | // requests with the JSON null value. By default, fields with empty values are |
| 1797 | // omitted from API requests. See |
| 1798 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1799 | NullFields []string `json:"-"` |
| 1800 | } |
| 1801 | |
| 1802 | func (s Floors) MarshalJSON() ([]byte, error) { |
| 1803 | type NoMethod Floors |
| 1804 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1805 | } |
| 1806 | |
| 1807 | // FloorsRollupValue: Represents the result of the rollup of the user's floors. |
| 1808 | type FloorsRollupValue struct { |
| 1809 | // CountSum: Sum of the floors count. |
| 1810 | CountSum int64 `json:"countSum,omitempty,string"` |
| 1811 | // ForceSendFields is a list of field names (e.g. "CountSum") to |
| 1812 | // unconditionally include in API requests. By default, fields with empty or |
| 1813 | // default values are omitted from API requests. See |
| 1814 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1815 | // details. |
| 1816 | ForceSendFields []string `json:"-"` |
| 1817 | // NullFields is a list of field names (e.g. "CountSum") to include in API |
| 1818 | // requests with the JSON null value. By default, fields with empty values are |
| 1819 | // omitted from API requests. See |
| 1820 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1821 | NullFields []string `json:"-"` |
| 1822 | } |
| 1823 | |
| 1824 | func (s FloorsRollupValue) MarshalJSON() ([]byte, error) { |
| 1825 | type NoMethod FloorsRollupValue |
| 1826 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1827 | } |
| 1828 | |
| 1829 | // GoogleDevicesandservicesHealthV4DataType: Represents a type of health data a |
| 1830 | // user can have data points recorded for. It matches the parent resource of |
| 1831 | // collection containing data points of the given type. Clients currently do |
| 1832 | // not need to interact with this resource directly. |
| 1833 | type GoogleDevicesandservicesHealthV4DataType struct { |
| 1834 | // Name: Identifier. The resource name of the data type. Format: |
| 1835 | // `users/{user}/dataTypes/{data_type}` See DataPoint.name for examples and |
| 1836 | // possible values. |
| 1837 | Name string `json:"name,omitempty"` |
| 1838 | // ForceSendFields is a list of field names (e.g. "Name") to unconditionally |
| 1839 | // include in API requests. By default, fields with empty or default values are |
| 1840 | // omitted from API requests. See |
| 1841 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1842 | // details. |
| 1843 | ForceSendFields []string `json:"-"` |
| 1844 | // NullFields is a list of field names (e.g. "Name") to include in API requests |
| 1845 | // with the JSON null value. By default, fields with empty values are omitted |
| 1846 | // from API requests. See |
| 1847 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1848 | NullFields []string `json:"-"` |
| 1849 | } |
| 1850 | |
| 1851 | func (s GoogleDevicesandservicesHealthV4DataType) MarshalJSON() ([]byte, error) { |
| 1852 | type NoMethod GoogleDevicesandservicesHealthV4DataType |
| 1853 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1854 | } |
| 1855 | |
| 1856 | // HeartRate: A heart rate measurement. |
| 1857 | type HeartRate struct { |
| 1858 | // BeatsPerMinute: Required. The heart rate value in beats per minute. |
| 1859 | BeatsPerMinute int64 `json:"beatsPerMinute,omitempty,string"` |
| 1860 | // Metadata: Optional. Metadata about the heart rate sample. |
| 1861 | Metadata *HeartRateMetadata `json:"metadata,omitempty"` |
| 1862 | // SampleTime: Required. Observation time |
| 1863 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 1864 | // ForceSendFields is a list of field names (e.g. "BeatsPerMinute") to |
| 1865 | // unconditionally include in API requests. By default, fields with empty or |
| 1866 | // default values are omitted from API requests. See |
| 1867 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1868 | // details. |
| 1869 | ForceSendFields []string `json:"-"` |
| 1870 | // NullFields is a list of field names (e.g. "BeatsPerMinute") to include in |
| 1871 | // API requests with the JSON null value. By default, fields with empty values |
| 1872 | // are omitted from API requests. See |
| 1873 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1874 | NullFields []string `json:"-"` |
| 1875 | } |
| 1876 | |
| 1877 | func (s HeartRate) MarshalJSON() ([]byte, error) { |
| 1878 | type NoMethod HeartRate |
| 1879 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1880 | } |
| 1881 | |
| 1882 | // HeartRateMetadata: Heart rate metadata. |
| 1883 | type HeartRateMetadata struct { |
| 1884 | // MotionContext: Optional. Indicates the user’s level of activity when the |
| 1885 | // heart rate sample was measured |
| 1886 | // |
| 1887 | // Possible values: |
| 1888 | // "MOTION_CONTEXT_UNSPECIFIED" - The default value when no data is |
| 1889 | // available. |
| 1890 | // "ACTIVE" - The user is active. |
| 1891 | // "SEDENTARY" - The user is inactive. |
| 1892 | MotionContext string `json:"motionContext,omitempty"` |
| 1893 | // SensorLocation: Optional. Indicates the location of the sensor that measured |
| 1894 | // the heart rate. |
| 1895 | // |
| 1896 | // Possible values: |
| 1897 | // "SENSOR_LOCATION_UNSPECIFIED" - The default value when no data is |
| 1898 | // available. |
| 1899 | // "CHEST" - Chest sensor. |
| 1900 | // "WRIST" - Wrist sensor. |
| 1901 | // "FINGER" - Finger sensor. |
| 1902 | // "HAND" - Hand sensor. |
| 1903 | // "EAR_LOBE" - Ear lobe sensor. |
| 1904 | // "FOOT" - Foot sensor. |
| 1905 | SensorLocation string `json:"sensorLocation,omitempty"` |
| 1906 | // ForceSendFields is a list of field names (e.g. "MotionContext") to |
| 1907 | // unconditionally include in API requests. By default, fields with empty or |
| 1908 | // default values are omitted from API requests. See |
| 1909 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1910 | // details. |
| 1911 | ForceSendFields []string `json:"-"` |
| 1912 | // NullFields is a list of field names (e.g. "MotionContext") to include in API |
| 1913 | // requests with the JSON null value. By default, fields with empty values are |
| 1914 | // omitted from API requests. See |
| 1915 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1916 | NullFields []string `json:"-"` |
| 1917 | } |
| 1918 | |
| 1919 | func (s HeartRateMetadata) MarshalJSON() ([]byte, error) { |
| 1920 | type NoMethod HeartRateMetadata |
| 1921 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1922 | } |
| 1923 | |
| 1924 | // HeartRateRollupValue: Represents the result of the rollup of the heart rate |
| 1925 | // data type. |
| 1926 | type HeartRateRollupValue struct { |
| 1927 | // BeatsPerMinuteAvg: The average heart rate value in the interval. |
| 1928 | BeatsPerMinuteAvg float64 `json:"beatsPerMinuteAvg,omitempty"` |
| 1929 | // BeatsPerMinuteMax: The maximum heart rate value in the interval. |
| 1930 | BeatsPerMinuteMax float64 `json:"beatsPerMinuteMax,omitempty"` |
| 1931 | // BeatsPerMinuteMin: The minimum heart rate value in the interval. |
| 1932 | BeatsPerMinuteMin float64 `json:"beatsPerMinuteMin,omitempty"` |
| 1933 | // ForceSendFields is a list of field names (e.g. "BeatsPerMinuteAvg") to |
| 1934 | // unconditionally include in API requests. By default, fields with empty or |
| 1935 | // default values are omitted from API requests. See |
| 1936 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1937 | // details. |
| 1938 | ForceSendFields []string `json:"-"` |
| 1939 | // NullFields is a list of field names (e.g. "BeatsPerMinuteAvg") to include in |
| 1940 | // API requests with the JSON null value. By default, fields with empty values |
| 1941 | // are omitted from API requests. See |
| 1942 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1943 | NullFields []string `json:"-"` |
| 1944 | } |
| 1945 | |
| 1946 | func (s HeartRateRollupValue) MarshalJSON() ([]byte, error) { |
| 1947 | type NoMethod HeartRateRollupValue |
| 1948 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1949 | } |
| 1950 | |
| 1951 | func (s *HeartRateRollupValue) UnmarshalJSON(data []byte) error { |
| 1952 | type NoMethod HeartRateRollupValue |
| 1953 | var s1 struct { |
| 1954 | BeatsPerMinuteAvg gensupport.JSONFloat64 `json:"beatsPerMinuteAvg"` |
| 1955 | BeatsPerMinuteMax gensupport.JSONFloat64 `json:"beatsPerMinuteMax"` |
| 1956 | BeatsPerMinuteMin gensupport.JSONFloat64 `json:"beatsPerMinuteMin"` |
| 1957 | *NoMethod |
| 1958 | } |
| 1959 | s1.NoMethod = (*NoMethod)(s) |
| 1960 | if err := json.Unmarshal(data, &s1); err != nil { |
| 1961 | return err |
| 1962 | } |
| 1963 | s.BeatsPerMinuteAvg = float64(s1.BeatsPerMinuteAvg) |
| 1964 | s.BeatsPerMinuteMax = float64(s1.BeatsPerMinuteMax) |
| 1965 | s.BeatsPerMinuteMin = float64(s1.BeatsPerMinuteMin) |
| 1966 | return nil |
| 1967 | } |
| 1968 | |
| 1969 | // HeartRateVariability: Captures user's heart rate variability (HRV) as |
| 1970 | // measured by the root mean square of successive differences (RMSSD) between |
| 1971 | // normal heartbeats or by standard deviation of the inter-beat intervals |
| 1972 | // (SDNN). |
| 1973 | type HeartRateVariability struct { |
| 1974 | // RootMeanSquareOfSuccessiveDifferencesMilliseconds: Optional. The root mean |
| 1975 | // square of successive differences between normal heartbeats. This is a |
| 1976 | // measure of heart rate variability used by Fitbit. |
| 1977 | RootMeanSquareOfSuccessiveDifferencesMilliseconds float64 `json:"rootMeanSquareOfSuccessiveDifferencesMilliseconds,omitempty"` |
| 1978 | // SampleTime: Required. The time of the heart rate variability measurement. |
| 1979 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 1980 | // StandardDeviationMilliseconds: Optional. The standard deviation of the heart |
| 1981 | // rate variability measurement. |
| 1982 | StandardDeviationMilliseconds float64 `json:"standardDeviationMilliseconds,omitempty"` |
| 1983 | // ForceSendFields is a list of field names (e.g. |
| 1984 | // "RootMeanSquareOfSuccessiveDifferencesMilliseconds") to unconditionally |
| 1985 | // include in API requests. By default, fields with empty or default values are |
| 1986 | // omitted from API requests. See |
| 1987 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1988 | // details. |
| 1989 | ForceSendFields []string `json:"-"` |
| 1990 | // NullFields is a list of field names (e.g. |
| 1991 | // "RootMeanSquareOfSuccessiveDifferencesMilliseconds") to include in API |
| 1992 | // requests with the JSON null value. By default, fields with empty values are |
| 1993 | // omitted from API requests. See |
| 1994 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1995 | NullFields []string `json:"-"` |
| 1996 | } |
| 1997 | |
| 1998 | func (s HeartRateVariability) MarshalJSON() ([]byte, error) { |
| 1999 | type NoMethod HeartRateVariability |
| 2000 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2001 | } |
| 2002 | |
| 2003 | func (s *HeartRateVariability) UnmarshalJSON(data []byte) error { |
| 2004 | type NoMethod HeartRateVariability |
| 2005 | var s1 struct { |
| 2006 | RootMeanSquareOfSuccessiveDifferencesMilliseconds gensupport.JSONFloat64 `json:"rootMeanSquareOfSuccessiveDifferencesMilliseconds"` |
| 2007 | StandardDeviationMilliseconds gensupport.JSONFloat64 `json:"standardDeviationMilliseconds"` |
| 2008 | *NoMethod |
| 2009 | } |
| 2010 | s1.NoMethod = (*NoMethod)(s) |
| 2011 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2012 | return err |
| 2013 | } |
| 2014 | s.RootMeanSquareOfSuccessiveDifferencesMilliseconds = float64(s1.RootMeanSquareOfSuccessiveDifferencesMilliseconds) |
| 2015 | s.StandardDeviationMilliseconds = float64(s1.StandardDeviationMilliseconds) |
| 2016 | return nil |
| 2017 | } |
| 2018 | |
| 2019 | // HeartRateVariabilityPersonalRangeRollupValue: Represents the result of the |
| 2020 | // rollup of the user's daily heart rate variability personal range. |
| 2021 | type HeartRateVariabilityPersonalRangeRollupValue struct { |
| 2022 | // AverageHeartRateVariabilityMillisecondsMax: The upper bound of the user's |
| 2023 | // average heart rate variability personal range. |
| 2024 | AverageHeartRateVariabilityMillisecondsMax float64 `json:"averageHeartRateVariabilityMillisecondsMax,omitempty"` |
| 2025 | // AverageHeartRateVariabilityMillisecondsMin: The lower bound of the user's |
| 2026 | // average heart rate variability personal range. |
| 2027 | AverageHeartRateVariabilityMillisecondsMin float64 `json:"averageHeartRateVariabilityMillisecondsMin,omitempty"` |
| 2028 | // ForceSendFields is a list of field names (e.g. |
| 2029 | // "AverageHeartRateVariabilityMillisecondsMax") to unconditionally include in |
| 2030 | // API requests. By default, fields with empty or default values are omitted |
| 2031 | // from API requests. See |
| 2032 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2033 | // details. |
| 2034 | ForceSendFields []string `json:"-"` |
| 2035 | // NullFields is a list of field names (e.g. |
| 2036 | // "AverageHeartRateVariabilityMillisecondsMax") to include in API requests |
| 2037 | // with the JSON null value. By default, fields with empty values are omitted |
| 2038 | // from API requests. See |
| 2039 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2040 | NullFields []string `json:"-"` |
| 2041 | } |
| 2042 | |
| 2043 | func (s HeartRateVariabilityPersonalRangeRollupValue) MarshalJSON() ([]byte, error) { |
| 2044 | type NoMethod HeartRateVariabilityPersonalRangeRollupValue |
| 2045 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2046 | } |
| 2047 | |
| 2048 | func (s *HeartRateVariabilityPersonalRangeRollupValue) UnmarshalJSON(data []byte) error { |
| 2049 | type NoMethod HeartRateVariabilityPersonalRangeRollupValue |
| 2050 | var s1 struct { |
| 2051 | AverageHeartRateVariabilityMillisecondsMax gensupport.JSONFloat64 `json:"averageHeartRateVariabilityMillisecondsMax"` |
| 2052 | AverageHeartRateVariabilityMillisecondsMin gensupport.JSONFloat64 `json:"averageHeartRateVariabilityMillisecondsMin"` |
| 2053 | *NoMethod |
| 2054 | } |
| 2055 | s1.NoMethod = (*NoMethod)(s) |
| 2056 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2057 | return err |
| 2058 | } |
| 2059 | s.AverageHeartRateVariabilityMillisecondsMax = float64(s1.AverageHeartRateVariabilityMillisecondsMax) |
| 2060 | s.AverageHeartRateVariabilityMillisecondsMin = float64(s1.AverageHeartRateVariabilityMillisecondsMin) |
| 2061 | return nil |
| 2062 | } |
| 2063 | |
| 2064 | // HeartRateZone: The heart rate zone. |
| 2065 | type HeartRateZone struct { |
| 2066 | // HeartRateZoneType: Required. The heart rate zone type. |
| 2067 | // |
| 2068 | // Possible values: |
| 2069 | // "HEART_RATE_ZONE_TYPE_UNSPECIFIED" - Unspecified heart rate zone. |
| 2070 | // "LIGHT" - The light heart rate zone. |
| 2071 | // "MODERATE" - The moderate heart rate zone. |
| 2072 | // "VIGOROUS" - The vigorous heart rate zone. |
| 2073 | // "PEAK" - The peak heart rate zone. |
| 2074 | HeartRateZoneType string `json:"heartRateZoneType,omitempty"` |
| 2075 | // MaxBeatsPerMinute: Required. Maximum heart rate for this zone in beats per |
| 2076 | // minute. |
| 2077 | MaxBeatsPerMinute int64 `json:"maxBeatsPerMinute,omitempty,string"` |
| 2078 | // MinBeatsPerMinute: Required. Minimum heart rate for this zone in beats per |
| 2079 | // minute. |
| 2080 | MinBeatsPerMinute int64 `json:"minBeatsPerMinute,omitempty,string"` |
| 2081 | // ForceSendFields is a list of field names (e.g. "HeartRateZoneType") to |
| 2082 | // unconditionally include in API requests. By default, fields with empty or |
| 2083 | // default values are omitted from API requests. See |
| 2084 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2085 | // details. |
| 2086 | ForceSendFields []string `json:"-"` |
| 2087 | // NullFields is a list of field names (e.g. "HeartRateZoneType") to include in |
| 2088 | // API requests with the JSON null value. By default, fields with empty values |
| 2089 | // are omitted from API requests. See |
| 2090 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2091 | NullFields []string `json:"-"` |
| 2092 | } |
| 2093 | |
| 2094 | func (s HeartRateZone) MarshalJSON() ([]byte, error) { |
| 2095 | type NoMethod HeartRateZone |
| 2096 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2097 | } |
| 2098 | |
| 2099 | // HydrationLog: Holds information about a user logged hydration. |
| 2100 | type HydrationLog struct { |
| 2101 | // AmountConsumed: Required. Amount of liquid (ex. water) consumed. |
| 2102 | AmountConsumed *VolumeQuantity `json:"amountConsumed,omitempty"` |
| 2103 | // Interval: Required. Observed interval. |
| 2104 | Interval *SessionTimeInterval `json:"interval,omitempty"` |
| 2105 | // ForceSendFields is a list of field names (e.g. "AmountConsumed") to |
| 2106 | // unconditionally include in API requests. By default, fields with empty or |
| 2107 | // default values are omitted from API requests. See |
| 2108 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2109 | // details. |
| 2110 | ForceSendFields []string `json:"-"` |
| 2111 | // NullFields is a list of field names (e.g. "AmountConsumed") to include in |
| 2112 | // API requests with the JSON null value. By default, fields with empty values |
| 2113 | // are omitted from API requests. See |
| 2114 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2115 | NullFields []string `json:"-"` |
| 2116 | } |
| 2117 | |
| 2118 | func (s HydrationLog) MarshalJSON() ([]byte, error) { |
| 2119 | type NoMethod HydrationLog |
| 2120 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2121 | } |
| 2122 | |
| 2123 | // HydrationLogRollupValue: Represents the result of the rollup of the |
| 2124 | // hydration log data type. |
| 2125 | type HydrationLogRollupValue struct { |
| 2126 | // AmountConsumed: Rollup for amount consumed. |
| 2127 | AmountConsumed *VolumeQuantityRollup `json:"amountConsumed,omitempty"` |
| 2128 | // ForceSendFields is a list of field names (e.g. "AmountConsumed") to |
| 2129 | // unconditionally include in API requests. By default, fields with empty or |
| 2130 | // default values are omitted from API requests. See |
| 2131 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2132 | // details. |
| 2133 | ForceSendFields []string `json:"-"` |
| 2134 | // NullFields is a list of field names (e.g. "AmountConsumed") to include in |
| 2135 | // API requests with the JSON null value. By default, fields with empty values |
| 2136 | // are omitted from API requests. See |
| 2137 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2138 | NullFields []string `json:"-"` |
| 2139 | } |
| 2140 | |
| 2141 | func (s HydrationLogRollupValue) MarshalJSON() ([]byte, error) { |
| 2142 | type NoMethod HydrationLogRollupValue |
| 2143 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2144 | } |
| 2145 | |
| 2146 | // Identity: Represents details about the Google user's identity. |
| 2147 | type Identity struct { |
| 2148 | // HealthUserId: Output only. The Google User Identifier in the Google Health |
| 2149 | // APIs. It matches the `{user}` resource ID segment in the resource name |
| 2150 | // paths, e.g. `users/{user}/dataTypes/steps`. Valid values are strings of 1-63 |
| 2151 | // characters, and valid characters are lowercase and uppercase letters, |
| 2152 | // numbers, and hyphens. |
| 2153 | HealthUserId string `json:"healthUserId,omitempty"` |
| 2154 | // LegacyUserId: Output only. The legacy Fitbit User identifier. This is the |
| 2155 | // Fitbit ID used in the legacy Fitbit APIs (v1-v3). It can be referenced by |
| 2156 | // clients migrating from the legacy Fitbit APIs to map their existing |
| 2157 | // identifiers to the new Google user ID. It **must not** be used for any other |
| 2158 | // purpose. It is not of any use for new clients using only the Google Health |
| 2159 | // APIs. Valid values are strings of 1-63 characters, and valid characters are |
| 2160 | // lowercase and uppercase letters, numbers, and hyphens. |
| 2161 | LegacyUserId string `json:"legacyUserId,omitempty"` |
| 2162 | // Name: Identifier. The resource name of this Identity resource. Format: |
| 2163 | // `users/me/identity` |
| 2164 | Name string `json:"name,omitempty"` |
| 2165 | |
| 2166 | // ServerResponse contains the HTTP response code and headers from the server. |
| 2167 | googleapi.ServerResponse `json:"-"` |
| 2168 | // ForceSendFields is a list of field names (e.g. "HealthUserId") to |
| 2169 | // unconditionally include in API requests. By default, fields with empty or |
| 2170 | // default values are omitted from API requests. See |
| 2171 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2172 | // details. |
| 2173 | ForceSendFields []string `json:"-"` |
| 2174 | // NullFields is a list of field names (e.g. "HealthUserId") to include in API |
| 2175 | // requests with the JSON null value. By default, fields with empty values are |
| 2176 | // omitted from API requests. See |
| 2177 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2178 | NullFields []string `json:"-"` |
| 2179 | } |
| 2180 | |
| 2181 | func (s Identity) MarshalJSON() ([]byte, error) { |
| 2182 | type NoMethod Identity |
| 2183 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2184 | } |
| 2185 | |
| 2186 | // Interval: Represents a time interval, encoded as a Timestamp start |
| 2187 | // (inclusive) and a Timestamp end (exclusive). The start must be less than or |
| 2188 | // equal to the end. When the start equals the end, the interval is empty |
| 2189 | // (matches no time). When both start and end are unspecified, the interval |
| 2190 | // matches any time. |
| 2191 | type Interval struct { |
| 2192 | // EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp |
| 2193 | // matching this interval will have to be before the end. |
| 2194 | EndTime string `json:"endTime,omitempty"` |
| 2195 | // StartTime: Optional. Inclusive start of the interval. If specified, a |
| 2196 | // Timestamp matching this interval will have to be the same or after the |
| 2197 | // start. |
| 2198 | StartTime string `json:"startTime,omitempty"` |
| 2199 | // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally |
| 2200 | // include in API requests. By default, fields with empty or default values are |
| 2201 | // omitted from API requests. See |
| 2202 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2203 | // details. |
| 2204 | ForceSendFields []string `json:"-"` |
| 2205 | // NullFields is a list of field names (e.g. "EndTime") to include in API |
| 2206 | // requests with the JSON null value. By default, fields with empty values are |
| 2207 | // omitted from API requests. See |
| 2208 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2209 | NullFields []string `json:"-"` |
| 2210 | } |
| 2211 | |
| 2212 | func (s Interval) MarshalJSON() ([]byte, error) { |
| 2213 | type NoMethod Interval |
| 2214 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2215 | } |
| 2216 | |
| 2217 | // ListDataPointsResponse: Response containing raw data points matching the |
| 2218 | // query |
| 2219 | type ListDataPointsResponse struct { |
| 2220 | // DataPoints: Data points matching the query |
| 2221 | DataPoints []*DataPoint `json:"dataPoints,omitempty"` |
| 2222 | // NextPageToken: Next page token, empty if the response is complete |
| 2223 | NextPageToken string `json:"nextPageToken,omitempty"` |
| 2224 | |
| 2225 | // ServerResponse contains the HTTP response code and headers from the server. |
| 2226 | googleapi.ServerResponse `json:"-"` |
| 2227 | // ForceSendFields is a list of field names (e.g. "DataPoints") to |
| 2228 | // unconditionally include in API requests. By default, fields with empty or |
| 2229 | // default values are omitted from API requests. See |
| 2230 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2231 | // details. |
| 2232 | ForceSendFields []string `json:"-"` |
| 2233 | // NullFields is a list of field names (e.g. "DataPoints") to include in API |
| 2234 | // requests with the JSON null value. By default, fields with empty values are |
| 2235 | // omitted from API requests. See |
| 2236 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2237 | NullFields []string `json:"-"` |
| 2238 | } |
| 2239 | |
| 2240 | func (s ListDataPointsResponse) MarshalJSON() ([]byte, error) { |
| 2241 | type NoMethod ListDataPointsResponse |
| 2242 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2243 | } |
| 2244 | |
| 2245 | // MetricsSummary: Summary metrics for an exercise. |
| 2246 | type MetricsSummary struct { |
| 2247 | // ActiveZoneMinutes: Optional. Total active zone minutes for the exercise. |
| 2248 | ActiveZoneMinutes int64 `json:"activeZoneMinutes,omitempty,string"` |
| 2249 | // AverageHeartRateBeatsPerMinute: Optional. Average heart rate during the |
| 2250 | // exercise. |
| 2251 | AverageHeartRateBeatsPerMinute int64 `json:"averageHeartRateBeatsPerMinute,omitempty,string"` |
| 2252 | // AveragePaceSecondsPerMeter: Optional. Average pace in seconds per meter. |
| 2253 | AveragePaceSecondsPerMeter float64 `json:"averagePaceSecondsPerMeter,omitempty"` |
| 2254 | // AverageSpeedMillimetersPerSecond: Optional. Average speed in millimeters per |
| 2255 | // second. |
| 2256 | AverageSpeedMillimetersPerSecond float64 `json:"averageSpeedMillimetersPerSecond,omitempty"` |
| 2257 | // CaloriesKcal: Optional. Total calories burned by the user during the |
| 2258 | // exercise. |
| 2259 | CaloriesKcal float64 `json:"caloriesKcal,omitempty"` |
| 2260 | // DistanceMillimeters: Optional. Total distance covered by the user during the |
| 2261 | // exercise. |
| 2262 | DistanceMillimeters float64 `json:"distanceMillimeters,omitempty"` |
| 2263 | // ElevationGainMillimeters: Optional. Total elevation gain during the |
| 2264 | // exercise. |
| 2265 | ElevationGainMillimeters float64 `json:"elevationGainMillimeters,omitempty"` |
| 2266 | // HeartRateZoneDurations: Optional. Time spent in each heart rate zone. |
| 2267 | HeartRateZoneDurations *TimeInHeartRateZones `json:"heartRateZoneDurations,omitempty"` |
| 2268 | // MobilityMetrics: Optional. Mobility workouts specific metrics. Only present |
| 2269 | // in the advanced running exercises. |
| 2270 | MobilityMetrics *MobilityMetrics `json:"mobilityMetrics,omitempty"` |
| 2271 | // RunVo2Max: Optional. Run VO2 max value for the exercise. Only present in the |
| 2272 | // running exercises at the top level as in the summary of the whole exercise. |
| 2273 | RunVo2Max float64 `json:"runVo2Max,omitempty"` |
| 2274 | // Steps: Optional. Total steps taken during the exercise. |
| 2275 | Steps int64 `json:"steps,omitempty,string"` |
| 2276 | // TotalSwimLengths: Optional. Number of full pool lengths completed during the |
| 2277 | // exercise. Only present in the swimming exercises at the top level as in the |
| 2278 | // summary of the whole exercise. |
| 2279 | TotalSwimLengths float64 `json:"totalSwimLengths,omitempty"` |
| 2280 | // ForceSendFields is a list of field names (e.g. "ActiveZoneMinutes") to |
| 2281 | // unconditionally include in API requests. By default, fields with empty or |
| 2282 | // default values are omitted from API requests. See |
| 2283 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2284 | // details. |
| 2285 | ForceSendFields []string `json:"-"` |
| 2286 | // NullFields is a list of field names (e.g. "ActiveZoneMinutes") to include in |
| 2287 | // API requests with the JSON null value. By default, fields with empty values |
| 2288 | // are omitted from API requests. See |
| 2289 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2290 | NullFields []string `json:"-"` |
| 2291 | } |
| 2292 | |
| 2293 | func (s MetricsSummary) MarshalJSON() ([]byte, error) { |
| 2294 | type NoMethod MetricsSummary |
| 2295 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2296 | } |
| 2297 | |
| 2298 | func (s *MetricsSummary) UnmarshalJSON(data []byte) error { |
| 2299 | type NoMethod MetricsSummary |
| 2300 | var s1 struct { |
| 2301 | AveragePaceSecondsPerMeter gensupport.JSONFloat64 `json:"averagePaceSecondsPerMeter"` |
| 2302 | AverageSpeedMillimetersPerSecond gensupport.JSONFloat64 `json:"averageSpeedMillimetersPerSecond"` |
| 2303 | CaloriesKcal gensupport.JSONFloat64 `json:"caloriesKcal"` |
| 2304 | DistanceMillimeters gensupport.JSONFloat64 `json:"distanceMillimeters"` |
| 2305 | ElevationGainMillimeters gensupport.JSONFloat64 `json:"elevationGainMillimeters"` |
| 2306 | RunVo2Max gensupport.JSONFloat64 `json:"runVo2Max"` |
| 2307 | TotalSwimLengths gensupport.JSONFloat64 `json:"totalSwimLengths"` |
| 2308 | *NoMethod |
| 2309 | } |
| 2310 | s1.NoMethod = (*NoMethod)(s) |
| 2311 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2312 | return err |
| 2313 | } |
| 2314 | s.AveragePaceSecondsPerMeter = float64(s1.AveragePaceSecondsPerMeter) |
| 2315 | s.AverageSpeedMillimetersPerSecond = float64(s1.AverageSpeedMillimetersPerSecond) |
| 2316 | s.CaloriesKcal = float64(s1.CaloriesKcal) |
| 2317 | s.DistanceMillimeters = float64(s1.DistanceMillimeters) |
| 2318 | s.ElevationGainMillimeters = float64(s1.ElevationGainMillimeters) |
| 2319 | s.RunVo2Max = float64(s1.RunVo2Max) |
| 2320 | s.TotalSwimLengths = float64(s1.TotalSwimLengths) |
| 2321 | return nil |
| 2322 | } |
| 2323 | |
| 2324 | // MobilityMetrics: Mobility workouts specific metrics |
| 2325 | type MobilityMetrics struct { |
| 2326 | // AvgCadenceStepsPerMinute: Optional. Cadence is a measure of the frequency of |
| 2327 | // your foot strikes. Steps / min in real time during workout. |
| 2328 | AvgCadenceStepsPerMinute float64 `json:"avgCadenceStepsPerMinute,omitempty"` |
| 2329 | // AvgGroundContactTimeDuration: Optional. The ground contact time for a |
| 2330 | // particular stride is the amount of time for which the foot was in contact |
| 2331 | // with the ground on that stride |
| 2332 | AvgGroundContactTimeDuration string `json:"avgGroundContactTimeDuration,omitempty"` |
| 2333 | // AvgStrideLengthMillimeters: Optional. Stride length is a measure of the |
| 2334 | // distance covered by a single stride |
| 2335 | AvgStrideLengthMillimeters int64 `json:"avgStrideLengthMillimeters,omitempty,string"` |
| 2336 | // AvgVerticalOscillationMillimeters: Optional. Distance off the ground your |
| 2337 | // center of mass moves with each stride while running |
| 2338 | AvgVerticalOscillationMillimeters int64 `json:"avgVerticalOscillationMillimeters,omitempty,string"` |
| 2339 | // AvgVerticalRatio: Optional. Vertical oscillation/stride length between [5.0, |
| 2340 | // 11.0]. |
| 2341 | AvgVerticalRatio float64 `json:"avgVerticalRatio,omitempty"` |
| 2342 | // ForceSendFields is a list of field names (e.g. "AvgCadenceStepsPerMinute") |
| 2343 | // to unconditionally include in API requests. By default, fields with empty or |
| 2344 | // default values are omitted from API requests. See |
| 2345 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2346 | // details. |
| 2347 | ForceSendFields []string `json:"-"` |
| 2348 | // NullFields is a list of field names (e.g. "AvgCadenceStepsPerMinute") to |
| 2349 | // include in API requests with the JSON null value. By default, fields with |
| 2350 | // empty values are omitted from API requests. See |
| 2351 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2352 | NullFields []string `json:"-"` |
| 2353 | } |
| 2354 | |
| 2355 | func (s MobilityMetrics) MarshalJSON() ([]byte, error) { |
| 2356 | type NoMethod MobilityMetrics |
| 2357 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2358 | } |
| 2359 | |
| 2360 | func (s *MobilityMetrics) UnmarshalJSON(data []byte) error { |
| 2361 | type NoMethod MobilityMetrics |
| 2362 | var s1 struct { |
| 2363 | AvgCadenceStepsPerMinute gensupport.JSONFloat64 `json:"avgCadenceStepsPerMinute"` |
| 2364 | AvgVerticalRatio gensupport.JSONFloat64 `json:"avgVerticalRatio"` |
| 2365 | *NoMethod |
| 2366 | } |
| 2367 | s1.NoMethod = (*NoMethod)(s) |
| 2368 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2369 | return err |
| 2370 | } |
| 2371 | s.AvgCadenceStepsPerMinute = float64(s1.AvgCadenceStepsPerMinute) |
| 2372 | s.AvgVerticalRatio = float64(s1.AvgVerticalRatio) |
| 2373 | return nil |
| 2374 | } |
| 2375 | |
| 2376 | // ObservationSampleTime: Represents a sample time of an observed data point. |
| 2377 | type ObservationSampleTime struct { |
| 2378 | // CivilTime: Output only. The civil time in the timezone the subject is in at |
| 2379 | // the time of the observation. |
| 2380 | CivilTime *CivilDateTime `json:"civilTime,omitempty"` |
| 2381 | // PhysicalTime: Required. The time of the observation. |
| 2382 | PhysicalTime string `json:"physicalTime,omitempty"` |
| 2383 | // UtcOffset: Required. The offset of the user's local time during the |
| 2384 | // observation relative to the Coordinated Universal Time (UTC). |
| 2385 | UtcOffset string `json:"utcOffset,omitempty"` |
| 2386 | // ForceSendFields is a list of field names (e.g. "CivilTime") to |
| 2387 | // unconditionally include in API requests. By default, fields with empty or |
| 2388 | // default values are omitted from API requests. See |
| 2389 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2390 | // details. |
| 2391 | ForceSendFields []string `json:"-"` |
| 2392 | // NullFields is a list of field names (e.g. "CivilTime") to include in API |
| 2393 | // requests with the JSON null value. By default, fields with empty values are |
| 2394 | // omitted from API requests. See |
| 2395 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2396 | NullFields []string `json:"-"` |
| 2397 | } |
| 2398 | |
| 2399 | func (s ObservationSampleTime) MarshalJSON() ([]byte, error) { |
| 2400 | type NoMethod ObservationSampleTime |
| 2401 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2402 | } |
| 2403 | |
| 2404 | // ObservationTimeInterval: Represents a time interval of an observed data |
| 2405 | // point. |
| 2406 | type ObservationTimeInterval struct { |
| 2407 | // CivilEndTime: Output only. Observed interval end time in civil time in the |
| 2408 | // timezone the subject is in at the end of the observed interval |
| 2409 | CivilEndTime *CivilDateTime `json:"civilEndTime,omitempty"` |
| 2410 | // CivilStartTime: Output only. Observed interval start time in civil time in |
| 2411 | // the timezone the subject is in at the start of the observed interval |
| 2412 | CivilStartTime *CivilDateTime `json:"civilStartTime,omitempty"` |
| 2413 | // EndTime: Required. Observed interval end time. |
| 2414 | EndTime string `json:"endTime,omitempty"` |
| 2415 | // EndUtcOffset: Required. The offset of the user's local time at the end of |
| 2416 | // the observation relative to the Coordinated Universal Time (UTC). |
| 2417 | EndUtcOffset string `json:"endUtcOffset,omitempty"` |
| 2418 | // StartTime: Required. Observed interval start time. |
| 2419 | StartTime string `json:"startTime,omitempty"` |
| 2420 | // StartUtcOffset: Required. The offset of the user's local time at the start |
| 2421 | // of the observation relative to the Coordinated Universal Time (UTC). |
| 2422 | StartUtcOffset string `json:"startUtcOffset,omitempty"` |
| 2423 | // ForceSendFields is a list of field names (e.g. "CivilEndTime") to |
| 2424 | // unconditionally include in API requests. By default, fields with empty or |
| 2425 | // default values are omitted from API requests. See |
| 2426 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2427 | // details. |
| 2428 | ForceSendFields []string `json:"-"` |
| 2429 | // NullFields is a list of field names (e.g. "CivilEndTime") to include in API |
| 2430 | // requests with the JSON null value. By default, fields with empty values are |
| 2431 | // omitted from API requests. See |
| 2432 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2433 | NullFields []string `json:"-"` |
| 2434 | } |
| 2435 | |
| 2436 | func (s ObservationTimeInterval) MarshalJSON() ([]byte, error) { |
| 2437 | type NoMethod ObservationTimeInterval |
| 2438 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2439 | } |
| 2440 | |
| 2441 | // Operation: This resource represents a long-running operation that is the |
| 2442 | // result of a network API call. |
| 2443 | type Operation struct { |
| 2444 | // Done: If the value is `false`, it means the operation is still in progress. |
| 2445 | // If `true`, the operation is completed, and either `error` or `response` is |
| 2446 | // available. |
| 2447 | Done bool `json:"done,omitempty"` |
| 2448 | // Error: The error result of the operation in case of failure or cancellation. |
| 2449 | Error *Status `json:"error,omitempty"` |
| 2450 | // Metadata: Service-specific metadata associated with the operation. It |
| 2451 | // typically contains progress information and common metadata such as create |
| 2452 | // time. Some services might not provide such metadata. Any method that returns |
| 2453 | // a long-running operation should document the metadata type, if any. |
| 2454 | Metadata googleapi.RawMessage `json:"metadata,omitempty"` |
| 2455 | // Name: The server-assigned name, which is only unique within the same service |
| 2456 | // that originally returns it. If you use the default HTTP mapping, the `name` |
| 2457 | // should be a resource name ending with `operations/{unique_id}`. |
| 2458 | Name string `json:"name,omitempty"` |
| 2459 | // Response: The normal, successful response of the operation. If the original |
| 2460 | // method returns no data on success, such as `Delete`, the response is |
| 2461 | // `google.protobuf.Empty`. If the original method is standard |
| 2462 | // `Get`/`Create`/`Update`, the response should be the resource. For other |
| 2463 | // methods, the response should have the type `XxxResponse`, where `Xxx` is the |
| 2464 | // original method name. For example, if the original method name is |
| 2465 | // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. |
| 2466 | Response googleapi.RawMessage `json:"response,omitempty"` |
| 2467 | |
| 2468 | // ServerResponse contains the HTTP response code and headers from the server. |
| 2469 | googleapi.ServerResponse `json:"-"` |
| 2470 | // ForceSendFields is a list of field names (e.g. "Done") to unconditionally |
| 2471 | // include in API requests. By default, fields with empty or default values are |
| 2472 | // omitted from API requests. See |
| 2473 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2474 | // details. |
| 2475 | ForceSendFields []string `json:"-"` |
| 2476 | // NullFields is a list of field names (e.g. "Done") to include in API requests |
| 2477 | // with the JSON null value. By default, fields with empty values are omitted |
| 2478 | // from API requests. See |
| 2479 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2480 | NullFields []string `json:"-"` |
| 2481 | } |
| 2482 | |
| 2483 | func (s Operation) MarshalJSON() ([]byte, error) { |
| 2484 | type NoMethod Operation |
| 2485 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2486 | } |
| 2487 | |
| 2488 | // OutOfBedSegment: A time interval to represent an out-of-bed segment. |
| 2489 | type OutOfBedSegment struct { |
| 2490 | // EndTime: Required. Segment end time. |
| 2491 | EndTime string `json:"endTime,omitempty"` |
| 2492 | // EndUtcOffset: Required. The offset of the user's local time at the end of |
| 2493 | // the segment relative to the Coordinated Universal Time (UTC). |
| 2494 | EndUtcOffset string `json:"endUtcOffset,omitempty"` |
| 2495 | // StartTime: Required. Segment tart time. |
| 2496 | StartTime string `json:"startTime,omitempty"` |
| 2497 | // StartUtcOffset: Required. The offset of the user's local time at the start |
| 2498 | // of the segment relative to the Coordinated Universal Time (UTC). |
| 2499 | StartUtcOffset string `json:"startUtcOffset,omitempty"` |
| 2500 | // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally |
| 2501 | // include in API requests. By default, fields with empty or default values are |
| 2502 | // omitted from API requests. See |
| 2503 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2504 | // details. |
| 2505 | ForceSendFields []string `json:"-"` |
| 2506 | // NullFields is a list of field names (e.g. "EndTime") to include in API |
| 2507 | // requests with the JSON null value. By default, fields with empty values are |
| 2508 | // omitted from API requests. See |
| 2509 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2510 | NullFields []string `json:"-"` |
| 2511 | } |
| 2512 | |
| 2513 | func (s OutOfBedSegment) MarshalJSON() ([]byte, error) { |
| 2514 | type NoMethod OutOfBedSegment |
| 2515 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2516 | } |
| 2517 | |
| 2518 | // OxygenSaturation: Captures the user's instantaneous oxygen saturation |
| 2519 | // percentage (SpO2). |
| 2520 | type OxygenSaturation struct { |
| 2521 | // Percentage: Required. The oxygen saturation percentage. Valid values are |
| 2522 | // from 0 to 100. |
| 2523 | Percentage float64 `json:"percentage,omitempty"` |
| 2524 | // SampleTime: Required. The time at which oxygen saturation was measured. |
| 2525 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 2526 | // ForceSendFields is a list of field names (e.g. "Percentage") to |
| 2527 | // unconditionally include in API requests. By default, fields with empty or |
| 2528 | // default values are omitted from API requests. See |
| 2529 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2530 | // details. |
| 2531 | ForceSendFields []string `json:"-"` |
| 2532 | // NullFields is a list of field names (e.g. "Percentage") to include in API |
| 2533 | // requests with the JSON null value. By default, fields with empty values are |
| 2534 | // omitted from API requests. See |
| 2535 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2536 | NullFields []string `json:"-"` |
| 2537 | } |
| 2538 | |
| 2539 | func (s OxygenSaturation) MarshalJSON() ([]byte, error) { |
| 2540 | type NoMethod OxygenSaturation |
| 2541 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2542 | } |
| 2543 | |
| 2544 | func (s *OxygenSaturation) UnmarshalJSON(data []byte) error { |
| 2545 | type NoMethod OxygenSaturation |
| 2546 | var s1 struct { |
| 2547 | Percentage gensupport.JSONFloat64 `json:"percentage"` |
| 2548 | *NoMethod |
| 2549 | } |
| 2550 | s1.NoMethod = (*NoMethod)(s) |
| 2551 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2552 | return err |
| 2553 | } |
| 2554 | s.Percentage = float64(s1.Percentage) |
| 2555 | return nil |
| 2556 | } |
| 2557 | |
| 2558 | // Profile: Profile details. |
| 2559 | type Profile struct { |
| 2560 | // Age: Optional. The age in years based on the user's birth date. Updates to |
| 2561 | // this field are currently not supported. |
| 2562 | Age int64 `json:"age,omitempty"` |
| 2563 | // AutoRunningStrideLengthMm: Output only. The automatically calculated running |
| 2564 | // stride length, in millimeters. The user must consent to one of the following |
| 2565 | // access scopes to access this field: - |
| 2566 | // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly` |
| 2567 | // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness` |
| 2568 | AutoRunningStrideLengthMm int64 `json:"autoRunningStrideLengthMm,omitempty"` |
| 2569 | // AutoWalkingStrideLengthMm: Output only. The automatically calculated walking |
| 2570 | // stride length, in millimeters. The user must consent to one of the following |
| 2571 | // access scopes to access this field: - |
| 2572 | // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly` |
| 2573 | // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness` |
| 2574 | AutoWalkingStrideLengthMm int64 `json:"autoWalkingStrideLengthMm,omitempty"` |
| 2575 | // MembershipStartDate: Output only. The date the user created their account. |
| 2576 | // Updates to this field are currently not supported. |
| 2577 | MembershipStartDate *Date `json:"membershipStartDate,omitempty"` |
| 2578 | // Name: Identifier. The resource name of this Profile resource. Format: |
| 2579 | // `users/{user}/profile` Example: `users/1234567890/profile` or |
| 2580 | // `users/me/profile` The {user} ID is a system-generated Google Health API |
| 2581 | // user ID, a string of 1-63 characters consisting of lowercase and uppercase |
| 2582 | // letters, numbers, and hyphens. The literal `me` can also be used to refer to |
| 2583 | // the authenticated user. |
| 2584 | Name string `json:"name,omitempty"` |
| 2585 | // UserConfiguredRunningStrideLengthMm: Optional. The user's user configured |
| 2586 | // running stride length, in millimeters. The user must consent to one of the |
| 2587 | // following access scopes to access this field: - |
| 2588 | // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly` |
| 2589 | // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness` |
| 2590 | UserConfiguredRunningStrideLengthMm int64 `json:"userConfiguredRunningStrideLengthMm,omitempty"` |
| 2591 | // UserConfiguredWalkingStrideLengthMm: Optional. The user's user configured |
| 2592 | // walking stride length, in millimeters. The user must consent to one of the |
| 2593 | // following access scopes to access this field: - |
| 2594 | // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly` |
| 2595 | // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness` |
| 2596 | UserConfiguredWalkingStrideLengthMm int64 `json:"userConfiguredWalkingStrideLengthMm,omitempty"` |
| 2597 | |
| 2598 | // ServerResponse contains the HTTP response code and headers from the server. |
| 2599 | googleapi.ServerResponse `json:"-"` |
| 2600 | // ForceSendFields is a list of field names (e.g. "Age") to unconditionally |
| 2601 | // include in API requests. By default, fields with empty or default values are |
| 2602 | // omitted from API requests. See |
| 2603 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2604 | // details. |
| 2605 | ForceSendFields []string `json:"-"` |
| 2606 | // NullFields is a list of field names (e.g. "Age") to include in API requests |
| 2607 | // with the JSON null value. By default, fields with empty values are omitted |
| 2608 | // from API requests. See |
| 2609 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2610 | NullFields []string `json:"-"` |
| 2611 | } |
| 2612 | |
| 2613 | func (s Profile) MarshalJSON() ([]byte, error) { |
| 2614 | type NoMethod Profile |
| 2615 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2616 | } |
| 2617 | |
| 2618 | // ReconcileDataPointsResponse: Response containing the list of reconciled |
| 2619 | // DataPoints. |
| 2620 | type ReconcileDataPointsResponse struct { |
| 2621 | // DataPoints: Data points matching the query |
| 2622 | DataPoints []*ReconciledDataPoint `json:"dataPoints,omitempty"` |
| 2623 | // NextPageToken: Next page token, empty if the response is complete |
| 2624 | NextPageToken string `json:"nextPageToken,omitempty"` |
| 2625 | |
| 2626 | // ServerResponse contains the HTTP response code and headers from the server. |
| 2627 | googleapi.ServerResponse `json:"-"` |
| 2628 | // ForceSendFields is a list of field names (e.g. "DataPoints") to |
| 2629 | // unconditionally include in API requests. By default, fields with empty or |
| 2630 | // default values are omitted from API requests. See |
| 2631 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2632 | // details. |
| 2633 | ForceSendFields []string `json:"-"` |
| 2634 | // NullFields is a list of field names (e.g. "DataPoints") to include in API |
| 2635 | // requests with the JSON null value. By default, fields with empty values are |
| 2636 | // omitted from API requests. See |
| 2637 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2638 | NullFields []string `json:"-"` |
| 2639 | } |
| 2640 | |
| 2641 | func (s ReconcileDataPointsResponse) MarshalJSON() ([]byte, error) { |
| 2642 | type NoMethod ReconcileDataPointsResponse |
| 2643 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2644 | } |
| 2645 | |
| 2646 | // ReconciledDataPoint: A reconciled computed or recorded metric. |
| 2647 | type ReconciledDataPoint struct { |
| 2648 | // ActiveMinutes: Data for points in the `active-minutes` interval data type |
| 2649 | // collection. |
| 2650 | ActiveMinutes *ActiveMinutes `json:"activeMinutes,omitempty"` |
| 2651 | // ActiveZoneMinutes: Data for points in the `active-zone-minutes` interval |
| 2652 | // data type collection, measured in minutes. |
| 2653 | ActiveZoneMinutes *ActiveZoneMinutes `json:"activeZoneMinutes,omitempty"` |
| 2654 | // ActivityLevel: Data for points in the `activity-level` daily data type |
| 2655 | // collection. |
| 2656 | ActivityLevel *ActivityLevel `json:"activityLevel,omitempty"` |
| 2657 | // Altitude: Data for points in the `altitude` interval data type collection. |
| 2658 | Altitude *Altitude `json:"altitude,omitempty"` |
| 2659 | // BodyFat: Data for points in the `body-fat` sample data type collection. |
| 2660 | BodyFat *BodyFat `json:"bodyFat,omitempty"` |
| 2661 | // DailyHeartRateVariability: Data for points in the |
| 2662 | // `daily-heart-rate-variability` daily data type collection. |
| 2663 | DailyHeartRateVariability *DailyHeartRateVariability `json:"dailyHeartRateVariability,omitempty"` |
| 2664 | // DailyHeartRateZones: Data for points in the `daily-heart-rate-zones` daily |
| 2665 | // data type collection. |
| 2666 | DailyHeartRateZones *DailyHeartRateZones `json:"dailyHeartRateZones,omitempty"` |
| 2667 | // DailyOxygenSaturation: Data for points in the `daily-oxygen-saturation` |
| 2668 | // daily data type collection. |
| 2669 | DailyOxygenSaturation *DailyOxygenSaturation `json:"dailyOxygenSaturation,omitempty"` |
| 2670 | // DailyRespiratoryRate: Data for points in the `daily-respiratory-rate` daily |
| 2671 | // data type collection. |
| 2672 | DailyRespiratoryRate *DailyRespiratoryRate `json:"dailyRespiratoryRate,omitempty"` |
| 2673 | // DailyRestingHeartRate: Data for points in the `daily-resting-heart-rate` |
| 2674 | // daily data type collection. |
| 2675 | DailyRestingHeartRate *DailyRestingHeartRate `json:"dailyRestingHeartRate,omitempty"` |
| 2676 | // DailySleepTemperatureDerivations: Data for points in the |
| 2677 | // `daily-sleep-temperature-derivations` daily data type collection. |
| 2678 | DailySleepTemperatureDerivations *DailySleepTemperatureDerivations `json:"dailySleepTemperatureDerivations,omitempty"` |
| 2679 | // DailyVo2Max: Data for points in the `daily-vo2-max` daily data type |
| 2680 | // collection. |
| 2681 | DailyVo2Max *DailyVO2Max `json:"dailyVo2Max,omitempty"` |
| 2682 | // DataPointName: Identifier. Data point name, only supported for the subset of |
| 2683 | // identifiable data types. For the majority of the data types, individual data |
| 2684 | // points do not need to be identified and this field would be empty. Format: |
| 2685 | // `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` Example: |
| 2686 | // `users/abcd1234/dataTypes/sleep/dataPoints/a1b2c3d4-e5f6-7890-1234-567890abcd |
| 2687 | // ef` The `{user}` ID is a system-generated identifier, as described in |
| 2688 | // Identity.health_user_id. The `{data_type}` ID corresponds to the kebab-case |
| 2689 | // version of the field names in the DataPoint data union field, e.g. |
| 2690 | // `total-calories` for the `total_calories` field. The `{data_point}` ID can |
| 2691 | // be client-provided or system-generated. If client-provided, it must be a |
| 2692 | // string of 4-63 characters, containing only lowercase letters, numbers, and |
| 2693 | // hyphens. |
| 2694 | DataPointName string `json:"dataPointName,omitempty"` |
| 2695 | // Distance: Data for points in the `distance` interval data type collection. |
| 2696 | Distance *Distance `json:"distance,omitempty"` |
| 2697 | // Exercise: Data for points in the `exercise` session data type collection. |
| 2698 | Exercise *Exercise `json:"exercise,omitempty"` |
| 2699 | // Floors: Data for points in the `floors` interval data type collection. |
| 2700 | Floors *Floors `json:"floors,omitempty"` |
| 2701 | // HeartRate: Data for points in the `heart-rate` sample data type collection. |
| 2702 | HeartRate *HeartRate `json:"heartRate,omitempty"` |
| 2703 | // HeartRateVariability: Data for points in the `heart-rate-variability` sample |
| 2704 | // data type collection. |
| 2705 | HeartRateVariability *HeartRateVariability `json:"heartRateVariability,omitempty"` |
| 2706 | // HydrationLog: Data for points in the `hydration-log` session data type |
| 2707 | // collection. |
| 2708 | HydrationLog *HydrationLog `json:"hydrationLog,omitempty"` |
| 2709 | // OxygenSaturation: Data for points in the `oxygen-saturation` sample data |
| 2710 | // type collection. |
| 2711 | OxygenSaturation *OxygenSaturation `json:"oxygenSaturation,omitempty"` |
| 2712 | // RespiratoryRateSleepSummary: Data for points in the |
| 2713 | // `respiratory-rate-sleep-summary` sample data type collection. |
| 2714 | RespiratoryRateSleepSummary *RespiratoryRateSleepSummary `json:"respiratoryRateSleepSummary,omitempty"` |
| 2715 | // RunVo2Max: Data for points in the `run-vo2-max` sample data type collection. |
| 2716 | RunVo2Max *RunVO2Max `json:"runVo2Max,omitempty"` |
| 2717 | // SedentaryPeriod: Data for points in the `sedentary-period` interval data |
| 2718 | // type collection. |
| 2719 | SedentaryPeriod *SedentaryPeriod `json:"sedentaryPeriod,omitempty"` |
| 2720 | // Sleep: Data for points in the `sleep` session data type collection. |
| 2721 | Sleep *Sleep `json:"sleep,omitempty"` |
| 2722 | // Steps: Data for points in the `steps` interval data type collection. |
| 2723 | Steps *Steps `json:"steps,omitempty"` |
| 2724 | // TimeInHeartRateZone: Data for points in the `time-in-heart-rate-zone` |
| 2725 | // interval data type collection. |
| 2726 | TimeInHeartRateZone *TimeInHeartRateZone `json:"timeInHeartRateZone,omitempty"` |
| 2727 | // Vo2Max: Data for points in the `vo2-max` sample data type collection. |
| 2728 | Vo2Max *VO2Max `json:"vo2Max,omitempty"` |
| 2729 | // Weight: Data for points in the `weight` sample data type collection. |
| 2730 | Weight *Weight `json:"weight,omitempty"` |
| 2731 | // ForceSendFields is a list of field names (e.g. "ActiveMinutes") to |
| 2732 | // unconditionally include in API requests. By default, fields with empty or |
| 2733 | // default values are omitted from API requests. See |
| 2734 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2735 | // details. |
| 2736 | ForceSendFields []string `json:"-"` |
| 2737 | // NullFields is a list of field names (e.g. "ActiveMinutes") to include in API |
| 2738 | // requests with the JSON null value. By default, fields with empty values are |
| 2739 | // omitted from API requests. See |
| 2740 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2741 | NullFields []string `json:"-"` |
| 2742 | } |
| 2743 | |
| 2744 | func (s ReconciledDataPoint) MarshalJSON() ([]byte, error) { |
| 2745 | type NoMethod ReconciledDataPoint |
| 2746 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2747 | } |
| 2748 | |
| 2749 | // RespiratoryRateSleepSummary: Records respiratory rate details during sleep. |
| 2750 | // Can have multiple per day if the user sleeps multiple times. |
| 2751 | type RespiratoryRateSleepSummary struct { |
| 2752 | // DeepSleepStats: Optional. Respiratory rate statistics for deep sleep. |
| 2753 | DeepSleepStats *RespiratoryRateSleepSummaryStatistics `json:"deepSleepStats,omitempty"` |
| 2754 | // FullSleepStats: Required. Full respiratory rate statistics. |
| 2755 | FullSleepStats *RespiratoryRateSleepSummaryStatistics `json:"fullSleepStats,omitempty"` |
| 2756 | // LightSleepStats: Optional. Respiratory rate statistics for light sleep. |
| 2757 | LightSleepStats *RespiratoryRateSleepSummaryStatistics `json:"lightSleepStats,omitempty"` |
| 2758 | // RemSleepStats: Optional. Respiratory rate statistics for REM sleep. |
| 2759 | RemSleepStats *RespiratoryRateSleepSummaryStatistics `json:"remSleepStats,omitempty"` |
| 2760 | // SampleTime: Required. The time at which respiratory rate was measured. |
| 2761 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 2762 | // ForceSendFields is a list of field names (e.g. "DeepSleepStats") to |
| 2763 | // unconditionally include in API requests. By default, fields with empty or |
| 2764 | // default values are omitted from API requests. See |
| 2765 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2766 | // details. |
| 2767 | ForceSendFields []string `json:"-"` |
| 2768 | // NullFields is a list of field names (e.g. "DeepSleepStats") to include in |
| 2769 | // API requests with the JSON null value. By default, fields with empty values |
| 2770 | // are omitted from API requests. See |
| 2771 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2772 | NullFields []string `json:"-"` |
| 2773 | } |
| 2774 | |
| 2775 | func (s RespiratoryRateSleepSummary) MarshalJSON() ([]byte, error) { |
| 2776 | type NoMethod RespiratoryRateSleepSummary |
| 2777 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2778 | } |
| 2779 | |
| 2780 | // RespiratoryRateSleepSummaryStatistics: Respiratory rate statistics for a |
| 2781 | // given sleep stage. |
| 2782 | type RespiratoryRateSleepSummaryStatistics struct { |
| 2783 | // BreathsPerMinute: Required. Average breaths per minute. |
| 2784 | BreathsPerMinute float64 `json:"breathsPerMinute,omitempty"` |
| 2785 | // SignalToNoise: Optional. How trustworthy the data is for the computation. |
| 2786 | SignalToNoise float64 `json:"signalToNoise,omitempty"` |
| 2787 | // StandardDeviation: Optional. Standard deviation of the respiratory rate |
| 2788 | // during sleep. |
| 2789 | StandardDeviation float64 `json:"standardDeviation,omitempty"` |
| 2790 | // ForceSendFields is a list of field names (e.g. "BreathsPerMinute") to |
| 2791 | // unconditionally include in API requests. By default, fields with empty or |
| 2792 | // default values are omitted from API requests. See |
| 2793 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2794 | // details. |
| 2795 | ForceSendFields []string `json:"-"` |
| 2796 | // NullFields is a list of field names (e.g. "BreathsPerMinute") to include in |
| 2797 | // API requests with the JSON null value. By default, fields with empty values |
| 2798 | // are omitted from API requests. See |
| 2799 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2800 | NullFields []string `json:"-"` |
| 2801 | } |
| 2802 | |
| 2803 | func (s RespiratoryRateSleepSummaryStatistics) MarshalJSON() ([]byte, error) { |
| 2804 | type NoMethod RespiratoryRateSleepSummaryStatistics |
| 2805 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2806 | } |
| 2807 | |
| 2808 | func (s *RespiratoryRateSleepSummaryStatistics) UnmarshalJSON(data []byte) error { |
| 2809 | type NoMethod RespiratoryRateSleepSummaryStatistics |
| 2810 | var s1 struct { |
| 2811 | BreathsPerMinute gensupport.JSONFloat64 `json:"breathsPerMinute"` |
| 2812 | SignalToNoise gensupport.JSONFloat64 `json:"signalToNoise"` |
| 2813 | StandardDeviation gensupport.JSONFloat64 `json:"standardDeviation"` |
| 2814 | *NoMethod |
| 2815 | } |
| 2816 | s1.NoMethod = (*NoMethod)(s) |
| 2817 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2818 | return err |
| 2819 | } |
| 2820 | s.BreathsPerMinute = float64(s1.BreathsPerMinute) |
| 2821 | s.SignalToNoise = float64(s1.SignalToNoise) |
| 2822 | s.StandardDeviation = float64(s1.StandardDeviation) |
| 2823 | return nil |
| 2824 | } |
| 2825 | |
| 2826 | // RestingHeartRatePersonalRangeRollupValue: Represents the rollup value for |
| 2827 | // the daily resting heart rate data type. |
| 2828 | type RestingHeartRatePersonalRangeRollupValue struct { |
| 2829 | // BeatsPerMinuteMax: The upper bound of the user's daily resting heart rate |
| 2830 | // personal range. |
| 2831 | BeatsPerMinuteMax float64 `json:"beatsPerMinuteMax,omitempty"` |
| 2832 | // BeatsPerMinuteMin: The lower bound of the user's daily resting heart rate |
| 2833 | // personal range. |
| 2834 | BeatsPerMinuteMin float64 `json:"beatsPerMinuteMin,omitempty"` |
| 2835 | // ForceSendFields is a list of field names (e.g. "BeatsPerMinuteMax") to |
| 2836 | // unconditionally include in API requests. By default, fields with empty or |
| 2837 | // default values are omitted from API requests. See |
| 2838 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2839 | // details. |
| 2840 | ForceSendFields []string `json:"-"` |
| 2841 | // NullFields is a list of field names (e.g. "BeatsPerMinuteMax") to include in |
| 2842 | // API requests with the JSON null value. By default, fields with empty values |
| 2843 | // are omitted from API requests. See |
| 2844 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2845 | NullFields []string `json:"-"` |
| 2846 | } |
| 2847 | |
| 2848 | func (s RestingHeartRatePersonalRangeRollupValue) MarshalJSON() ([]byte, error) { |
| 2849 | type NoMethod RestingHeartRatePersonalRangeRollupValue |
| 2850 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2851 | } |
| 2852 | |
| 2853 | func (s *RestingHeartRatePersonalRangeRollupValue) UnmarshalJSON(data []byte) error { |
| 2854 | type NoMethod RestingHeartRatePersonalRangeRollupValue |
| 2855 | var s1 struct { |
| 2856 | BeatsPerMinuteMax gensupport.JSONFloat64 `json:"beatsPerMinuteMax"` |
| 2857 | BeatsPerMinuteMin gensupport.JSONFloat64 `json:"beatsPerMinuteMin"` |
| 2858 | *NoMethod |
| 2859 | } |
| 2860 | s1.NoMethod = (*NoMethod)(s) |
| 2861 | if err := json.Unmarshal(data, &s1); err != nil { |
| 2862 | return err |
| 2863 | } |
| 2864 | s.BeatsPerMinuteMax = float64(s1.BeatsPerMinuteMax) |
| 2865 | s.BeatsPerMinuteMin = float64(s1.BeatsPerMinuteMin) |
| 2866 | return nil |
| 2867 | } |
| 2868 | |
| 2869 | // RollUpDataPointsRequest: Request to roll up data points by physical time |
| 2870 | // intervals. |
| 2871 | type RollUpDataPointsRequest struct { |
| 2872 | // DataSourceFamily: Optional. The data source family name to roll up. If |
| 2873 | // empty, data points from all available data sources will be rolled up. |
| 2874 | // Format: `users/me/dataSourceFamilies/{data_source_family}` The supported |
| 2875 | // values are: - `users/me/dataSourceFamilies/all-sources` - default value - |
| 2876 | // `users/me/dataSourceFamilies/google-wearables` - tracker devices - |
| 2877 | // `users/me/dataSourceFamilies/google-sources` - Google first party sources |
| 2878 | DataSourceFamily string `json:"dataSourceFamily,omitempty"` |
| 2879 | // PageSize: Optional. The maximum number of data points to return. If |
| 2880 | // unspecified, at most 1440 data points will be returned. The maximum page |
| 2881 | // size is 10000; values above that will be truncated accordingly. |
| 2882 | PageSize int64 `json:"pageSize,omitempty"` |
| 2883 | // PageToken: Optional. The next_page_token from a previous request, if any. |
| 2884 | // All other request fields need to be the same as in the initial request when |
| 2885 | // the page token is specified. |
| 2886 | PageToken string `json:"pageToken,omitempty"` |
| 2887 | // Range: Required. Closed-open range of data points that will be rolled up. |
| 2888 | // The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, |
| 2889 | // `active-minutes` and `total-calories` is 14 days. The maximum range for all |
| 2890 | // other data types is 90 days. |
| 2891 | Range *Interval `json:"range,omitempty"` |
| 2892 | // WindowSize: Required. The size of the time window to group data points into |
| 2893 | // before applying the aggregation functions. |
| 2894 | WindowSize string `json:"windowSize,omitempty"` |
| 2895 | // ForceSendFields is a list of field names (e.g. "DataSourceFamily") to |
| 2896 | // unconditionally include in API requests. By default, fields with empty or |
| 2897 | // default values are omitted from API requests. See |
| 2898 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2899 | // details. |
| 2900 | ForceSendFields []string `json:"-"` |
| 2901 | // NullFields is a list of field names (e.g. "DataSourceFamily") to include in |
| 2902 | // API requests with the JSON null value. By default, fields with empty values |
| 2903 | // are omitted from API requests. See |
| 2904 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2905 | NullFields []string `json:"-"` |
| 2906 | } |
| 2907 | |
| 2908 | func (s RollUpDataPointsRequest) MarshalJSON() ([]byte, error) { |
| 2909 | type NoMethod RollUpDataPointsRequest |
| 2910 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2911 | } |
| 2912 | |
| 2913 | // RollUpDataPointsResponse: Response containing the list of rolled up data |
| 2914 | // points. |
| 2915 | type RollUpDataPointsResponse struct { |
| 2916 | // NextPageToken: A token, which can be sent as `page_token` to retrieve the |
| 2917 | // next page. If this field is omitted, there are no subsequent pages. |
| 2918 | NextPageToken string `json:"nextPageToken,omitempty"` |
| 2919 | // RollupDataPoints: Values for each aggregation time window. |
| 2920 | RollupDataPoints []*RollupDataPoint `json:"rollupDataPoints,omitempty"` |
| 2921 | |
| 2922 | // ServerResponse contains the HTTP response code and headers from the server. |
| 2923 | googleapi.ServerResponse `json:"-"` |
| 2924 | // ForceSendFields is a list of field names (e.g. "NextPageToken") to |
| 2925 | // unconditionally include in API requests. By default, fields with empty or |
| 2926 | // default values are omitted from API requests. See |
| 2927 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 2928 | // details. |
| 2929 | ForceSendFields []string `json:"-"` |
| 2930 | // NullFields is a list of field names (e.g. "NextPageToken") to include in API |
| 2931 | // requests with the JSON null value. By default, fields with empty values are |
| 2932 | // omitted from API requests. See |
| 2933 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 2934 | NullFields []string `json:"-"` |
| 2935 | } |
| 2936 | |
| 2937 | func (s RollUpDataPointsResponse) MarshalJSON() ([]byte, error) { |
| 2938 | type NoMethod RollUpDataPointsResponse |
| 2939 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 2940 | } |
| 2941 | |
| 2942 | // RollupDataPoint: Value of a rollup for a single physical time interval |
| 2943 | // (aggregation window) |
| 2944 | type RollupDataPoint struct { |
| 2945 | // ActiveMinutes: Returned by default when rolling up data points from the |
| 2946 | // `active-minutes` data type, or when requested explicitly using the |
| 2947 | // `active-minutes` rollup type identifier. |
| 2948 | ActiveMinutes *ActiveMinutesRollupValue `json:"activeMinutes,omitempty"` |
| 2949 | // ActiveZoneMinutes: Returned by default when rolling up data points from the |
| 2950 | // `active-zone-minutes` data type, or when requested explicitly using the |
| 2951 | // `active-zone-minutes` rollup type identifier. |
| 2952 | ActiveZoneMinutes *ActiveZoneMinutesRollupValue `json:"activeZoneMinutes,omitempty"` |
| 2953 | // ActivityLevel: Returned by default when rolling up data points from the |
| 2954 | // `activity-level` data type, or when requested explicitly using the |
| 2955 | // `activity-level` rollup type identifier. |
| 2956 | ActivityLevel *ActivityLevelRollupValue `json:"activityLevel,omitempty"` |
| 2957 | // Altitude: Returned by default when rolling up data points from the |
| 2958 | // `altitude` data type, or when requested explicitly using the `altitude` |
| 2959 | // rollup type identifier. |
| 2960 | Altitude *AltitudeRollupValue `json:"altitude,omitempty"` |
| 2961 | // BodyFat: Returned by default when rolling up data points from the `body-fat` |
| 2962 | // data type, or when requested explicitly using the `body-fat` rollup type |
| 2963 | // identifier. |
| 2964 | BodyFat *BodyFatRollupValue `json:"bodyFat,omitempty"` |
| 2965 | // CaloriesInHeartRateZone: Returned by default when rolling up data points |
| 2966 | // from the `calories-in-heart-rate-zone` data type, or when requested |
| 2967 | // explicitly using the `calories-in-heart-rate-zone` rollup type identifier. |
| 2968 | CaloriesInHeartRateZone *CaloriesInHeartRateZoneRollupValue `json:"caloriesInHeartRateZone,omitempty"` |
| 2969 | // Distance: Returned by default when rolling up data points from the |
| 2970 | // `distance` data type, or when requested explicitly using the `distance` |
| 2971 | // rollup type identifier. |
| 2972 | Distance *DistanceRollupValue `json:"distance,omitempty"` |
| 2973 | // EndTime: End time of the window this value aggregates over |
| 2974 | EndTime string `json:"endTime,omitempty"` |
| 2975 | // Floors: Returned by default when rolling up data points from the `floors` |
| 2976 | // data type, or when requested explicitly using the `floors` rollup type |
| 2977 | // identifier. |
| 2978 | Floors *FloorsRollupValue `json:"floors,omitempty"` |
| 2979 | // HeartRate: Returned by default when rolling up data points from the |
| 2980 | // `heart-rate` data type, or when requested explicitly using the `heart-rate` |
| 2981 | // rollup type identifier. |
| 2982 | HeartRate *HeartRateRollupValue `json:"heartRate,omitempty"` |
| 2983 | // HydrationLog: Returned by default when rolling up data points from the |
| 2984 | // `hydration-log` data type, or when requested explicitly using the |
| 2985 | // `hydration-log` rollup type identifier. |
| 2986 | HydrationLog *HydrationLogRollupValue `json:"hydrationLog,omitempty"` |
| 2987 | // RunVo2Max: Returned by default when rolling up data points from the |
| 2988 | // `run-vo2-max` data type, or when requested explicitly using the |
| 2989 | // `run-vo2-max` rollup type identifier. |
| 2990 | RunVo2Max *RunVO2MaxRollupValue `json:"runVo2Max,omitempty"` |
| 2991 | // SedentaryPeriod: Returned by default when rolling up data points from the |
| 2992 | // `sedentary-period` data type, or when requested explicitly using the |
| 2993 | // `sedentary-period` rollup type identifier. |
| 2994 | SedentaryPeriod *SedentaryPeriodRollupValue `json:"sedentaryPeriod,omitempty"` |
| 2995 | // StartTime: Start time of the window this value aggregates over |
| 2996 | StartTime string `json:"startTime,omitempty"` |
| 2997 | // Steps: Returned by default when rolling up data points from the `steps` data |
| 2998 | // type, or when requested explicitly using the `steps` rollup type identifier. |
| 2999 | Steps *StepsRollupValue `json:"steps,omitempty"` |
| 3000 | // TimeInHeartRateZone: Returned by default when rolling up data points from |
| 3001 | // the `time-in-heart-rate-zone` data type, or when requested explicitly using |
| 3002 | // the `time-in-heart-rate-zone` rollup type identifier. |
| 3003 | TimeInHeartRateZone *TimeInHeartRateZoneRollupValue `json:"timeInHeartRateZone,omitempty"` |
| 3004 | // TotalCalories: Returned by default when rolling up data points from the |
| 3005 | // `total-calories` data type, or when requested explicitly using the |
| 3006 | // `total-calories` rollup type identifier. |
| 3007 | TotalCalories *TotalCaloriesRollupValue `json:"totalCalories,omitempty"` |
| 3008 | // Weight: Returned by default when rolling up data points from the `weight` |
| 3009 | // data type, or when requested explicitly using the `weight` rollup type |
| 3010 | // identifier. |
| 3011 | Weight *WeightRollupValue `json:"weight,omitempty"` |
| 3012 | // ForceSendFields is a list of field names (e.g. "ActiveMinutes") to |
| 3013 | // unconditionally include in API requests. By default, fields with empty or |
| 3014 | // default values are omitted from API requests. See |
| 3015 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3016 | // details. |
| 3017 | ForceSendFields []string `json:"-"` |
| 3018 | // NullFields is a list of field names (e.g. "ActiveMinutes") to include in API |
| 3019 | // requests with the JSON null value. By default, fields with empty values are |
| 3020 | // omitted from API requests. See |
| 3021 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3022 | NullFields []string `json:"-"` |
| 3023 | } |
| 3024 | |
| 3025 | func (s RollupDataPoint) MarshalJSON() ([]byte, error) { |
| 3026 | type NoMethod RollupDataPoint |
| 3027 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3028 | } |
| 3029 | |
| 3030 | // RunVO2Max: VO2 max value calculated based on the user's running activity. |
| 3031 | // Value stored in ml/kg/min. |
| 3032 | type RunVO2Max struct { |
| 3033 | // RunVo2Max: Required. Run VO2 max value in ml/kg/min. |
| 3034 | RunVo2Max float64 `json:"runVo2Max,omitempty"` |
| 3035 | // SampleTime: Required. The time at which the metric was measured. |
| 3036 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 3037 | // ForceSendFields is a list of field names (e.g. "RunVo2Max") to |
| 3038 | // unconditionally include in API requests. By default, fields with empty or |
| 3039 | // default values are omitted from API requests. See |
| 3040 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3041 | // details. |
| 3042 | ForceSendFields []string `json:"-"` |
| 3043 | // NullFields is a list of field names (e.g. "RunVo2Max") to include in API |
| 3044 | // requests with the JSON null value. By default, fields with empty values are |
| 3045 | // omitted from API requests. See |
| 3046 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3047 | NullFields []string `json:"-"` |
| 3048 | } |
| 3049 | |
| 3050 | func (s RunVO2Max) MarshalJSON() ([]byte, error) { |
| 3051 | type NoMethod RunVO2Max |
| 3052 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3053 | } |
| 3054 | |
| 3055 | func (s *RunVO2Max) UnmarshalJSON(data []byte) error { |
| 3056 | type NoMethod RunVO2Max |
| 3057 | var s1 struct { |
| 3058 | RunVo2Max gensupport.JSONFloat64 `json:"runVo2Max"` |
| 3059 | *NoMethod |
| 3060 | } |
| 3061 | s1.NoMethod = (*NoMethod)(s) |
| 3062 | if err := json.Unmarshal(data, &s1); err != nil { |
| 3063 | return err |
| 3064 | } |
| 3065 | s.RunVo2Max = float64(s1.RunVo2Max) |
| 3066 | return nil |
| 3067 | } |
| 3068 | |
| 3069 | // RunVO2MaxRollupValue: Represents the result of the rollup of the user's |
| 3070 | // daily heart rate variability personal range. |
| 3071 | type RunVO2MaxRollupValue struct { |
| 3072 | // RateAvg: Average value of run VO2 max in the interval. |
| 3073 | RateAvg float64 `json:"rateAvg,omitempty"` |
| 3074 | // RateMax: Maximum value of run VO2 max in the interval. |
| 3075 | RateMax float64 `json:"rateMax,omitempty"` |
| 3076 | // RateMin: Minimum value of run VO2 max in the interval.. |
| 3077 | RateMin float64 `json:"rateMin,omitempty"` |
| 3078 | // ForceSendFields is a list of field names (e.g. "RateAvg") to unconditionally |
| 3079 | // include in API requests. By default, fields with empty or default values are |
| 3080 | // omitted from API requests. See |
| 3081 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3082 | // details. |
| 3083 | ForceSendFields []string `json:"-"` |
| 3084 | // NullFields is a list of field names (e.g. "RateAvg") to include in API |
| 3085 | // requests with the JSON null value. By default, fields with empty values are |
| 3086 | // omitted from API requests. See |
| 3087 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3088 | NullFields []string `json:"-"` |
| 3089 | } |
| 3090 | |
| 3091 | func (s RunVO2MaxRollupValue) MarshalJSON() ([]byte, error) { |
| 3092 | type NoMethod RunVO2MaxRollupValue |
| 3093 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3094 | } |
| 3095 | |
| 3096 | func (s *RunVO2MaxRollupValue) UnmarshalJSON(data []byte) error { |
| 3097 | type NoMethod RunVO2MaxRollupValue |
| 3098 | var s1 struct { |
| 3099 | RateAvg gensupport.JSONFloat64 `json:"rateAvg"` |
| 3100 | RateMax gensupport.JSONFloat64 `json:"rateMax"` |
| 3101 | RateMin gensupport.JSONFloat64 `json:"rateMin"` |
| 3102 | *NoMethod |
| 3103 | } |
| 3104 | s1.NoMethod = (*NoMethod)(s) |
| 3105 | if err := json.Unmarshal(data, &s1); err != nil { |
| 3106 | return err |
| 3107 | } |
| 3108 | s.RateAvg = float64(s1.RateAvg) |
| 3109 | s.RateMax = float64(s1.RateMax) |
| 3110 | s.RateMin = float64(s1.RateMin) |
| 3111 | return nil |
| 3112 | } |
| 3113 | |
| 3114 | // SedentaryPeriod: SedentaryPeriod SedentaryPeriod data represents the periods |
| 3115 | // of time that the user was sedentary (i.e. not moving while wearing the |
| 3116 | // device). |
| 3117 | type SedentaryPeriod struct { |
| 3118 | // Interval: Required. Observed interval. |
| 3119 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 3120 | // ForceSendFields is a list of field names (e.g. "Interval") to |
| 3121 | // unconditionally include in API requests. By default, fields with empty or |
| 3122 | // default values are omitted from API requests. See |
| 3123 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3124 | // details. |
| 3125 | ForceSendFields []string `json:"-"` |
| 3126 | // NullFields is a list of field names (e.g. "Interval") to include in API |
| 3127 | // requests with the JSON null value. By default, fields with empty values are |
| 3128 | // omitted from API requests. See |
| 3129 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3130 | NullFields []string `json:"-"` |
| 3131 | } |
| 3132 | |
| 3133 | func (s SedentaryPeriod) MarshalJSON() ([]byte, error) { |
| 3134 | type NoMethod SedentaryPeriod |
| 3135 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3136 | } |
| 3137 | |
| 3138 | // SedentaryPeriodRollupValue: Represents the result of the rollup of the |
| 3139 | // user's sedentary periods. |
| 3140 | type SedentaryPeriodRollupValue struct { |
| 3141 | // DurationSum: The total time user spent sedentary during the interval. |
| 3142 | DurationSum string `json:"durationSum,omitempty"` |
| 3143 | // ForceSendFields is a list of field names (e.g. "DurationSum") to |
| 3144 | // unconditionally include in API requests. By default, fields with empty or |
| 3145 | // default values are omitted from API requests. See |
| 3146 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3147 | // details. |
| 3148 | ForceSendFields []string `json:"-"` |
| 3149 | // NullFields is a list of field names (e.g. "DurationSum") to include in API |
| 3150 | // requests with the JSON null value. By default, fields with empty values are |
| 3151 | // omitted from API requests. See |
| 3152 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3153 | NullFields []string `json:"-"` |
| 3154 | } |
| 3155 | |
| 3156 | func (s SedentaryPeriodRollupValue) MarshalJSON() ([]byte, error) { |
| 3157 | type NoMethod SedentaryPeriodRollupValue |
| 3158 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3159 | } |
| 3160 | |
| 3161 | // SessionTimeInterval: Represents a time interval of session data point, which |
| 3162 | // bundles multiple observed metrics together. |
| 3163 | type SessionTimeInterval struct { |
| 3164 | // CivilEndTime: Output only. Session end time in civil time in the timezone |
| 3165 | // the subject is in at the end of the session. |
| 3166 | CivilEndTime *CivilDateTime `json:"civilEndTime,omitempty"` |
| 3167 | // CivilStartTime: Output only. Session start time in civil time in the |
| 3168 | // timezone the subject is in at the start of the session. |
| 3169 | CivilStartTime *CivilDateTime `json:"civilStartTime,omitempty"` |
| 3170 | // EndTime: Required. The end time of the observed session. |
| 3171 | EndTime string `json:"endTime,omitempty"` |
| 3172 | // EndUtcOffset: Required. The offset of the user's local time at the end of |
| 3173 | // the session relative to the Coordinated Universal Time (UTC). |
| 3174 | EndUtcOffset string `json:"endUtcOffset,omitempty"` |
| 3175 | // StartTime: Required. The start time of the observed session. |
| 3176 | StartTime string `json:"startTime,omitempty"` |
| 3177 | // StartUtcOffset: Required. The offset of the user's local time at the start |
| 3178 | // of the session relative to the Coordinated Universal Time (UTC). |
| 3179 | StartUtcOffset string `json:"startUtcOffset,omitempty"` |
| 3180 | // ForceSendFields is a list of field names (e.g. "CivilEndTime") to |
| 3181 | // unconditionally include in API requests. By default, fields with empty or |
| 3182 | // default values are omitted from API requests. See |
| 3183 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3184 | // details. |
| 3185 | ForceSendFields []string `json:"-"` |
| 3186 | // NullFields is a list of field names (e.g. "CivilEndTime") to include in API |
| 3187 | // requests with the JSON null value. By default, fields with empty values are |
| 3188 | // omitted from API requests. See |
| 3189 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3190 | NullFields []string `json:"-"` |
| 3191 | } |
| 3192 | |
| 3193 | func (s SessionTimeInterval) MarshalJSON() ([]byte, error) { |
| 3194 | type NoMethod SessionTimeInterval |
| 3195 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3196 | } |
| 3197 | |
| 3198 | // Settings: Settings details. |
| 3199 | type Settings struct { |
| 3200 | // AutoStrideEnabled: Optional. True if the user's stride length is determined |
| 3201 | // automatically. Updates to this field are currently not supported. |
| 3202 | AutoStrideEnabled bool `json:"autoStrideEnabled,omitempty"` |
| 3203 | // DistanceUnit: Optional. The measurement unit defined in the user's account |
| 3204 | // settings. Updates to this field are currently not supported. |
| 3205 | // |
| 3206 | // Possible values: |
| 3207 | // "DISTANCE_UNIT_UNSPECIFIED" - Distance unit is not specified. |
| 3208 | // "DISTANCE_UNIT_MILES" - Distance unit is miles. |
| 3209 | // "DISTANCE_UNIT_KILOMETERS" - Distance unit is kilometers. |
| 3210 | DistanceUnit string `json:"distanceUnit,omitempty"` |
| 3211 | // GlucoseUnit: Optional. The measurement unit defined in the user's account |
| 3212 | // settings. |
| 3213 | // |
| 3214 | // Possible values: |
| 3215 | // "GLUCOSE_UNIT_UNSPECIFIED" - Glucose unit is not specified. |
| 3216 | // "GLUCOSE_UNIT_MG_DL" - Glucose unit is mg/dL. |
| 3217 | // "GLUCOSE_UNIT_MMOL_L" - Glucose unit is mmol/l. |
| 3218 | GlucoseUnit string `json:"glucoseUnit,omitempty"` |
| 3219 | // HeightUnit: Optional. The measurement unit defined in the user's account |
| 3220 | // settings. |
| 3221 | // |
| 3222 | // Possible values: |
| 3223 | // "HEIGHT_UNIT_UNSPECIFIED" - Height unit is not specified. |
| 3224 | // "HEIGHT_UNIT_INCHES" - Height unit is inches. |
| 3225 | // "HEIGHT_UNIT_CENTIMETERS" - Height unit is cm. |
| 3226 | HeightUnit string `json:"heightUnit,omitempty"` |
| 3227 | // LanguageLocale: Optional. The locale defined in the user's account settings. |
| 3228 | // Updates to this field are currently not supported. |
| 3229 | LanguageLocale string `json:"languageLocale,omitempty"` |
| 3230 | // Name: Identifier. The resource name of this Settings resource. Format: |
| 3231 | // `users/{user}/settings` Example: `users/1234567890/settings` or |
| 3232 | // `users/me/settings` The {user} ID is a system-generated Google Health API |
| 3233 | // user ID, a string of 1-63 characters consisting of lowercase and uppercase |
| 3234 | // letters, numbers, and hyphens. The literal `me` can also be used to refer to |
| 3235 | // the authenticated user. |
| 3236 | Name string `json:"name,omitempty"` |
| 3237 | // StrideLengthRunningType: Optional. The stride length type defined in the |
| 3238 | // user's account settings for running. Updates to this field are currently not |
| 3239 | // supported. |
| 3240 | // |
| 3241 | // Possible values: |
| 3242 | // "STRIDE_LENGTH_TYPE_UNSPECIFIED" - Stride length type is not specified. |
| 3243 | // "STRIDE_LENGTH_TYPE_DEFAULT" - Stride length type is computed based on the |
| 3244 | // user's gender and height. |
| 3245 | // "STRIDE_LENGTH_TYPE_MANUAL" - Stride length type is manually set by the |
| 3246 | // user. |
| 3247 | // "STRIDE_LENGTH_TYPE_AUTO" - Stride length type is determined |
| 3248 | // automatically. |
| 3249 | StrideLengthRunningType string `json:"strideLengthRunningType,omitempty"` |
| 3250 | // StrideLengthWalkingType: Optional. The stride length type defined in the |
| 3251 | // user's account settings for walking. Updates to this field are currently not |
| 3252 | // supported. |
| 3253 | // |
| 3254 | // Possible values: |
| 3255 | // "STRIDE_LENGTH_TYPE_UNSPECIFIED" - Stride length type is not specified. |
| 3256 | // "STRIDE_LENGTH_TYPE_DEFAULT" - Stride length type is computed based on the |
| 3257 | // user's gender and height. |
| 3258 | // "STRIDE_LENGTH_TYPE_MANUAL" - Stride length type is manually set by the |
| 3259 | // user. |
| 3260 | // "STRIDE_LENGTH_TYPE_AUTO" - Stride length type is determined |
| 3261 | // automatically. |
| 3262 | StrideLengthWalkingType string `json:"strideLengthWalkingType,omitempty"` |
| 3263 | // SwimUnit: Optional. The measurement unit defined in the user's account |
| 3264 | // settings. |
| 3265 | // |
| 3266 | // Possible values: |
| 3267 | // "SWIM_UNIT_UNSPECIFIED" - Swim unit is not specified. |
| 3268 | // "SWIM_UNIT_METERS" - Swim unit is meters. |
| 3269 | // "SWIM_UNIT_YARDS" - Swim unit is yards. |
| 3270 | SwimUnit string `json:"swimUnit,omitempty"` |
| 3271 | // TemperatureUnit: Optional. The measurement unit defined in the user's |
| 3272 | // account settings. |
| 3273 | // |
| 3274 | // Possible values: |
| 3275 | // "TEMPERATURE_UNIT_UNSPECIFIED" - Temperature unit is not specified. |
| 3276 | // "TEMPERATURE_UNIT_CELSIUS" - Temperature unit is Celsius. |
| 3277 | // "TEMPERATURE_UNIT_FAHRENHEIT" - Temperature unit is Fahrenheit. |
| 3278 | TemperatureUnit string `json:"temperatureUnit,omitempty"` |
| 3279 | // TimeZone: Optional. The timezone defined in the user's account settings. |
| 3280 | // This follows the IANA Time Zone Database (https://www.iana.org/time-zones). |
| 3281 | // Updates to this field are currently not supported. |
| 3282 | TimeZone string `json:"timeZone,omitempty"` |
| 3283 | // UtcOffset: Optional. The user's timezone offset relative to UTC. Updates to |
| 3284 | // this field are currently not supported. |
| 3285 | UtcOffset string `json:"utcOffset,omitempty"` |
| 3286 | // WaterUnit: Optional. The measurement unit defined in the user's account |
| 3287 | // settings. |
| 3288 | // |
| 3289 | // Possible values: |
| 3290 | // "WATER_UNIT_UNSPECIFIED" - Water unit is not specified. |
| 3291 | // "WATER_UNIT_ML" - Water unit is milliliters. |
| 3292 | // "WATER_UNIT_FL_OZ" - Water unit is fluid ounces. |
| 3293 | // "WATER_UNIT_CUP" - Water unit is cups. |
| 3294 | WaterUnit string `json:"waterUnit,omitempty"` |
| 3295 | // WeightUnit: Optional. The measurement unit defined in the user's account |
| 3296 | // settings. |
| 3297 | // |
| 3298 | // Possible values: |
| 3299 | // "WEIGHT_UNIT_UNSPECIFIED" - Weight unit is not specified. |
| 3300 | // "WEIGHT_UNIT_POUNDS" - Weight unit is pounds. |
| 3301 | // "WEIGHT_UNIT_STONE" - Weight unit is stones. |
| 3302 | // "WEIGHT_UNIT_KILOGRAMS" - Weight unit is kilograms. |
| 3303 | WeightUnit string `json:"weightUnit,omitempty"` |
| 3304 | |
| 3305 | // ServerResponse contains the HTTP response code and headers from the server. |
| 3306 | googleapi.ServerResponse `json:"-"` |
| 3307 | // ForceSendFields is a list of field names (e.g. "AutoStrideEnabled") to |
| 3308 | // unconditionally include in API requests. By default, fields with empty or |
| 3309 | // default values are omitted from API requests. See |
| 3310 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3311 | // details. |
| 3312 | ForceSendFields []string `json:"-"` |
| 3313 | // NullFields is a list of field names (e.g. "AutoStrideEnabled") to include in |
| 3314 | // API requests with the JSON null value. By default, fields with empty values |
| 3315 | // are omitted from API requests. See |
| 3316 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3317 | NullFields []string `json:"-"` |
| 3318 | } |
| 3319 | |
| 3320 | func (s Settings) MarshalJSON() ([]byte, error) { |
| 3321 | type NoMethod Settings |
| 3322 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3323 | } |
| 3324 | |
| 3325 | // Sleep: A sleep session possibly including stages. |
| 3326 | type Sleep struct { |
| 3327 | // CreateTime: Output only. Creation time of this sleep observation. |
| 3328 | CreateTime string `json:"createTime,omitempty"` |
| 3329 | // Interval: Required. Observed sleep interval. |
| 3330 | Interval *SessionTimeInterval `json:"interval,omitempty"` |
| 3331 | // Metadata: Optional. Sleep metadata: processing, main, manually edited, |
| 3332 | // stages status. |
| 3333 | Metadata *SleepMetadata `json:"metadata,omitempty"` |
| 3334 | // OutOfBedSegments: Optional. “Out of bed” segments that can overlap with |
| 3335 | // sleep stages. |
| 3336 | OutOfBedSegments []*OutOfBedSegment `json:"outOfBedSegments,omitempty"` |
| 3337 | // Stages: Optional. List of non-overlapping contiguous sleep stage segments |
| 3338 | // that cover the sleep period. |
| 3339 | Stages []*SleepStage `json:"stages,omitempty"` |
| 3340 | // Summary: Output only. Sleep summary: metrics and stages summary. |
| 3341 | Summary *SleepSummary `json:"summary,omitempty"` |
| 3342 | // Type: Optional. SleepType: classic or stages. |
| 3343 | // |
| 3344 | // Possible values: |
| 3345 | // "SLEEP_TYPE_UNSPECIFIED" - Sleep type is unspecified. |
| 3346 | // "CLASSIC" - Classic sleep is a sleep with 3 stages types: AWAKE, RESTLESS |
| 3347 | // and ASLEEP. |
| 3348 | // "STAGES" - On top of "classic" sleep stages an additional processing pass |
| 3349 | // can calculate stages more precisely, overwriting the prior stages with |
| 3350 | // AWAKE, LIGHT, REM and DEEP. |
| 3351 | Type string `json:"type,omitempty"` |
| 3352 | // UpdateTime: Output only. Last update time of this sleep observation. |
| 3353 | UpdateTime string `json:"updateTime,omitempty"` |
| 3354 | // ForceSendFields is a list of field names (e.g. "CreateTime") to |
| 3355 | // unconditionally include in API requests. By default, fields with empty or |
| 3356 | // default values are omitted from API requests. See |
| 3357 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3358 | // details. |
| 3359 | ForceSendFields []string `json:"-"` |
| 3360 | // NullFields is a list of field names (e.g. "CreateTime") to include in API |
| 3361 | // requests with the JSON null value. By default, fields with empty values are |
| 3362 | // omitted from API requests. See |
| 3363 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3364 | NullFields []string `json:"-"` |
| 3365 | } |
| 3366 | |
| 3367 | func (s Sleep) MarshalJSON() ([]byte, error) { |
| 3368 | type NoMethod Sleep |
| 3369 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3370 | } |
| 3371 | |
| 3372 | // SleepMetadata: Additional information about how the sleep was processed. |
| 3373 | type SleepMetadata struct { |
| 3374 | // ExternalId: Optional. Sleep identifier relevant in the context of the data |
| 3375 | // source. |
| 3376 | ExternalId string `json:"externalId,omitempty"` |
| 3377 | // ManuallyEdited: Output only. Some sleeps autodetected by algorithms can be |
| 3378 | // manually edited by users. |
| 3379 | ManuallyEdited bool `json:"manuallyEdited,omitempty"` |
| 3380 | // Nap: Output only. Naps are sleeps without stages and relatively short |
| 3381 | // durations. |
| 3382 | Nap bool `json:"nap,omitempty"` |
| 3383 | // Processed: Output only. Sleep and sleep stages algorithms finished |
| 3384 | // processing. |
| 3385 | Processed bool `json:"processed,omitempty"` |
| 3386 | // StagesStatus: Output only. Sleep stages algorithm processing status. |
| 3387 | // |
| 3388 | // Possible values: |
| 3389 | // "STAGES_STATE_UNSPECIFIED" - Output only. Sleep stages status is |
| 3390 | // unspecified. |
| 3391 | // "REJECTED_COVERAGE" - Output only. Sleep stages cannot be computed due to |
| 3392 | // low RR coverage. |
| 3393 | // "REJECTED_MAX_GAP" - Output only. Sleep stages cannot be computed due to |
| 3394 | // the large middle gap (2h). |
| 3395 | // "REJECTED_START_GAP" - Output only. Sleep stages cannot be computed due to |
| 3396 | // the large start gap (1h). |
| 3397 | // "REJECTED_END_GAP" - Output only. Sleep stages cannot be computed due to |
| 3398 | // the large end gap (1h). |
| 3399 | // "REJECTED_NAP" - Output only. Sleep stages cannot be computed because the |
| 3400 | // sleep log is a nap (has < 3h duration). |
| 3401 | // "REJECTED_SERVER" - Output only. Sleep stages cannot be computed because |
| 3402 | // input data is not available (PPGV2, wake magnitude, etc). |
| 3403 | // "TIMEOUT" - Output only. Sleep stages cannot be computed due to server |
| 3404 | // timeout. |
| 3405 | // "SUCCEEDED" - Output only. Sleep stages successfully computed. |
| 3406 | // "PROCESSING_INTERNAL_ERROR" - Output only. Sleep stages cannot be computed |
| 3407 | // due to server internal error. |
| 3408 | StagesStatus string `json:"stagesStatus,omitempty"` |
| 3409 | // ForceSendFields is a list of field names (e.g. "ExternalId") to |
| 3410 | // unconditionally include in API requests. By default, fields with empty or |
| 3411 | // default values are omitted from API requests. See |
| 3412 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3413 | // details. |
| 3414 | ForceSendFields []string `json:"-"` |
| 3415 | // NullFields is a list of field names (e.g. "ExternalId") to include in API |
| 3416 | // requests with the JSON null value. By default, fields with empty values are |
| 3417 | // omitted from API requests. See |
| 3418 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3419 | NullFields []string `json:"-"` |
| 3420 | } |
| 3421 | |
| 3422 | func (s SleepMetadata) MarshalJSON() ([]byte, error) { |
| 3423 | type NoMethod SleepMetadata |
| 3424 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3425 | } |
| 3426 | |
| 3427 | // SleepStage: Sleep stage segment. |
| 3428 | type SleepStage struct { |
| 3429 | // CreateTime: Output only. Creation time of this sleep stages segment. |
| 3430 | CreateTime string `json:"createTime,omitempty"` |
| 3431 | // EndTime: Required. Sleep stage end time. |
| 3432 | EndTime string `json:"endTime,omitempty"` |
| 3433 | // EndUtcOffset: Required. The offset of the user's local time at the end of |
| 3434 | // the sleep stage relative to the Coordinated Universal Time (UTC). |
| 3435 | EndUtcOffset string `json:"endUtcOffset,omitempty"` |
| 3436 | // StartTime: Required. Sleep stage start time. |
| 3437 | StartTime string `json:"startTime,omitempty"` |
| 3438 | // StartUtcOffset: Required. The offset of the user's local time at the start |
| 3439 | // of the sleep stage relative to the Coordinated Universal Time (UTC). |
| 3440 | StartUtcOffset string `json:"startUtcOffset,omitempty"` |
| 3441 | // Type: Required. Sleep stage type: AWAKE, DEEP, REM, LIGHT etc. |
| 3442 | // |
| 3443 | // Possible values: |
| 3444 | // "SLEEP_STAGE_TYPE_UNSPECIFIED" - The default unset value. |
| 3445 | // "AWAKE" - Sleep stage AWAKE. |
| 3446 | // "LIGHT" - Sleep stage LIGHT. |
| 3447 | // "DEEP" - Sleep stage DEEP. |
| 3448 | // "REM" - Sleep stage REM. |
| 3449 | // "ASLEEP" - Sleep stage ASLEEP. |
| 3450 | // "RESTLESS" - Sleep stage RESTLESS. |
| 3451 | Type string `json:"type,omitempty"` |
| 3452 | // UpdateTime: Output only. Last update time of this sleep stages segment. |
| 3453 | UpdateTime string `json:"updateTime,omitempty"` |
| 3454 | // ForceSendFields is a list of field names (e.g. "CreateTime") to |
| 3455 | // unconditionally include in API requests. By default, fields with empty or |
| 3456 | // default values are omitted from API requests. See |
| 3457 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3458 | // details. |
| 3459 | ForceSendFields []string `json:"-"` |
| 3460 | // NullFields is a list of field names (e.g. "CreateTime") to include in API |
| 3461 | // requests with the JSON null value. By default, fields with empty values are |
| 3462 | // omitted from API requests. See |
| 3463 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3464 | NullFields []string `json:"-"` |
| 3465 | } |
| 3466 | |
| 3467 | func (s SleepStage) MarshalJSON() ([]byte, error) { |
| 3468 | type NoMethod SleepStage |
| 3469 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3470 | } |
| 3471 | |
| 3472 | // SleepSummary: Sleep summary: metrics and stages summary. |
| 3473 | type SleepSummary struct { |
| 3474 | // MinutesAfterWakeUp: Output only. Minutes after wake up calculated by |
| 3475 | // restlessness algorithm. |
| 3476 | MinutesAfterWakeUp int64 `json:"minutesAfterWakeUp,omitempty,string"` |
| 3477 | // MinutesAsleep: Output only. Total number of minutes asleep. For classic |
| 3478 | // sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For |
| 3479 | // "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding |
| 3480 | // AWAKE). |
| 3481 | MinutesAsleep int64 `json:"minutesAsleep,omitempty,string"` |
| 3482 | // MinutesAwake: Output only. Total number of minutes awake. It is a sum of all |
| 3483 | // AWAKE stages. |
| 3484 | MinutesAwake int64 `json:"minutesAwake,omitempty,string"` |
| 3485 | // MinutesInSleepPeriod: Output only. Delta between wake time and bedtime. It |
| 3486 | // is the sum of all stages. |
| 3487 | MinutesInSleepPeriod int64 `json:"minutesInSleepPeriod,omitempty,string"` |
| 3488 | // MinutesToFallAsleep: Output only. Minutes to fall asleep calculated by |
| 3489 | // restlessness algorithm. |
| 3490 | MinutesToFallAsleep int64 `json:"minutesToFallAsleep,omitempty,string"` |
| 3491 | // StagesSummary: Output only. List of summaries (total duration and segment |
| 3492 | // count) per each sleep stage type. |
| 3493 | StagesSummary []*StageSummary `json:"stagesSummary,omitempty"` |
| 3494 | // ForceSendFields is a list of field names (e.g. "MinutesAfterWakeUp") to |
| 3495 | // unconditionally include in API requests. By default, fields with empty or |
| 3496 | // default values are omitted from API requests. See |
| 3497 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3498 | // details. |
| 3499 | ForceSendFields []string `json:"-"` |
| 3500 | // NullFields is a list of field names (e.g. "MinutesAfterWakeUp") to include |
| 3501 | // in API requests with the JSON null value. By default, fields with empty |
| 3502 | // values are omitted from API requests. See |
| 3503 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3504 | NullFields []string `json:"-"` |
| 3505 | } |
| 3506 | |
| 3507 | func (s SleepSummary) MarshalJSON() ([]byte, error) { |
| 3508 | type NoMethod SleepSummary |
| 3509 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3510 | } |
| 3511 | |
| 3512 | // SplitSummary: Represents splits or laps recorded within an exercise. Lap |
| 3513 | // events partition a workout into segments based on criteria like distance, |
| 3514 | // time, or calories. |
| 3515 | type SplitSummary struct { |
| 3516 | // ActiveDuration: Output only. Lap time excluding the pauses. |
| 3517 | ActiveDuration string `json:"activeDuration,omitempty"` |
| 3518 | // EndTime: Required. Lap end time |
| 3519 | EndTime string `json:"endTime,omitempty"` |
| 3520 | // EndUtcOffset: Required. Lap end time offset from UTC |
| 3521 | EndUtcOffset string `json:"endUtcOffset,omitempty"` |
| 3522 | // MetricsSummary: Required. Summary metrics for this split. |
| 3523 | MetricsSummary *MetricsSummary `json:"metricsSummary,omitempty"` |
| 3524 | // SplitType: Required. Method used to split the exercise laps. Users may |
| 3525 | // manually mark the lap as complete even if the tracking is automatic. |
| 3526 | // |
| 3527 | // Possible values: |
| 3528 | // "SPLIT_TYPE_UNSPECIFIED" - Split type is unspecified. |
| 3529 | // "MANUAL" - Manual split. |
| 3530 | // "DURATION" - Split by duration. |
| 3531 | // "DISTANCE" - Split by distance. |
| 3532 | // "CALORIES" - Split by calories. |
| 3533 | SplitType string `json:"splitType,omitempty"` |
| 3534 | // StartTime: Required. Lap start time |
| 3535 | StartTime string `json:"startTime,omitempty"` |
| 3536 | // StartUtcOffset: Required. Lap start time offset from UTC |
| 3537 | StartUtcOffset string `json:"startUtcOffset,omitempty"` |
| 3538 | // ForceSendFields is a list of field names (e.g. "ActiveDuration") to |
| 3539 | // unconditionally include in API requests. By default, fields with empty or |
| 3540 | // default values are omitted from API requests. See |
| 3541 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3542 | // details. |
| 3543 | ForceSendFields []string `json:"-"` |
| 3544 | // NullFields is a list of field names (e.g. "ActiveDuration") to include in |
| 3545 | // API requests with the JSON null value. By default, fields with empty values |
| 3546 | // are omitted from API requests. See |
| 3547 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3548 | NullFields []string `json:"-"` |
| 3549 | } |
| 3550 | |
| 3551 | func (s SplitSummary) MarshalJSON() ([]byte, error) { |
| 3552 | type NoMethod SplitSummary |
| 3553 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3554 | } |
| 3555 | |
| 3556 | // StageSummary: Total duration and segment count for a stage. |
| 3557 | type StageSummary struct { |
| 3558 | // Count: Output only. Number of sleep stages segments. |
| 3559 | Count int64 `json:"count,omitempty,string"` |
| 3560 | // Minutes: Output only. Total duration in minutes of a sleep stage. |
| 3561 | Minutes int64 `json:"minutes,omitempty,string"` |
| 3562 | // Type: Output only. Sleep stage type: AWAKE, DEEP, REM, LIGHT etc. |
| 3563 | // |
| 3564 | // Possible values: |
| 3565 | // "SLEEP_STAGE_TYPE_UNSPECIFIED" - The default unset value. |
| 3566 | // "AWAKE" - Sleep stage AWAKE. |
| 3567 | // "LIGHT" - Sleep stage LIGHT. |
| 3568 | // "DEEP" - Sleep stage DEEP. |
| 3569 | // "REM" - Sleep stage REM. |
| 3570 | // "ASLEEP" - Sleep stage ASLEEP. |
| 3571 | // "RESTLESS" - Sleep stage RESTLESS. |
| 3572 | Type string `json:"type,omitempty"` |
| 3573 | // ForceSendFields is a list of field names (e.g. "Count") to unconditionally |
| 3574 | // include in API requests. By default, fields with empty or default values are |
| 3575 | // omitted from API requests. See |
| 3576 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3577 | // details. |
| 3578 | ForceSendFields []string `json:"-"` |
| 3579 | // NullFields is a list of field names (e.g. "Count") to include in API |
| 3580 | // requests with the JSON null value. By default, fields with empty values are |
| 3581 | // omitted from API requests. See |
| 3582 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3583 | NullFields []string `json:"-"` |
| 3584 | } |
| 3585 | |
| 3586 | func (s StageSummary) MarshalJSON() ([]byte, error) { |
| 3587 | type NoMethod StageSummary |
| 3588 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3589 | } |
| 3590 | |
| 3591 | // Status: The `Status` type defines a logical error model that is suitable for |
| 3592 | // different programming environments, including REST APIs and RPC APIs. It is |
| 3593 | // used by gRPC (https://github.com/grpc). Each `Status` message contains three |
| 3594 | // pieces of data: error code, error message, and error details. You can find |
| 3595 | // out more about this error model and how to work with it in the API Design |
| 3596 | // Guide (https://cloud.google.com/apis/design/errors). |
| 3597 | type Status struct { |
| 3598 | // Code: The status code, which should be an enum value of google.rpc.Code. |
| 3599 | Code int64 `json:"code,omitempty"` |
| 3600 | // Details: A list of messages that carry the error details. There is a common |
| 3601 | // set of message types for APIs to use. |
| 3602 | Details []googleapi.RawMessage `json:"details,omitempty"` |
| 3603 | // Message: A developer-facing error message, which should be in English. Any |
| 3604 | // user-facing error message should be localized and sent in the |
| 3605 | // google.rpc.Status.details field, or localized by the client. |
| 3606 | Message string `json:"message,omitempty"` |
| 3607 | // ForceSendFields is a list of field names (e.g. "Code") to unconditionally |
| 3608 | // include in API requests. By default, fields with empty or default values are |
| 3609 | // omitted from API requests. See |
| 3610 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3611 | // details. |
| 3612 | ForceSendFields []string `json:"-"` |
| 3613 | // NullFields is a list of field names (e.g. "Code") to include in API requests |
| 3614 | // with the JSON null value. By default, fields with empty values are omitted |
| 3615 | // from API requests. See |
| 3616 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3617 | NullFields []string `json:"-"` |
| 3618 | } |
| 3619 | |
| 3620 | func (s Status) MarshalJSON() ([]byte, error) { |
| 3621 | type NoMethod Status |
| 3622 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3623 | } |
| 3624 | |
| 3625 | // Steps: Step count over the time interval. |
| 3626 | type Steps struct { |
| 3627 | // Count: Required. Number of steps in the recorded interval. |
| 3628 | Count int64 `json:"count,omitempty,string"` |
| 3629 | // Interval: Required. Observed interval. |
| 3630 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 3631 | // ForceSendFields is a list of field names (e.g. "Count") to unconditionally |
| 3632 | // include in API requests. By default, fields with empty or default values are |
| 3633 | // omitted from API requests. See |
| 3634 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3635 | // details. |
| 3636 | ForceSendFields []string `json:"-"` |
| 3637 | // NullFields is a list of field names (e.g. "Count") to include in API |
| 3638 | // requests with the JSON null value. By default, fields with empty values are |
| 3639 | // omitted from API requests. See |
| 3640 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3641 | NullFields []string `json:"-"` |
| 3642 | } |
| 3643 | |
| 3644 | func (s Steps) MarshalJSON() ([]byte, error) { |
| 3645 | type NoMethod Steps |
| 3646 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3647 | } |
| 3648 | |
| 3649 | // StepsRollupValue: Represents the result of the rollup of the steps data |
| 3650 | // type. |
| 3651 | type StepsRollupValue struct { |
| 3652 | // CountSum: Total number of steps in the interval. |
| 3653 | CountSum int64 `json:"countSum,omitempty,string"` |
| 3654 | // ForceSendFields is a list of field names (e.g. "CountSum") to |
| 3655 | // unconditionally include in API requests. By default, fields with empty or |
| 3656 | // default values are omitted from API requests. See |
| 3657 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3658 | // details. |
| 3659 | ForceSendFields []string `json:"-"` |
| 3660 | // NullFields is a list of field names (e.g. "CountSum") to include in API |
| 3661 | // requests with the JSON null value. By default, fields with empty values are |
| 3662 | // omitted from API requests. See |
| 3663 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3664 | NullFields []string `json:"-"` |
| 3665 | } |
| 3666 | |
| 3667 | func (s StepsRollupValue) MarshalJSON() ([]byte, error) { |
| 3668 | type NoMethod StepsRollupValue |
| 3669 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3670 | } |
| 3671 | |
| 3672 | // TimeInHeartRateZone: Time in heart rate zone record. It's an interval spent |
| 3673 | // in specific heart rate zone. |
| 3674 | type TimeInHeartRateZone struct { |
| 3675 | // HeartRateZoneType: Required. Heart rate zone type. |
| 3676 | // |
| 3677 | // Possible values: |
| 3678 | // "HEART_RATE_ZONE_TYPE_UNSPECIFIED" - Unspecified heart rate zone. |
| 3679 | // "LIGHT" - The light heart rate zone. |
| 3680 | // "MODERATE" - The moderate heart rate zone. |
| 3681 | // "VIGOROUS" - The vigorous heart rate zone. |
| 3682 | // "PEAK" - The peak heart rate zone. |
| 3683 | HeartRateZoneType string `json:"heartRateZoneType,omitempty"` |
| 3684 | // Interval: Required. Observed interval. |
| 3685 | Interval *ObservationTimeInterval `json:"interval,omitempty"` |
| 3686 | // ForceSendFields is a list of field names (e.g. "HeartRateZoneType") to |
| 3687 | // unconditionally include in API requests. By default, fields with empty or |
| 3688 | // default values are omitted from API requests. See |
| 3689 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3690 | // details. |
| 3691 | ForceSendFields []string `json:"-"` |
| 3692 | // NullFields is a list of field names (e.g. "HeartRateZoneType") to include in |
| 3693 | // API requests with the JSON null value. By default, fields with empty values |
| 3694 | // are omitted from API requests. See |
| 3695 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3696 | NullFields []string `json:"-"` |
| 3697 | } |
| 3698 | |
| 3699 | func (s TimeInHeartRateZone) MarshalJSON() ([]byte, error) { |
| 3700 | type NoMethod TimeInHeartRateZone |
| 3701 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3702 | } |
| 3703 | |
| 3704 | // TimeInHeartRateZoneRollupValue: Represents the result of the rollup of the |
| 3705 | // time in heart rate zone data type. |
| 3706 | type TimeInHeartRateZoneRollupValue struct { |
| 3707 | // TimeInHeartRateZones: List of time spent in each heart rate zone. |
| 3708 | TimeInHeartRateZones []*TimeInHeartRateZoneValue `json:"timeInHeartRateZones,omitempty"` |
| 3709 | // ForceSendFields is a list of field names (e.g. "TimeInHeartRateZones") to |
| 3710 | // unconditionally include in API requests. By default, fields with empty or |
| 3711 | // default values are omitted from API requests. See |
| 3712 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3713 | // details. |
| 3714 | ForceSendFields []string `json:"-"` |
| 3715 | // NullFields is a list of field names (e.g. "TimeInHeartRateZones") to include |
| 3716 | // in API requests with the JSON null value. By default, fields with empty |
| 3717 | // values are omitted from API requests. See |
| 3718 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3719 | NullFields []string `json:"-"` |
| 3720 | } |
| 3721 | |
| 3722 | func (s TimeInHeartRateZoneRollupValue) MarshalJSON() ([]byte, error) { |
| 3723 | type NoMethod TimeInHeartRateZoneRollupValue |
| 3724 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3725 | } |
| 3726 | |
| 3727 | // TimeInHeartRateZoneValue: Represents the total time spent in a specific |
| 3728 | // heart rate zone. |
| 3729 | type TimeInHeartRateZoneValue struct { |
| 3730 | // Duration: The total time spent in the specified heart rate zone. |
| 3731 | Duration string `json:"duration,omitempty"` |
| 3732 | // HeartRateZone: The heart rate zone. |
| 3733 | // |
| 3734 | // Possible values: |
| 3735 | // "HEART_RATE_ZONE_TYPE_UNSPECIFIED" - Unspecified heart rate zone. |
| 3736 | // "LIGHT" - The light heart rate zone. |
| 3737 | // "MODERATE" - The moderate heart rate zone. |
| 3738 | // "VIGOROUS" - The vigorous heart rate zone. |
| 3739 | // "PEAK" - The peak heart rate zone. |
| 3740 | HeartRateZone string `json:"heartRateZone,omitempty"` |
| 3741 | // ForceSendFields is a list of field names (e.g. "Duration") to |
| 3742 | // unconditionally include in API requests. By default, fields with empty or |
| 3743 | // default values are omitted from API requests. See |
| 3744 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3745 | // details. |
| 3746 | ForceSendFields []string `json:"-"` |
| 3747 | // NullFields is a list of field names (e.g. "Duration") to include in API |
| 3748 | // requests with the JSON null value. By default, fields with empty values are |
| 3749 | // omitted from API requests. See |
| 3750 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3751 | NullFields []string `json:"-"` |
| 3752 | } |
| 3753 | |
| 3754 | func (s TimeInHeartRateZoneValue) MarshalJSON() ([]byte, error) { |
| 3755 | type NoMethod TimeInHeartRateZoneValue |
| 3756 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3757 | } |
| 3758 | |
| 3759 | // TimeInHeartRateZones: Time spent in each heart rate zone. |
| 3760 | type TimeInHeartRateZones struct { |
| 3761 | // LightTime: Optional. Time spent in light heart rate zone. |
| 3762 | LightTime string `json:"lightTime,omitempty"` |
| 3763 | // ModerateTime: Optional. Time spent in moderate heart rate zone. |
| 3764 | ModerateTime string `json:"moderateTime,omitempty"` |
| 3765 | // PeakTime: Optional. Time spent in peak heart rate zone. |
| 3766 | PeakTime string `json:"peakTime,omitempty"` |
| 3767 | // VigorousTime: Optional. Time spent in vigorous heart rate zone. |
| 3768 | VigorousTime string `json:"vigorousTime,omitempty"` |
| 3769 | // ForceSendFields is a list of field names (e.g. "LightTime") to |
| 3770 | // unconditionally include in API requests. By default, fields with empty or |
| 3771 | // default values are omitted from API requests. See |
| 3772 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3773 | // details. |
| 3774 | ForceSendFields []string `json:"-"` |
| 3775 | // NullFields is a list of field names (e.g. "LightTime") to include in API |
| 3776 | // requests with the JSON null value. By default, fields with empty values are |
| 3777 | // omitted from API requests. See |
| 3778 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3779 | NullFields []string `json:"-"` |
| 3780 | } |
| 3781 | |
| 3782 | func (s TimeInHeartRateZones) MarshalJSON() ([]byte, error) { |
| 3783 | type NoMethod TimeInHeartRateZones |
| 3784 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3785 | } |
| 3786 | |
| 3787 | // TimeOfDay: Represents a time of day. The date and time zone are either not |
| 3788 | // significant or are specified elsewhere. An API may choose to allow leap |
| 3789 | // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. |
| 3790 | type TimeOfDay struct { |
| 3791 | // Hours: Hours of a day in 24 hour format. Must be greater than or equal to 0 |
| 3792 | // and typically must be less than or equal to 23. An API may choose to allow |
| 3793 | // the value "24:00:00" for scenarios like business closing time. |
| 3794 | Hours int64 `json:"hours,omitempty"` |
| 3795 | // Minutes: Minutes of an hour. Must be greater than or equal to 0 and less |
| 3796 | // than or equal to 59. |
| 3797 | Minutes int64 `json:"minutes,omitempty"` |
| 3798 | // Nanos: Fractions of seconds, in nanoseconds. Must be greater than or equal |
| 3799 | // to 0 and less than or equal to 999,999,999. |
| 3800 | Nanos int64 `json:"nanos,omitempty"` |
| 3801 | // Seconds: Seconds of a minute. Must be greater than or equal to 0 and |
| 3802 | // typically must be less than or equal to 59. An API may allow the value 60 if |
| 3803 | // it allows leap-seconds. |
| 3804 | Seconds int64 `json:"seconds,omitempty"` |
| 3805 | // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally |
| 3806 | // include in API requests. By default, fields with empty or default values are |
| 3807 | // omitted from API requests. See |
| 3808 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3809 | // details. |
| 3810 | ForceSendFields []string `json:"-"` |
| 3811 | // NullFields is a list of field names (e.g. "Hours") to include in API |
| 3812 | // requests with the JSON null value. By default, fields with empty values are |
| 3813 | // omitted from API requests. See |
| 3814 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3815 | NullFields []string `json:"-"` |
| 3816 | } |
| 3817 | |
| 3818 | func (s TimeOfDay) MarshalJSON() ([]byte, error) { |
| 3819 | type NoMethod TimeOfDay |
| 3820 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3821 | } |
| 3822 | |
| 3823 | // TimeZone: Represents a time zone from the IANA Time Zone Database |
| 3824 | // (https://www.iana.org/time-zones). |
| 3825 | type TimeZone struct { |
| 3826 | // Id: IANA Time Zone Database time zone. For example "America/New_York". |
| 3827 | Id string `json:"id,omitempty"` |
| 3828 | // Version: Optional. IANA Time Zone Database version number. For example |
| 3829 | // "2019a". |
| 3830 | Version string `json:"version,omitempty"` |
| 3831 | // ForceSendFields is a list of field names (e.g. "Id") to unconditionally |
| 3832 | // include in API requests. By default, fields with empty or default values are |
| 3833 | // omitted from API requests. See |
| 3834 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3835 | // details. |
| 3836 | ForceSendFields []string `json:"-"` |
| 3837 | // NullFields is a list of field names (e.g. "Id") to include in API requests |
| 3838 | // with the JSON null value. By default, fields with empty values are omitted |
| 3839 | // from API requests. See |
| 3840 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3841 | NullFields []string `json:"-"` |
| 3842 | } |
| 3843 | |
| 3844 | func (s TimeZone) MarshalJSON() ([]byte, error) { |
| 3845 | type NoMethod TimeZone |
| 3846 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3847 | } |
| 3848 | |
| 3849 | // TotalCaloriesRollupValue: Represents the result of the rollup of the user's |
| 3850 | // total calories. |
| 3851 | type TotalCaloriesRollupValue struct { |
| 3852 | // KcalSum: Sum of the total calories in kilocalories. |
| 3853 | KcalSum float64 `json:"kcalSum,omitempty"` |
| 3854 | // ForceSendFields is a list of field names (e.g. "KcalSum") to unconditionally |
| 3855 | // include in API requests. By default, fields with empty or default values are |
| 3856 | // omitted from API requests. See |
| 3857 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3858 | // details. |
| 3859 | ForceSendFields []string `json:"-"` |
| 3860 | // NullFields is a list of field names (e.g. "KcalSum") to include in API |
| 3861 | // requests with the JSON null value. By default, fields with empty values are |
| 3862 | // omitted from API requests. See |
| 3863 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3864 | NullFields []string `json:"-"` |
| 3865 | } |
| 3866 | |
| 3867 | func (s TotalCaloriesRollupValue) MarshalJSON() ([]byte, error) { |
| 3868 | type NoMethod TotalCaloriesRollupValue |
| 3869 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3870 | } |
| 3871 | |
| 3872 | func (s *TotalCaloriesRollupValue) UnmarshalJSON(data []byte) error { |
| 3873 | type NoMethod TotalCaloriesRollupValue |
| 3874 | var s1 struct { |
| 3875 | KcalSum gensupport.JSONFloat64 `json:"kcalSum"` |
| 3876 | *NoMethod |
| 3877 | } |
| 3878 | s1.NoMethod = (*NoMethod)(s) |
| 3879 | if err := json.Unmarshal(data, &s1); err != nil { |
| 3880 | return err |
| 3881 | } |
| 3882 | s.KcalSum = float64(s1.KcalSum) |
| 3883 | return nil |
| 3884 | } |
| 3885 | |
| 3886 | // VO2Max: VO2 max measurement. |
| 3887 | type VO2Max struct { |
| 3888 | // MeasurementMethod: Optional. The method used to measure the VO2 max value. |
| 3889 | // |
| 3890 | // Possible values: |
| 3891 | // "MEASUREMENT_METHOD_UNSPECIFIED" - Unspecified measurement method. |
| 3892 | // "FITBIT_RUN" - Fitbit specific, measures VO2 max rate during a run. |
| 3893 | // "GOOGLE_DEMOGRAPHIC" - Google specific, measures VO2 max rate for a user |
| 3894 | // based on their demographic data. |
| 3895 | // "COOPER_TEST" - Run as far as possible for 12 minutes. Distance correlated |
| 3896 | // with age and gender translates to a VO2 max value. |
| 3897 | // "HEART_RATE_RATIO" - Maximum heart rate divided by the resting heart rate, |
| 3898 | // with a multiplier applied. Does not require any exercise. |
| 3899 | // "METABOLIC_CART" - Measured by a medical device called metabolic cart. |
| 3900 | // "MULTISTAGE_FITNESS_TEST" - Continuous 20m back-and-forth runs with |
| 3901 | // increasing difficulty, until exhaustion. |
| 3902 | // "ROCKPORT_FITNESS_TEST" - Measured using walking exercise. |
| 3903 | // "MAX_EXERCISE" - Healthkit specific, measures VO2 max rate by monitoring |
| 3904 | // exercise to the user’s physical limit. Similar to COOPER_TEST or |
| 3905 | // MULTISTAGE_FITNESS_TEST. |
| 3906 | // "PREDICTION_SUB_MAX_EXERCISE" - Healthkit specific, estimates VO2 max rate |
| 3907 | // based on low-intensity exercise. Similar to ROCKPORT_FITNESS_TEST. |
| 3908 | // "PREDICTION_NON_EXERCISE" - Healthkit specific, estimates VO2 max rate |
| 3909 | // without any exercise. Similar to HEART_RATE_RATIO. |
| 3910 | // "OTHER" - Use when the method is not covered in this enum. |
| 3911 | MeasurementMethod string `json:"measurementMethod,omitempty"` |
| 3912 | // SampleTime: Required. The time at which VO2 max was measured. |
| 3913 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 3914 | // Vo2Max: Required. VO2 max value measured as in ml consumed oxygen / kg of |
| 3915 | // body weight / min. |
| 3916 | Vo2Max float64 `json:"vo2Max,omitempty"` |
| 3917 | // ForceSendFields is a list of field names (e.g. "MeasurementMethod") to |
| 3918 | // unconditionally include in API requests. By default, fields with empty or |
| 3919 | // default values are omitted from API requests. See |
| 3920 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3921 | // details. |
| 3922 | ForceSendFields []string `json:"-"` |
| 3923 | // NullFields is a list of field names (e.g. "MeasurementMethod") to include in |
| 3924 | // API requests with the JSON null value. By default, fields with empty values |
| 3925 | // are omitted from API requests. See |
| 3926 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3927 | NullFields []string `json:"-"` |
| 3928 | } |
| 3929 | |
| 3930 | func (s VO2Max) MarshalJSON() ([]byte, error) { |
| 3931 | type NoMethod VO2Max |
| 3932 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3933 | } |
| 3934 | |
| 3935 | func (s *VO2Max) UnmarshalJSON(data []byte) error { |
| 3936 | type NoMethod VO2Max |
| 3937 | var s1 struct { |
| 3938 | Vo2Max gensupport.JSONFloat64 `json:"vo2Max"` |
| 3939 | *NoMethod |
| 3940 | } |
| 3941 | s1.NoMethod = (*NoMethod)(s) |
| 3942 | if err := json.Unmarshal(data, &s1); err != nil { |
| 3943 | return err |
| 3944 | } |
| 3945 | s.Vo2Max = float64(s1.Vo2Max) |
| 3946 | return nil |
| 3947 | } |
| 3948 | |
| 3949 | // VolumeQuantity: Represents the volume quantity. |
| 3950 | type VolumeQuantity struct { |
| 3951 | // Milliliters: Required. Value representing the volume in milliliters. |
| 3952 | Milliliters float64 `json:"milliliters,omitempty"` |
| 3953 | // UserProvidedUnit: Optional. Value representing the user provided unit. |
| 3954 | // |
| 3955 | // Possible values: |
| 3956 | // "VOLUME_UNIT_UNSPECIFIED" - Unspecified volume unit. |
| 3957 | // "CUP_IMPERIAL" - Cup (imperial) |
| 3958 | // "CUP_US" - Cup (US) |
| 3959 | // "FLUID_OUNCE_IMPERIAL" - Fluid ounce (imperial) |
| 3960 | // "FLUID_OUNCE_US" - Fluid ounce (US) |
| 3961 | // "LITER" - Liter |
| 3962 | // "MILLILITER" - Milliliter |
| 3963 | // "PINT_IMPERIAL" - Pint (imperial) |
| 3964 | // "PINT_US" - Pint (US) |
| 3965 | UserProvidedUnit string `json:"userProvidedUnit,omitempty"` |
| 3966 | // ForceSendFields is a list of field names (e.g. "Milliliters") to |
| 3967 | // unconditionally include in API requests. By default, fields with empty or |
| 3968 | // default values are omitted from API requests. See |
| 3969 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 3970 | // details. |
| 3971 | ForceSendFields []string `json:"-"` |
| 3972 | // NullFields is a list of field names (e.g. "Milliliters") to include in API |
| 3973 | // requests with the JSON null value. By default, fields with empty values are |
| 3974 | // omitted from API requests. See |
| 3975 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 3976 | NullFields []string `json:"-"` |
| 3977 | } |
| 3978 | |
| 3979 | func (s VolumeQuantity) MarshalJSON() ([]byte, error) { |
| 3980 | type NoMethod VolumeQuantity |
| 3981 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 3982 | } |
| 3983 | |
| 3984 | func (s *VolumeQuantity) UnmarshalJSON(data []byte) error { |
| 3985 | type NoMethod VolumeQuantity |
| 3986 | var s1 struct { |
| 3987 | Milliliters gensupport.JSONFloat64 `json:"milliliters"` |
| 3988 | *NoMethod |
| 3989 | } |
| 3990 | s1.NoMethod = (*NoMethod)(s) |
| 3991 | if err := json.Unmarshal(data, &s1); err != nil { |
| 3992 | return err |
| 3993 | } |
| 3994 | s.Milliliters = float64(s1.Milliliters) |
| 3995 | return nil |
| 3996 | } |
| 3997 | |
| 3998 | // VolumeQuantityRollup: Rollup for volume quantity. |
| 3999 | type VolumeQuantityRollup struct { |
| 4000 | // MillilitersSum: Required. The sum of volume in milliliters. |
| 4001 | MillilitersSum float64 `json:"millilitersSum,omitempty"` |
| 4002 | // UserProvidedUnitLast: Optional. The user provided unit on the last element. |
| 4003 | // |
| 4004 | // Possible values: |
| 4005 | // "VOLUME_UNIT_UNSPECIFIED" - Unspecified volume unit. |
| 4006 | // "CUP_IMPERIAL" - Cup (imperial) |
| 4007 | // "CUP_US" - Cup (US) |
| 4008 | // "FLUID_OUNCE_IMPERIAL" - Fluid ounce (imperial) |
| 4009 | // "FLUID_OUNCE_US" - Fluid ounce (US) |
| 4010 | // "LITER" - Liter |
| 4011 | // "MILLILITER" - Milliliter |
| 4012 | // "PINT_IMPERIAL" - Pint (imperial) |
| 4013 | // "PINT_US" - Pint (US) |
| 4014 | UserProvidedUnitLast string `json:"userProvidedUnitLast,omitempty"` |
| 4015 | // ForceSendFields is a list of field names (e.g. "MillilitersSum") to |
| 4016 | // unconditionally include in API requests. By default, fields with empty or |
| 4017 | // default values are omitted from API requests. See |
| 4018 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 4019 | // details. |
| 4020 | ForceSendFields []string `json:"-"` |
| 4021 | // NullFields is a list of field names (e.g. "MillilitersSum") to include in |
| 4022 | // API requests with the JSON null value. By default, fields with empty values |
| 4023 | // are omitted from API requests. See |
| 4024 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 4025 | NullFields []string `json:"-"` |
| 4026 | } |
| 4027 | |
| 4028 | func (s VolumeQuantityRollup) MarshalJSON() ([]byte, error) { |
| 4029 | type NoMethod VolumeQuantityRollup |
| 4030 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 4031 | } |
| 4032 | |
| 4033 | func (s *VolumeQuantityRollup) UnmarshalJSON(data []byte) error { |
| 4034 | type NoMethod VolumeQuantityRollup |
| 4035 | var s1 struct { |
| 4036 | MillilitersSum gensupport.JSONFloat64 `json:"millilitersSum"` |
| 4037 | *NoMethod |
| 4038 | } |
| 4039 | s1.NoMethod = (*NoMethod)(s) |
| 4040 | if err := json.Unmarshal(data, &s1); err != nil { |
| 4041 | return err |
| 4042 | } |
| 4043 | s.MillilitersSum = float64(s1.MillilitersSum) |
| 4044 | return nil |
| 4045 | } |
| 4046 | |
| 4047 | // Weight: Body weight measurement. |
| 4048 | type Weight struct { |
| 4049 | // Notes: Optional. Standard free-form notes captured at manual logging. |
| 4050 | Notes string `json:"notes,omitempty"` |
| 4051 | // SampleTime: Required. The time at which the weight was measured |
| 4052 | SampleTime *ObservationSampleTime `json:"sampleTime,omitempty"` |
| 4053 | // WeightGrams: Required. Weight of a user in grams. |
| 4054 | WeightGrams float64 `json:"weightGrams,omitempty"` |
| 4055 | // ForceSendFields is a list of field names (e.g. "Notes") to unconditionally |
| 4056 | // include in API requests. By default, fields with empty or default values are |
| 4057 | // omitted from API requests. See |
| 4058 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 4059 | // details. |
| 4060 | ForceSendFields []string `json:"-"` |
| 4061 | // NullFields is a list of field names (e.g. "Notes") to include in API |
| 4062 | // requests with the JSON null value. By default, fields with empty values are |
| 4063 | // omitted from API requests. See |
| 4064 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 4065 | NullFields []string `json:"-"` |
| 4066 | } |
| 4067 | |
| 4068 | func (s Weight) MarshalJSON() ([]byte, error) { |
| 4069 | type NoMethod Weight |
| 4070 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 4071 | } |
| 4072 | |
| 4073 | func (s *Weight) UnmarshalJSON(data []byte) error { |
| 4074 | type NoMethod Weight |
| 4075 | var s1 struct { |
| 4076 | WeightGrams gensupport.JSONFloat64 `json:"weightGrams"` |
| 4077 | *NoMethod |
| 4078 | } |
| 4079 | s1.NoMethod = (*NoMethod)(s) |
| 4080 | if err := json.Unmarshal(data, &s1); err != nil { |
| 4081 | return err |
| 4082 | } |
| 4083 | s.WeightGrams = float64(s1.WeightGrams) |
| 4084 | return nil |
| 4085 | } |
| 4086 | |
| 4087 | // WeightRollupValue: Represents the result of the rollup of the weight data |
| 4088 | // type. |
| 4089 | type WeightRollupValue struct { |
| 4090 | // WeightGramsAvg: Average weight in grams. |
| 4091 | WeightGramsAvg float64 `json:"weightGramsAvg,omitempty"` |
| 4092 | // ForceSendFields is a list of field names (e.g. "WeightGramsAvg") to |
| 4093 | // unconditionally include in API requests. By default, fields with empty or |
| 4094 | // default values are omitted from API requests. See |
| 4095 | // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 4096 | // details. |
| 4097 | ForceSendFields []string `json:"-"` |
| 4098 | // NullFields is a list of field names (e.g. "WeightGramsAvg") to include in |
| 4099 | // API requests with the JSON null value. By default, fields with empty values |
| 4100 | // are omitted from API requests. See |
| 4101 | // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 4102 | NullFields []string `json:"-"` |
| 4103 | } |
| 4104 | |
| 4105 | func (s WeightRollupValue) MarshalJSON() ([]byte, error) { |
| 4106 | type NoMethod WeightRollupValue |
| 4107 | return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 4108 | } |
| 4109 | |
| 4110 | func (s *WeightRollupValue) UnmarshalJSON(data []byte) error { |
| 4111 | type NoMethod WeightRollupValue |
| 4112 | var s1 struct { |
| 4113 | WeightGramsAvg gensupport.JSONFloat64 `json:"weightGramsAvg"` |
| 4114 | *NoMethod |
| 4115 | } |
| 4116 | s1.NoMethod = (*NoMethod)(s) |
| 4117 | if err := json.Unmarshal(data, &s1); err != nil { |
| 4118 | return err |
| 4119 | } |
| 4120 | s.WeightGramsAvg = float64(s1.WeightGramsAvg) |
| 4121 | return nil |
| 4122 | } |
| 4123 | |
| 4124 | type UsersGetIdentityCall struct { |
| 4125 | s *Service |
| 4126 | name string |
| 4127 | urlParams_ gensupport.URLParams |
| 4128 | ifNoneMatch_ string |
| 4129 | ctx_ context.Context |
| 4130 | header_ http.Header |
| 4131 | } |
| 4132 | |
| 4133 | // GetIdentity: Gets the user's identity. It includes the legacy Fitbit user ID |
| 4134 | // and the Google user ID and it can be used by migrating clients to map |
| 4135 | // identifiers between the two systems. |
| 4136 | // |
| 4137 | // - name: The resource name of the Identity. Format: `users/me/identity`. |
| 4138 | func (r *UsersService) GetIdentity(name string) *UsersGetIdentityCall { |
| 4139 | c := &UsersGetIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4140 | c.name = name |
| 4141 | return c |
| 4142 | } |
| 4143 | |
| 4144 | // Fields allows partial responses to be retrieved. See |
| 4145 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4146 | // details. |
| 4147 | func (c *UsersGetIdentityCall) Fields(s ...googleapi.Field) *UsersGetIdentityCall { |
| 4148 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4149 | return c |
| 4150 | } |
| 4151 | |
| 4152 | // IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 4153 | // object's ETag matches the given value. This is useful for getting updates |
| 4154 | // only after the object has changed since the last request. |
| 4155 | func (c *UsersGetIdentityCall) IfNoneMatch(entityTag string) *UsersGetIdentityCall { |
| 4156 | c.ifNoneMatch_ = entityTag |
| 4157 | return c |
| 4158 | } |
| 4159 | |
| 4160 | // Context sets the context to be used in this call's Do method. |
| 4161 | func (c *UsersGetIdentityCall) Context(ctx context.Context) *UsersGetIdentityCall { |
| 4162 | c.ctx_ = ctx |
| 4163 | return c |
| 4164 | } |
| 4165 | |
| 4166 | // Header returns a http.Header that can be modified by the caller to add |
| 4167 | // headers to the request. |
| 4168 | func (c *UsersGetIdentityCall) Header() http.Header { |
| 4169 | if c.header_ == nil { |
| 4170 | c.header_ = make(http.Header) |
| 4171 | } |
| 4172 | return c.header_ |
| 4173 | } |
| 4174 | |
| 4175 | func (c *UsersGetIdentityCall) doRequest(alt string) (*http.Response, error) { |
| 4176 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 4177 | if c.ifNoneMatch_ != "" { |
| 4178 | reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 4179 | } |
| 4180 | c.urlParams_.Set("alt", alt) |
| 4181 | c.urlParams_.Set("prettyPrint", "false") |
| 4182 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") |
| 4183 | urls += "?" + c.urlParams_.Encode() |
| 4184 | req, err := http.NewRequest("GET", urls, nil) |
| 4185 | if err != nil { |
| 4186 | return nil, err |
| 4187 | } |
| 4188 | req.Header = reqHeaders |
| 4189 | googleapi.Expand(req.URL, map[string]string{ |
| 4190 | "name": c.name, |
| 4191 | }) |
| 4192 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.getIdentity", "request", internallog.HTTPRequest(req, nil)) |
| 4193 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4194 | } |
| 4195 | |
| 4196 | // Do executes the "health.users.getIdentity" call. |
| 4197 | // Any non-2xx status code is an error. Response headers are in either |
| 4198 | // *Identity.ServerResponse.Header or (if a response was returned at all) in |
| 4199 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4200 | // whether the returned error was because http.StatusNotModified was returned. |
| 4201 | func (c *UsersGetIdentityCall) Do(opts ...googleapi.CallOption) (*Identity, error) { |
| 4202 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4203 | res, err := c.doRequest("json") |
| 4204 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4205 | if res.Body != nil { |
| 4206 | res.Body.Close() |
| 4207 | } |
| 4208 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4209 | Code: res.StatusCode, |
| 4210 | Header: res.Header, |
| 4211 | }) |
| 4212 | } |
| 4213 | if err != nil { |
| 4214 | return nil, err |
| 4215 | } |
| 4216 | defer googleapi.CloseBody(res) |
| 4217 | if err := googleapi.CheckResponse(res); err != nil { |
| 4218 | return nil, gensupport.WrapError(err) |
| 4219 | } |
| 4220 | ret := &Identity{ |
| 4221 | ServerResponse: googleapi.ServerResponse{ |
| 4222 | Header: res.Header, |
| 4223 | HTTPStatusCode: res.StatusCode, |
| 4224 | }, |
| 4225 | } |
| 4226 | target := &ret |
| 4227 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4228 | if err != nil { |
| 4229 | return nil, err |
| 4230 | } |
| 4231 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.getIdentity", "response", internallog.HTTPResponse(res, b)) |
| 4232 | return ret, nil |
| 4233 | } |
| 4234 | |
| 4235 | type UsersGetProfileCall struct { |
| 4236 | s *Service |
| 4237 | name string |
| 4238 | urlParams_ gensupport.URLParams |
| 4239 | ifNoneMatch_ string |
| 4240 | ctx_ context.Context |
| 4241 | header_ http.Header |
| 4242 | } |
| 4243 | |
| 4244 | // GetProfile: Returns user Profile details. |
| 4245 | // |
| 4246 | // - name: The name of the Profile. Format: `users/me/profile`. |
| 4247 | func (r *UsersService) GetProfile(name string) *UsersGetProfileCall { |
| 4248 | c := &UsersGetProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4249 | c.name = name |
| 4250 | return c |
| 4251 | } |
| 4252 | |
| 4253 | // Fields allows partial responses to be retrieved. See |
| 4254 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4255 | // details. |
| 4256 | func (c *UsersGetProfileCall) Fields(s ...googleapi.Field) *UsersGetProfileCall { |
| 4257 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4258 | return c |
| 4259 | } |
| 4260 | |
| 4261 | // IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 4262 | // object's ETag matches the given value. This is useful for getting updates |
| 4263 | // only after the object has changed since the last request. |
| 4264 | func (c *UsersGetProfileCall) IfNoneMatch(entityTag string) *UsersGetProfileCall { |
| 4265 | c.ifNoneMatch_ = entityTag |
| 4266 | return c |
| 4267 | } |
| 4268 | |
| 4269 | // Context sets the context to be used in this call's Do method. |
| 4270 | func (c *UsersGetProfileCall) Context(ctx context.Context) *UsersGetProfileCall { |
| 4271 | c.ctx_ = ctx |
| 4272 | return c |
| 4273 | } |
| 4274 | |
| 4275 | // Header returns a http.Header that can be modified by the caller to add |
| 4276 | // headers to the request. |
| 4277 | func (c *UsersGetProfileCall) Header() http.Header { |
| 4278 | if c.header_ == nil { |
| 4279 | c.header_ = make(http.Header) |
| 4280 | } |
| 4281 | return c.header_ |
| 4282 | } |
| 4283 | |
| 4284 | func (c *UsersGetProfileCall) doRequest(alt string) (*http.Response, error) { |
| 4285 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 4286 | if c.ifNoneMatch_ != "" { |
| 4287 | reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 4288 | } |
| 4289 | c.urlParams_.Set("alt", alt) |
| 4290 | c.urlParams_.Set("prettyPrint", "false") |
| 4291 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") |
| 4292 | urls += "?" + c.urlParams_.Encode() |
| 4293 | req, err := http.NewRequest("GET", urls, nil) |
| 4294 | if err != nil { |
| 4295 | return nil, err |
| 4296 | } |
| 4297 | req.Header = reqHeaders |
| 4298 | googleapi.Expand(req.URL, map[string]string{ |
| 4299 | "name": c.name, |
| 4300 | }) |
| 4301 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.getProfile", "request", internallog.HTTPRequest(req, nil)) |
| 4302 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4303 | } |
| 4304 | |
| 4305 | // Do executes the "health.users.getProfile" call. |
| 4306 | // Any non-2xx status code is an error. Response headers are in either |
| 4307 | // *Profile.ServerResponse.Header or (if a response was returned at all) in |
| 4308 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4309 | // whether the returned error was because http.StatusNotModified was returned. |
| 4310 | func (c *UsersGetProfileCall) Do(opts ...googleapi.CallOption) (*Profile, error) { |
| 4311 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4312 | res, err := c.doRequest("json") |
| 4313 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4314 | if res.Body != nil { |
| 4315 | res.Body.Close() |
| 4316 | } |
| 4317 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4318 | Code: res.StatusCode, |
| 4319 | Header: res.Header, |
| 4320 | }) |
| 4321 | } |
| 4322 | if err != nil { |
| 4323 | return nil, err |
| 4324 | } |
| 4325 | defer googleapi.CloseBody(res) |
| 4326 | if err := googleapi.CheckResponse(res); err != nil { |
| 4327 | return nil, gensupport.WrapError(err) |
| 4328 | } |
| 4329 | ret := &Profile{ |
| 4330 | ServerResponse: googleapi.ServerResponse{ |
| 4331 | Header: res.Header, |
| 4332 | HTTPStatusCode: res.StatusCode, |
| 4333 | }, |
| 4334 | } |
| 4335 | target := &ret |
| 4336 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4337 | if err != nil { |
| 4338 | return nil, err |
| 4339 | } |
| 4340 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.getProfile", "response", internallog.HTTPResponse(res, b)) |
| 4341 | return ret, nil |
| 4342 | } |
| 4343 | |
| 4344 | type UsersGetSettingsCall struct { |
| 4345 | s *Service |
| 4346 | name string |
| 4347 | urlParams_ gensupport.URLParams |
| 4348 | ifNoneMatch_ string |
| 4349 | ctx_ context.Context |
| 4350 | header_ http.Header |
| 4351 | } |
| 4352 | |
| 4353 | // GetSettings: Returns user settings details. |
| 4354 | // |
| 4355 | // - name: The name of the Settings. Format: `users/me/settings`. |
| 4356 | func (r *UsersService) GetSettings(name string) *UsersGetSettingsCall { |
| 4357 | c := &UsersGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4358 | c.name = name |
| 4359 | return c |
| 4360 | } |
| 4361 | |
| 4362 | // Fields allows partial responses to be retrieved. See |
| 4363 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4364 | // details. |
| 4365 | func (c *UsersGetSettingsCall) Fields(s ...googleapi.Field) *UsersGetSettingsCall { |
| 4366 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4367 | return c |
| 4368 | } |
| 4369 | |
| 4370 | // IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 4371 | // object's ETag matches the given value. This is useful for getting updates |
| 4372 | // only after the object has changed since the last request. |
| 4373 | func (c *UsersGetSettingsCall) IfNoneMatch(entityTag string) *UsersGetSettingsCall { |
| 4374 | c.ifNoneMatch_ = entityTag |
| 4375 | return c |
| 4376 | } |
| 4377 | |
| 4378 | // Context sets the context to be used in this call's Do method. |
| 4379 | func (c *UsersGetSettingsCall) Context(ctx context.Context) *UsersGetSettingsCall { |
| 4380 | c.ctx_ = ctx |
| 4381 | return c |
| 4382 | } |
| 4383 | |
| 4384 | // Header returns a http.Header that can be modified by the caller to add |
| 4385 | // headers to the request. |
| 4386 | func (c *UsersGetSettingsCall) Header() http.Header { |
| 4387 | if c.header_ == nil { |
| 4388 | c.header_ = make(http.Header) |
| 4389 | } |
| 4390 | return c.header_ |
| 4391 | } |
| 4392 | |
| 4393 | func (c *UsersGetSettingsCall) doRequest(alt string) (*http.Response, error) { |
| 4394 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 4395 | if c.ifNoneMatch_ != "" { |
| 4396 | reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 4397 | } |
| 4398 | c.urlParams_.Set("alt", alt) |
| 4399 | c.urlParams_.Set("prettyPrint", "false") |
| 4400 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") |
| 4401 | urls += "?" + c.urlParams_.Encode() |
| 4402 | req, err := http.NewRequest("GET", urls, nil) |
| 4403 | if err != nil { |
| 4404 | return nil, err |
| 4405 | } |
| 4406 | req.Header = reqHeaders |
| 4407 | googleapi.Expand(req.URL, map[string]string{ |
| 4408 | "name": c.name, |
| 4409 | }) |
| 4410 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.getSettings", "request", internallog.HTTPRequest(req, nil)) |
| 4411 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4412 | } |
| 4413 | |
| 4414 | // Do executes the "health.users.getSettings" call. |
| 4415 | // Any non-2xx status code is an error. Response headers are in either |
| 4416 | // *Settings.ServerResponse.Header or (if a response was returned at all) in |
| 4417 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4418 | // whether the returned error was because http.StatusNotModified was returned. |
| 4419 | func (c *UsersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { |
| 4420 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4421 | res, err := c.doRequest("json") |
| 4422 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4423 | if res.Body != nil { |
| 4424 | res.Body.Close() |
| 4425 | } |
| 4426 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4427 | Code: res.StatusCode, |
| 4428 | Header: res.Header, |
| 4429 | }) |
| 4430 | } |
| 4431 | if err != nil { |
| 4432 | return nil, err |
| 4433 | } |
| 4434 | defer googleapi.CloseBody(res) |
| 4435 | if err := googleapi.CheckResponse(res); err != nil { |
| 4436 | return nil, gensupport.WrapError(err) |
| 4437 | } |
| 4438 | ret := &Settings{ |
| 4439 | ServerResponse: googleapi.ServerResponse{ |
| 4440 | Header: res.Header, |
| 4441 | HTTPStatusCode: res.StatusCode, |
| 4442 | }, |
| 4443 | } |
| 4444 | target := &ret |
| 4445 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4446 | if err != nil { |
| 4447 | return nil, err |
| 4448 | } |
| 4449 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.getSettings", "response", internallog.HTTPResponse(res, b)) |
| 4450 | return ret, nil |
| 4451 | } |
| 4452 | |
| 4453 | type UsersUpdateProfileCall struct { |
| 4454 | s *Service |
| 4455 | name string |
| 4456 | profile *Profile |
| 4457 | urlParams_ gensupport.URLParams |
| 4458 | ctx_ context.Context |
| 4459 | header_ http.Header |
| 4460 | } |
| 4461 | |
| 4462 | // UpdateProfile: Updates the user's profile details. |
| 4463 | // |
| 4464 | // - name: Identifier. The resource name of this Profile resource. Format: |
| 4465 | // `users/{user}/profile` Example: `users/1234567890/profile` or |
| 4466 | // `users/me/profile` The {user} ID is a system-generated Google Health API |
| 4467 | // user ID, a string of 1-63 characters consisting of lowercase and uppercase |
| 4468 | // letters, numbers, and hyphens. The literal `me` can also be used to refer |
| 4469 | // to the authenticated user. |
| 4470 | func (r *UsersService) UpdateProfile(name string, profile *Profile) *UsersUpdateProfileCall { |
| 4471 | c := &UsersUpdateProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4472 | c.name = name |
| 4473 | c.profile = profile |
| 4474 | return c |
| 4475 | } |
| 4476 | |
| 4477 | // UpdateMask sets the optional parameter "updateMask": The list of fields to |
| 4478 | // be updated. |
| 4479 | func (c *UsersUpdateProfileCall) UpdateMask(updateMask string) *UsersUpdateProfileCall { |
| 4480 | c.urlParams_.Set("updateMask", updateMask) |
| 4481 | return c |
| 4482 | } |
| 4483 | |
| 4484 | // Fields allows partial responses to be retrieved. See |
| 4485 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4486 | // details. |
| 4487 | func (c *UsersUpdateProfileCall) Fields(s ...googleapi.Field) *UsersUpdateProfileCall { |
| 4488 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4489 | return c |
| 4490 | } |
| 4491 | |
| 4492 | // Context sets the context to be used in this call's Do method. |
| 4493 | func (c *UsersUpdateProfileCall) Context(ctx context.Context) *UsersUpdateProfileCall { |
| 4494 | c.ctx_ = ctx |
| 4495 | return c |
| 4496 | } |
| 4497 | |
| 4498 | // Header returns a http.Header that can be modified by the caller to add |
| 4499 | // headers to the request. |
| 4500 | func (c *UsersUpdateProfileCall) Header() http.Header { |
| 4501 | if c.header_ == nil { |
| 4502 | c.header_ = make(http.Header) |
| 4503 | } |
| 4504 | return c.header_ |
| 4505 | } |
| 4506 | |
| 4507 | func (c *UsersUpdateProfileCall) doRequest(alt string) (*http.Response, error) { |
| 4508 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 4509 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.profile) |
| 4510 | if err != nil { |
| 4511 | return nil, err |
| 4512 | } |
| 4513 | c.urlParams_.Set("alt", alt) |
| 4514 | c.urlParams_.Set("prettyPrint", "false") |
| 4515 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") |
| 4516 | urls += "?" + c.urlParams_.Encode() |
| 4517 | req, err := http.NewRequest("PATCH", urls, body) |
| 4518 | if err != nil { |
| 4519 | return nil, err |
| 4520 | } |
| 4521 | req.Header = reqHeaders |
| 4522 | googleapi.Expand(req.URL, map[string]string{ |
| 4523 | "name": c.name, |
| 4524 | }) |
| 4525 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.updateProfile", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 4526 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4527 | } |
| 4528 | |
| 4529 | // Do executes the "health.users.updateProfile" call. |
| 4530 | // Any non-2xx status code is an error. Response headers are in either |
| 4531 | // *Profile.ServerResponse.Header or (if a response was returned at all) in |
| 4532 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4533 | // whether the returned error was because http.StatusNotModified was returned. |
| 4534 | func (c *UsersUpdateProfileCall) Do(opts ...googleapi.CallOption) (*Profile, error) { |
| 4535 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4536 | res, err := c.doRequest("json") |
| 4537 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4538 | if res.Body != nil { |
| 4539 | res.Body.Close() |
| 4540 | } |
| 4541 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4542 | Code: res.StatusCode, |
| 4543 | Header: res.Header, |
| 4544 | }) |
| 4545 | } |
| 4546 | if err != nil { |
| 4547 | return nil, err |
| 4548 | } |
| 4549 | defer googleapi.CloseBody(res) |
| 4550 | if err := googleapi.CheckResponse(res); err != nil { |
| 4551 | return nil, gensupport.WrapError(err) |
| 4552 | } |
| 4553 | ret := &Profile{ |
| 4554 | ServerResponse: googleapi.ServerResponse{ |
| 4555 | Header: res.Header, |
| 4556 | HTTPStatusCode: res.StatusCode, |
| 4557 | }, |
| 4558 | } |
| 4559 | target := &ret |
| 4560 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4561 | if err != nil { |
| 4562 | return nil, err |
| 4563 | } |
| 4564 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.updateProfile", "response", internallog.HTTPResponse(res, b)) |
| 4565 | return ret, nil |
| 4566 | } |
| 4567 | |
| 4568 | type UsersUpdateSettingsCall struct { |
| 4569 | s *Service |
| 4570 | name string |
| 4571 | settings *Settings |
| 4572 | urlParams_ gensupport.URLParams |
| 4573 | ctx_ context.Context |
| 4574 | header_ http.Header |
| 4575 | } |
| 4576 | |
| 4577 | // UpdateSettings: Updates the user's settings details. |
| 4578 | // |
| 4579 | // - name: Identifier. The resource name of this Settings resource. Format: |
| 4580 | // `users/{user}/settings` Example: `users/1234567890/settings` or |
| 4581 | // `users/me/settings` The {user} ID is a system-generated Google Health API |
| 4582 | // user ID, a string of 1-63 characters consisting of lowercase and uppercase |
| 4583 | // letters, numbers, and hyphens. The literal `me` can also be used to refer |
| 4584 | // to the authenticated user. |
| 4585 | func (r *UsersService) UpdateSettings(name string, settings *Settings) *UsersUpdateSettingsCall { |
| 4586 | c := &UsersUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4587 | c.name = name |
| 4588 | c.settings = settings |
| 4589 | return c |
| 4590 | } |
| 4591 | |
| 4592 | // UpdateMask sets the optional parameter "updateMask": The list of fields to |
| 4593 | // be updated. |
| 4594 | func (c *UsersUpdateSettingsCall) UpdateMask(updateMask string) *UsersUpdateSettingsCall { |
| 4595 | c.urlParams_.Set("updateMask", updateMask) |
| 4596 | return c |
| 4597 | } |
| 4598 | |
| 4599 | // Fields allows partial responses to be retrieved. See |
| 4600 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4601 | // details. |
| 4602 | func (c *UsersUpdateSettingsCall) Fields(s ...googleapi.Field) *UsersUpdateSettingsCall { |
| 4603 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4604 | return c |
| 4605 | } |
| 4606 | |
| 4607 | // Context sets the context to be used in this call's Do method. |
| 4608 | func (c *UsersUpdateSettingsCall) Context(ctx context.Context) *UsersUpdateSettingsCall { |
| 4609 | c.ctx_ = ctx |
| 4610 | return c |
| 4611 | } |
| 4612 | |
| 4613 | // Header returns a http.Header that can be modified by the caller to add |
| 4614 | // headers to the request. |
| 4615 | func (c *UsersUpdateSettingsCall) Header() http.Header { |
| 4616 | if c.header_ == nil { |
| 4617 | c.header_ = make(http.Header) |
| 4618 | } |
| 4619 | return c.header_ |
| 4620 | } |
| 4621 | |
| 4622 | func (c *UsersUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { |
| 4623 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 4624 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.settings) |
| 4625 | if err != nil { |
| 4626 | return nil, err |
| 4627 | } |
| 4628 | c.urlParams_.Set("alt", alt) |
| 4629 | c.urlParams_.Set("prettyPrint", "false") |
| 4630 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") |
| 4631 | urls += "?" + c.urlParams_.Encode() |
| 4632 | req, err := http.NewRequest("PATCH", urls, body) |
| 4633 | if err != nil { |
| 4634 | return nil, err |
| 4635 | } |
| 4636 | req.Header = reqHeaders |
| 4637 | googleapi.Expand(req.URL, map[string]string{ |
| 4638 | "name": c.name, |
| 4639 | }) |
| 4640 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.updateSettings", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 4641 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4642 | } |
| 4643 | |
| 4644 | // Do executes the "health.users.updateSettings" call. |
| 4645 | // Any non-2xx status code is an error. Response headers are in either |
| 4646 | // *Settings.ServerResponse.Header or (if a response was returned at all) in |
| 4647 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4648 | // whether the returned error was because http.StatusNotModified was returned. |
| 4649 | func (c *UsersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { |
| 4650 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4651 | res, err := c.doRequest("json") |
| 4652 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4653 | if res.Body != nil { |
| 4654 | res.Body.Close() |
| 4655 | } |
| 4656 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4657 | Code: res.StatusCode, |
| 4658 | Header: res.Header, |
| 4659 | }) |
| 4660 | } |
| 4661 | if err != nil { |
| 4662 | return nil, err |
| 4663 | } |
| 4664 | defer googleapi.CloseBody(res) |
| 4665 | if err := googleapi.CheckResponse(res); err != nil { |
| 4666 | return nil, gensupport.WrapError(err) |
| 4667 | } |
| 4668 | ret := &Settings{ |
| 4669 | ServerResponse: googleapi.ServerResponse{ |
| 4670 | Header: res.Header, |
| 4671 | HTTPStatusCode: res.StatusCode, |
| 4672 | }, |
| 4673 | } |
| 4674 | target := &ret |
| 4675 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4676 | if err != nil { |
| 4677 | return nil, err |
| 4678 | } |
| 4679 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.updateSettings", "response", internallog.HTTPResponse(res, b)) |
| 4680 | return ret, nil |
| 4681 | } |
| 4682 | |
| 4683 | type UsersDataTypesDataPointsBatchDeleteCall struct { |
| 4684 | s *Service |
| 4685 | parent string |
| 4686 | batchdeletedatapointsrequest *BatchDeleteDataPointsRequest |
| 4687 | urlParams_ gensupport.URLParams |
| 4688 | ctx_ context.Context |
| 4689 | header_ http.Header |
| 4690 | } |
| 4691 | |
| 4692 | // BatchDelete: Delete a batch of identifyable data points. |
| 4693 | // |
| 4694 | // - parent: Optional. Parent (data type) for the Data Point collection Format: |
| 4695 | // `users/me/dataTypes/{data_type}`, e.g.: - `users/me/dataTypes/steps` - |
| 4696 | // `users/me/dataTypes/-` For a list of the supported data types see the |
| 4697 | // DataPoint data union field. Deleting data points across multiple data type |
| 4698 | // collections is supported following https://aip.dev/159. If this is set, |
| 4699 | // the parent of all of the data points specified in `names` must match this |
| 4700 | // field. |
| 4701 | func (r *UsersDataTypesDataPointsService) BatchDelete(parent string, batchdeletedatapointsrequest *BatchDeleteDataPointsRequest) *UsersDataTypesDataPointsBatchDeleteCall { |
| 4702 | c := &UsersDataTypesDataPointsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4703 | c.parent = parent |
| 4704 | c.batchdeletedatapointsrequest = batchdeletedatapointsrequest |
| 4705 | return c |
| 4706 | } |
| 4707 | |
| 4708 | // Fields allows partial responses to be retrieved. See |
| 4709 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4710 | // details. |
| 4711 | func (c *UsersDataTypesDataPointsBatchDeleteCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsBatchDeleteCall { |
| 4712 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4713 | return c |
| 4714 | } |
| 4715 | |
| 4716 | // Context sets the context to be used in this call's Do method. |
| 4717 | func (c *UsersDataTypesDataPointsBatchDeleteCall) Context(ctx context.Context) *UsersDataTypesDataPointsBatchDeleteCall { |
| 4718 | c.ctx_ = ctx |
| 4719 | return c |
| 4720 | } |
| 4721 | |
| 4722 | // Header returns a http.Header that can be modified by the caller to add |
| 4723 | // headers to the request. |
| 4724 | func (c *UsersDataTypesDataPointsBatchDeleteCall) Header() http.Header { |
| 4725 | if c.header_ == nil { |
| 4726 | c.header_ = make(http.Header) |
| 4727 | } |
| 4728 | return c.header_ |
| 4729 | } |
| 4730 | |
| 4731 | func (c *UsersDataTypesDataPointsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { |
| 4732 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 4733 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchdeletedatapointsrequest) |
| 4734 | if err != nil { |
| 4735 | return nil, err |
| 4736 | } |
| 4737 | c.urlParams_.Set("alt", alt) |
| 4738 | c.urlParams_.Set("prettyPrint", "false") |
| 4739 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/dataPoints:batchDelete") |
| 4740 | urls += "?" + c.urlParams_.Encode() |
| 4741 | req, err := http.NewRequest("POST", urls, body) |
| 4742 | if err != nil { |
| 4743 | return nil, err |
| 4744 | } |
| 4745 | req.Header = reqHeaders |
| 4746 | googleapi.Expand(req.URL, map[string]string{ |
| 4747 | "parent": c.parent, |
| 4748 | }) |
| 4749 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.batchDelete", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 4750 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4751 | } |
| 4752 | |
| 4753 | // Do executes the "health.users.dataTypes.dataPoints.batchDelete" call. |
| 4754 | // Any non-2xx status code is an error. Response headers are in either |
| 4755 | // *Operation.ServerResponse.Header or (if a response was returned at all) in |
| 4756 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4757 | // whether the returned error was because http.StatusNotModified was returned. |
| 4758 | func (c *UsersDataTypesDataPointsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { |
| 4759 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4760 | res, err := c.doRequest("json") |
| 4761 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4762 | if res.Body != nil { |
| 4763 | res.Body.Close() |
| 4764 | } |
| 4765 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4766 | Code: res.StatusCode, |
| 4767 | Header: res.Header, |
| 4768 | }) |
| 4769 | } |
| 4770 | if err != nil { |
| 4771 | return nil, err |
| 4772 | } |
| 4773 | defer googleapi.CloseBody(res) |
| 4774 | if err := googleapi.CheckResponse(res); err != nil { |
| 4775 | return nil, gensupport.WrapError(err) |
| 4776 | } |
| 4777 | ret := &Operation{ |
| 4778 | ServerResponse: googleapi.ServerResponse{ |
| 4779 | Header: res.Header, |
| 4780 | HTTPStatusCode: res.StatusCode, |
| 4781 | }, |
| 4782 | } |
| 4783 | target := &ret |
| 4784 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4785 | if err != nil { |
| 4786 | return nil, err |
| 4787 | } |
| 4788 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.batchDelete", "response", internallog.HTTPResponse(res, b)) |
| 4789 | return ret, nil |
| 4790 | } |
| 4791 | |
| 4792 | type UsersDataTypesDataPointsCreateCall struct { |
| 4793 | s *Service |
| 4794 | parent string |
| 4795 | datapoint *DataPoint |
| 4796 | urlParams_ gensupport.URLParams |
| 4797 | ctx_ context.Context |
| 4798 | header_ http.Header |
| 4799 | } |
| 4800 | |
| 4801 | // Create: Creates a single identifiable data point. |
| 4802 | // |
| 4803 | // - parent: The parent resource name where the data point will be created. |
| 4804 | // Format: `users/{user}/dataTypes/{data_type}`. |
| 4805 | func (r *UsersDataTypesDataPointsService) Create(parent string, datapoint *DataPoint) *UsersDataTypesDataPointsCreateCall { |
| 4806 | c := &UsersDataTypesDataPointsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4807 | c.parent = parent |
| 4808 | c.datapoint = datapoint |
| 4809 | return c |
| 4810 | } |
| 4811 | |
| 4812 | // Fields allows partial responses to be retrieved. See |
| 4813 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4814 | // details. |
| 4815 | func (c *UsersDataTypesDataPointsCreateCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsCreateCall { |
| 4816 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4817 | return c |
| 4818 | } |
| 4819 | |
| 4820 | // Context sets the context to be used in this call's Do method. |
| 4821 | func (c *UsersDataTypesDataPointsCreateCall) Context(ctx context.Context) *UsersDataTypesDataPointsCreateCall { |
| 4822 | c.ctx_ = ctx |
| 4823 | return c |
| 4824 | } |
| 4825 | |
| 4826 | // Header returns a http.Header that can be modified by the caller to add |
| 4827 | // headers to the request. |
| 4828 | func (c *UsersDataTypesDataPointsCreateCall) Header() http.Header { |
| 4829 | if c.header_ == nil { |
| 4830 | c.header_ = make(http.Header) |
| 4831 | } |
| 4832 | return c.header_ |
| 4833 | } |
| 4834 | |
| 4835 | func (c *UsersDataTypesDataPointsCreateCall) doRequest(alt string) (*http.Response, error) { |
| 4836 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 4837 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datapoint) |
| 4838 | if err != nil { |
| 4839 | return nil, err |
| 4840 | } |
| 4841 | c.urlParams_.Set("alt", alt) |
| 4842 | c.urlParams_.Set("prettyPrint", "false") |
| 4843 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/dataPoints") |
| 4844 | urls += "?" + c.urlParams_.Encode() |
| 4845 | req, err := http.NewRequest("POST", urls, body) |
| 4846 | if err != nil { |
| 4847 | return nil, err |
| 4848 | } |
| 4849 | req.Header = reqHeaders |
| 4850 | googleapi.Expand(req.URL, map[string]string{ |
| 4851 | "parent": c.parent, |
| 4852 | }) |
| 4853 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.create", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 4854 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4855 | } |
| 4856 | |
| 4857 | // Do executes the "health.users.dataTypes.dataPoints.create" call. |
| 4858 | // Any non-2xx status code is an error. Response headers are in either |
| 4859 | // *Operation.ServerResponse.Header or (if a response was returned at all) in |
| 4860 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 4861 | // whether the returned error was because http.StatusNotModified was returned. |
| 4862 | func (c *UsersDataTypesDataPointsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { |
| 4863 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4864 | res, err := c.doRequest("json") |
| 4865 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4866 | if res.Body != nil { |
| 4867 | res.Body.Close() |
| 4868 | } |
| 4869 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4870 | Code: res.StatusCode, |
| 4871 | Header: res.Header, |
| 4872 | }) |
| 4873 | } |
| 4874 | if err != nil { |
| 4875 | return nil, err |
| 4876 | } |
| 4877 | defer googleapi.CloseBody(res) |
| 4878 | if err := googleapi.CheckResponse(res); err != nil { |
| 4879 | return nil, gensupport.WrapError(err) |
| 4880 | } |
| 4881 | ret := &Operation{ |
| 4882 | ServerResponse: googleapi.ServerResponse{ |
| 4883 | Header: res.Header, |
| 4884 | HTTPStatusCode: res.StatusCode, |
| 4885 | }, |
| 4886 | } |
| 4887 | target := &ret |
| 4888 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4889 | if err != nil { |
| 4890 | return nil, err |
| 4891 | } |
| 4892 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.create", "response", internallog.HTTPResponse(res, b)) |
| 4893 | return ret, nil |
| 4894 | } |
| 4895 | |
| 4896 | type UsersDataTypesDataPointsDailyRollUpCall struct { |
| 4897 | s *Service |
| 4898 | parent string |
| 4899 | dailyrollupdatapointsrequest *DailyRollUpDataPointsRequest |
| 4900 | urlParams_ gensupport.URLParams |
| 4901 | ctx_ context.Context |
| 4902 | header_ http.Header |
| 4903 | } |
| 4904 | |
| 4905 | // DailyRollUp: Roll up data points over civil time intervals for supported |
| 4906 | // data types. |
| 4907 | // |
| 4908 | // - parent: Parent data type of the Data Point collection. Format: |
| 4909 | // `users/{user}/dataTypes/{data_type}`, e.g.: - `users/me/dataTypes/steps` - |
| 4910 | // `users/me/dataTypes/distance` For a list of the supported data types see |
| 4911 | // the DailyRollupDataPoint value union field. |
| 4912 | func (r *UsersDataTypesDataPointsService) DailyRollUp(parent string, dailyrollupdatapointsrequest *DailyRollUpDataPointsRequest) *UsersDataTypesDataPointsDailyRollUpCall { |
| 4913 | c := &UsersDataTypesDataPointsDailyRollUpCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 4914 | c.parent = parent |
| 4915 | c.dailyrollupdatapointsrequest = dailyrollupdatapointsrequest |
| 4916 | return c |
| 4917 | } |
| 4918 | |
| 4919 | // Fields allows partial responses to be retrieved. See |
| 4920 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 4921 | // details. |
| 4922 | func (c *UsersDataTypesDataPointsDailyRollUpCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsDailyRollUpCall { |
| 4923 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 4924 | return c |
| 4925 | } |
| 4926 | |
| 4927 | // Context sets the context to be used in this call's Do method. |
| 4928 | func (c *UsersDataTypesDataPointsDailyRollUpCall) Context(ctx context.Context) *UsersDataTypesDataPointsDailyRollUpCall { |
| 4929 | c.ctx_ = ctx |
| 4930 | return c |
| 4931 | } |
| 4932 | |
| 4933 | // Header returns a http.Header that can be modified by the caller to add |
| 4934 | // headers to the request. |
| 4935 | func (c *UsersDataTypesDataPointsDailyRollUpCall) Header() http.Header { |
| 4936 | if c.header_ == nil { |
| 4937 | c.header_ = make(http.Header) |
| 4938 | } |
| 4939 | return c.header_ |
| 4940 | } |
| 4941 | |
| 4942 | func (c *UsersDataTypesDataPointsDailyRollUpCall) doRequest(alt string) (*http.Response, error) { |
| 4943 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 4944 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.dailyrollupdatapointsrequest) |
| 4945 | if err != nil { |
| 4946 | return nil, err |
| 4947 | } |
| 4948 | c.urlParams_.Set("alt", alt) |
| 4949 | c.urlParams_.Set("prettyPrint", "false") |
| 4950 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/dataPoints:dailyRollUp") |
| 4951 | urls += "?" + c.urlParams_.Encode() |
| 4952 | req, err := http.NewRequest("POST", urls, body) |
| 4953 | if err != nil { |
| 4954 | return nil, err |
| 4955 | } |
| 4956 | req.Header = reqHeaders |
| 4957 | googleapi.Expand(req.URL, map[string]string{ |
| 4958 | "parent": c.parent, |
| 4959 | }) |
| 4960 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.dailyRollUp", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 4961 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 4962 | } |
| 4963 | |
| 4964 | // Do executes the "health.users.dataTypes.dataPoints.dailyRollUp" call. |
| 4965 | // Any non-2xx status code is an error. Response headers are in either |
| 4966 | // *DailyRollUpDataPointsResponse.ServerResponse.Header or (if a response was |
| 4967 | // returned at all) in error.(*googleapi.Error).Header. Use |
| 4968 | // googleapi.IsNotModified to check whether the returned error was because |
| 4969 | // http.StatusNotModified was returned. |
| 4970 | func (c *UsersDataTypesDataPointsDailyRollUpCall) Do(opts ...googleapi.CallOption) (*DailyRollUpDataPointsResponse, error) { |
| 4971 | gensupport.SetOptions(c.urlParams_, opts...) |
| 4972 | res, err := c.doRequest("json") |
| 4973 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 4974 | if res.Body != nil { |
| 4975 | res.Body.Close() |
| 4976 | } |
| 4977 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 4978 | Code: res.StatusCode, |
| 4979 | Header: res.Header, |
| 4980 | }) |
| 4981 | } |
| 4982 | if err != nil { |
| 4983 | return nil, err |
| 4984 | } |
| 4985 | defer googleapi.CloseBody(res) |
| 4986 | if err := googleapi.CheckResponse(res); err != nil { |
| 4987 | return nil, gensupport.WrapError(err) |
| 4988 | } |
| 4989 | ret := &DailyRollUpDataPointsResponse{ |
| 4990 | ServerResponse: googleapi.ServerResponse{ |
| 4991 | Header: res.Header, |
| 4992 | HTTPStatusCode: res.StatusCode, |
| 4993 | }, |
| 4994 | } |
| 4995 | target := &ret |
| 4996 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 4997 | if err != nil { |
| 4998 | return nil, err |
| 4999 | } |
| 5000 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.dailyRollUp", "response", internallog.HTTPResponse(res, b)) |
| 5001 | return ret, nil |
| 5002 | } |
| 5003 | |
| 5004 | type UsersDataTypesDataPointsExportExerciseTcxCall struct { |
| 5005 | s *Service |
| 5006 | name string |
| 5007 | urlParams_ gensupport.URLParams |
| 5008 | ifNoneMatch_ string |
| 5009 | ctx_ context.Context |
| 5010 | header_ http.Header |
| 5011 | } |
| 5012 | |
| 5013 | // ExportExerciseTcx: Exports exercise data in TCX format. Note: While the |
| 5014 | // Authorization section below states that any one of the listed scopes is |
| 5015 | // accepted, this specific method requires the user to provide both one of the |
| 5016 | // `activity_and_fitness` scopes (`normal` or `readonly`) AND one of the |
| 5017 | // `location` scopes (`normal` or `readonly`) in their access token to succeed. |
| 5018 | // |
| 5019 | // - name: The resource name of the exercise data point to export. Format: |
| 5020 | // `users/{user}/dataTypes/exercise/dataPoints/{data_point}` Example: |
| 5021 | // `users/me/dataTypes/exercise/dataPoints/2026443605080188808` The `{user}` |
| 5022 | // is the alias "me" currently. Future versions may support user IDs. The |
| 5023 | // `{data_point}` ID maps to the exercise ID, which is a long integer. |
| 5024 | func (r *UsersDataTypesDataPointsService) ExportExerciseTcx(name string) *UsersDataTypesDataPointsExportExerciseTcxCall { |
| 5025 | c := &UsersDataTypesDataPointsExportExerciseTcxCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 5026 | c.name = name |
| 5027 | return c |
| 5028 | } |
| 5029 | |
| 5030 | // PartialData sets the optional parameter "partialData": Indicates whether to |
| 5031 | // include the TCX data points when the GPS data is not available. If not |
| 5032 | // specified, defaults to `false` and partial data will not be included. |
| 5033 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) PartialData(partialData bool) *UsersDataTypesDataPointsExportExerciseTcxCall { |
| 5034 | c.urlParams_.Set("partialData", fmt.Sprint(partialData)) |
| 5035 | return c |
| 5036 | } |
| 5037 | |
| 5038 | // Fields allows partial responses to be retrieved. See |
| 5039 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 5040 | // details. |
| 5041 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsExportExerciseTcxCall { |
| 5042 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 5043 | return c |
| 5044 | } |
| 5045 | |
| 5046 | // IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 5047 | // object's ETag matches the given value. This is useful for getting updates |
| 5048 | // only after the object has changed since the last request. |
| 5049 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) IfNoneMatch(entityTag string) *UsersDataTypesDataPointsExportExerciseTcxCall { |
| 5050 | c.ifNoneMatch_ = entityTag |
| 5051 | return c |
| 5052 | } |
| 5053 | |
| 5054 | // Context sets the context to be used in this call's Do and Download methods. |
| 5055 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) Context(ctx context.Context) *UsersDataTypesDataPointsExportExerciseTcxCall { |
| 5056 | c.ctx_ = ctx |
| 5057 | return c |
| 5058 | } |
| 5059 | |
| 5060 | // Header returns a http.Header that can be modified by the caller to add |
| 5061 | // headers to the request. |
| 5062 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) Header() http.Header { |
| 5063 | if c.header_ == nil { |
| 5064 | c.header_ = make(http.Header) |
| 5065 | } |
| 5066 | return c.header_ |
| 5067 | } |
| 5068 | |
| 5069 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) doRequest(alt string) (*http.Response, error) { |
| 5070 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 5071 | if c.ifNoneMatch_ != "" { |
| 5072 | reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 5073 | } |
| 5074 | c.urlParams_.Set("alt", alt) |
| 5075 | c.urlParams_.Set("prettyPrint", "false") |
| 5076 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}:exportExerciseTcx") |
| 5077 | urls += "?" + c.urlParams_.Encode() |
| 5078 | req, err := http.NewRequest("GET", urls, nil) |
| 5079 | if err != nil { |
| 5080 | return nil, err |
| 5081 | } |
| 5082 | req.Header = reqHeaders |
| 5083 | googleapi.Expand(req.URL, map[string]string{ |
| 5084 | "name": c.name, |
| 5085 | }) |
| 5086 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.exportExerciseTcx", "request", internallog.HTTPRequest(req, nil)) |
| 5087 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 5088 | } |
| 5089 | |
| 5090 | // Download fetches the API endpoint's "media" value, instead of the normal |
| 5091 | // API response value. If the returned error is nil, the Response is guaranteed to |
| 5092 | // have a 2xx status code. Callers must close the Response.Body as usual. |
| 5093 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { |
| 5094 | gensupport.SetOptions(c.urlParams_, opts...) |
| 5095 | res, err := c.doRequest("media") |
| 5096 | if err != nil { |
| 5097 | return nil, err |
| 5098 | } |
| 5099 | if err := googleapi.CheckResponse(res); err != nil { |
| 5100 | res.Body.Close() |
| 5101 | return nil, gensupport.WrapError(err) |
| 5102 | } |
| 5103 | return res, nil |
| 5104 | } |
| 5105 | |
| 5106 | // Do executes the "health.users.dataTypes.dataPoints.exportExerciseTcx" call. |
| 5107 | // Any non-2xx status code is an error. Response headers are in either |
| 5108 | // *ExportExerciseTcxResponse.ServerResponse.Header or (if a response was |
| 5109 | // returned at all) in error.(*googleapi.Error).Header. Use |
| 5110 | // googleapi.IsNotModified to check whether the returned error was because |
| 5111 | // http.StatusNotModified was returned. |
| 5112 | func (c *UsersDataTypesDataPointsExportExerciseTcxCall) Do(opts ...googleapi.CallOption) (*ExportExerciseTcxResponse, error) { |
| 5113 | gensupport.SetOptions(c.urlParams_, opts...) |
| 5114 | res, err := c.doRequest("json") |
| 5115 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 5116 | if res.Body != nil { |
| 5117 | res.Body.Close() |
| 5118 | } |
| 5119 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 5120 | Code: res.StatusCode, |
| 5121 | Header: res.Header, |
| 5122 | }) |
| 5123 | } |
| 5124 | if err != nil { |
| 5125 | return nil, err |
| 5126 | } |
| 5127 | defer googleapi.CloseBody(res) |
| 5128 | if err := googleapi.CheckResponse(res); err != nil { |
| 5129 | return nil, gensupport.WrapError(err) |
| 5130 | } |
| 5131 | ret := &ExportExerciseTcxResponse{ |
| 5132 | ServerResponse: googleapi.ServerResponse{ |
| 5133 | Header: res.Header, |
| 5134 | HTTPStatusCode: res.StatusCode, |
| 5135 | }, |
| 5136 | } |
| 5137 | target := &ret |
| 5138 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 5139 | if err != nil { |
| 5140 | return nil, err |
| 5141 | } |
| 5142 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.exportExerciseTcx", "response", internallog.HTTPResponse(res, b)) |
| 5143 | return ret, nil |
| 5144 | } |
| 5145 | |
| 5146 | type UsersDataTypesDataPointsListCall struct { |
| 5147 | s *Service |
| 5148 | parent string |
| 5149 | urlParams_ gensupport.URLParams |
| 5150 | ifNoneMatch_ string |
| 5151 | ctx_ context.Context |
| 5152 | header_ http.Header |
| 5153 | } |
| 5154 | |
| 5155 | // List: Query user health and fitness data points. |
| 5156 | // |
| 5157 | // - parent: Parent data type of the Data Point collection. Format: |
| 5158 | // `users/me/dataTypes/{data_type}`, e.g.: - `users/me/dataTypes/steps` - |
| 5159 | // `users/me/dataTypes/weight` For a list of the supported data types see the |
| 5160 | // DataPoint data union field. |
| 5161 | func (r *UsersDataTypesDataPointsService) List(parent string) *UsersDataTypesDataPointsListCall { |
| 5162 | c := &UsersDataTypesDataPointsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 5163 | c.parent = parent |
| 5164 | return c |
| 5165 | } |
| 5166 | |
| 5167 | // Filter sets the optional parameter "filter": Filter expression following |
| 5168 | // https://google.aip.dev/160. A time range (either physical or civil) can be |
| 5169 | // specified. The supported filter fields are: - Interval start time: - |
| 5170 | // Pattern: `{interval_data_type}.interval.start_time` - Supported comparison |
| 5171 | // operators: `>=`, `<` - Timestamp literal expected in RFC-3339 format - |
| 5172 | // Supported logical operators: `AND` - Example: - `steps.interval.start_time |
| 5173 | // >= "2023-11-24T00:00:00Z" AND steps.interval.start_time < |
| 5174 | // "2023-11-25T00:00:00Z" - `distance.interval.start_time >= |
| 5175 | // "2024-08-14T12:34:56Z" - Interval civil start time: - Pattern: |
| 5176 | // `{interval_data_type}.interval.civil_start_time` - Supported comparison |
| 5177 | // operators: `>=`, `<` - Date with optional time literal expected in ISO 8601 |
| 5178 | // `YYYY-MM-DD[THH:mm:ss]` format - Supported logical operators: `AND` - |
| 5179 | // Example: - `steps.interval.civil_start_time >= "2023-11-24" AND |
| 5180 | // steps.interval.civil_start_time < "2023-11-25" - |
| 5181 | // `distance.interval.civil_start_time >= "2024-08-14T12:34:56" - Sample |
| 5182 | // observation physical time: - Pattern: |
| 5183 | // `{sample_data_type}.sample_time.physical_time` - Supported comparison |
| 5184 | // operators: `>=`, `<` - Timestamp literal expected in RFC-3339 format - |
| 5185 | // Supported logical operators: `AND` - Example: - |
| 5186 | // `weight.sample_time.physical_time >= "2023-11-24T00:00:00Z" AND |
| 5187 | // weight.sample_time.physical_time < "2023-11-25T00:00:00Z" - |
| 5188 | // `weight.sample_time.physical_time >= "2024-08-14T12:34:56Z" - Sample |
| 5189 | // observation civil time: - Pattern: |
| 5190 | // `{sample_data_type}.sample_time.civil_time` - Supported comparison |
| 5191 | // operators: `>=`, `<` - Date with optional time literal expected in ISO 8601 |
| 5192 | // `YYYY-MM-DD[THH:mm:ss]` format - Supported logical operators: `AND` - |
| 5193 | // Example: - `weight.sample_time.civil_time >= "2023-11-24" AND |
| 5194 | // weight.sample_time.civil_time < "2023-11-25" - |
| 5195 | // `weight.sample_time.civil_time >= "2024-08-14T12:34:56" - Daily summary |
| 5196 | // date: - Pattern: `{daily_summary_data_type}.date` - Supported comparison |
| 5197 | // operators: `>=`, `<` - Date literal expected in ISO 8601 `YYYY-MM-DD` format |
| 5198 | // - Supported logical operators: `AND` - Example: - |
| 5199 | // `daily_resting_heart_rate.date >= "2024-08-14" - |
| 5200 | // `daily_heart_rate_variability.date < "2024-08-15" - Session civil start |
| 5201 | // time (**Excluding Sleep**): - Pattern: |
| 5202 | // `{session_data_type}.interval.civil_start_time` - Supported comparison |
| 5203 | // operators: `>=`, `<` - Date with optional time literal expected in ISO 8601 |
| 5204 | // `YYYY-MM-DD[THH:mm:ss]` format - Supported logical operators: `AND` - |
| 5205 | // Example: - `exercise.interval.civil_start_time >= "2023-11-24" AND |
| 5206 | // exercise.interval.civil_start_time < "2023-11-25" - |
| 5207 | // `exercise.interval.civil_start_time >= "2024-08-14T12:34:56" - Session end |
| 5208 | // time (**Sleep specific**): - Pattern: `sleep.interval.end_time` - Supported |
| 5209 | // comparison operators: `>=`, `<` - Timestamp literal expected in RFC-3339 |
| 5210 | // format - Supported logical operators: `AND`, `OR` - Example: - |
| 5211 | // `sleep.interval.end_time >= "2023-11-24T00:00:00Z" AND |
| 5212 | // sleep.interval.end_time < "2023-11-25T00:00:00Z" - Session civil end time |
| 5213 | // (**Sleep specific**): - Pattern: `sleep.interval.civil_end_time` - Supported |
| 5214 | // comparison operators: `>=`, `<` - Date with optional time literal expected |
| 5215 | // in ISO 8601 `YYYY-MM-DD[THH:mm:ss]` format - Supported logical operators: |
| 5216 | // `AND`, `OR` - Example: - `sleep.interval.civil_end_time >= "2023-11-24" AND |
| 5217 | // sleep.interval.civil_end_time < "2023-11-25" Data points in the response |
| 5218 | // will be ordered by the interval start time in descending order. |
| 5219 | func (c *UsersDataTypesDataPointsListCall) Filter(filter string) *UsersDataTypesDataPointsListCall { |
| 5220 | c.urlParams_.Set("filter", filter) |
| 5221 | return c |
| 5222 | } |
| 5223 | |
| 5224 | // PageSize sets the optional parameter "pageSize": The maximum number of data |
| 5225 | // points to return. If unspecified, at most 1440 data points will be returned. |
| 5226 | // The maximum page size is 10000; values above that will be truncated |
| 5227 | // accordingly. For `exercise` and `sleep` the default page size is 25. The |
| 5228 | // maximum page size for `exercise` and `sleep` is 25. |
| 5229 | func (c *UsersDataTypesDataPointsListCall) PageSize(pageSize int64) *UsersDataTypesDataPointsListCall { |
| 5230 | c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 5231 | return c |
| 5232 | } |
| 5233 | |
| 5234 | // PageToken sets the optional parameter "pageToken": The `next_page_token` |
| 5235 | // from a previous request, if any. |
| 5236 | func (c *UsersDataTypesDataPointsListCall) PageToken(pageToken string) *UsersDataTypesDataPointsListCall { |
| 5237 | c.urlParams_.Set("pageToken", pageToken) |
| 5238 | return c |
| 5239 | } |
| 5240 | |
| 5241 | // Fields allows partial responses to be retrieved. See |
| 5242 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 5243 | // details. |
| 5244 | func (c *UsersDataTypesDataPointsListCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsListCall { |
| 5245 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 5246 | return c |
| 5247 | } |
| 5248 | |
| 5249 | // IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 5250 | // object's ETag matches the given value. This is useful for getting updates |
| 5251 | // only after the object has changed since the last request. |
| 5252 | func (c *UsersDataTypesDataPointsListCall) IfNoneMatch(entityTag string) *UsersDataTypesDataPointsListCall { |
| 5253 | c.ifNoneMatch_ = entityTag |
| 5254 | return c |
| 5255 | } |
| 5256 | |
| 5257 | // Context sets the context to be used in this call's Do method. |
| 5258 | func (c *UsersDataTypesDataPointsListCall) Context(ctx context.Context) *UsersDataTypesDataPointsListCall { |
| 5259 | c.ctx_ = ctx |
| 5260 | return c |
| 5261 | } |
| 5262 | |
| 5263 | // Header returns a http.Header that can be modified by the caller to add |
| 5264 | // headers to the request. |
| 5265 | func (c *UsersDataTypesDataPointsListCall) Header() http.Header { |
| 5266 | if c.header_ == nil { |
| 5267 | c.header_ = make(http.Header) |
| 5268 | } |
| 5269 | return c.header_ |
| 5270 | } |
| 5271 | |
| 5272 | func (c *UsersDataTypesDataPointsListCall) doRequest(alt string) (*http.Response, error) { |
| 5273 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 5274 | if c.ifNoneMatch_ != "" { |
| 5275 | reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 5276 | } |
| 5277 | c.urlParams_.Set("alt", alt) |
| 5278 | c.urlParams_.Set("prettyPrint", "false") |
| 5279 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/dataPoints") |
| 5280 | urls += "?" + c.urlParams_.Encode() |
| 5281 | req, err := http.NewRequest("GET", urls, nil) |
| 5282 | if err != nil { |
| 5283 | return nil, err |
| 5284 | } |
| 5285 | req.Header = reqHeaders |
| 5286 | googleapi.Expand(req.URL, map[string]string{ |
| 5287 | "parent": c.parent, |
| 5288 | }) |
| 5289 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.list", "request", internallog.HTTPRequest(req, nil)) |
| 5290 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 5291 | } |
| 5292 | |
| 5293 | // Do executes the "health.users.dataTypes.dataPoints.list" call. |
| 5294 | // Any non-2xx status code is an error. Response headers are in either |
| 5295 | // *ListDataPointsResponse.ServerResponse.Header or (if a response was returned |
| 5296 | // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to |
| 5297 | // check whether the returned error was because http.StatusNotModified was |
| 5298 | // returned. |
| 5299 | func (c *UsersDataTypesDataPointsListCall) Do(opts ...googleapi.CallOption) (*ListDataPointsResponse, error) { |
| 5300 | gensupport.SetOptions(c.urlParams_, opts...) |
| 5301 | res, err := c.doRequest("json") |
| 5302 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 5303 | if res.Body != nil { |
| 5304 | res.Body.Close() |
| 5305 | } |
| 5306 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 5307 | Code: res.StatusCode, |
| 5308 | Header: res.Header, |
| 5309 | }) |
| 5310 | } |
| 5311 | if err != nil { |
| 5312 | return nil, err |
| 5313 | } |
| 5314 | defer googleapi.CloseBody(res) |
| 5315 | if err := googleapi.CheckResponse(res); err != nil { |
| 5316 | return nil, gensupport.WrapError(err) |
| 5317 | } |
| 5318 | ret := &ListDataPointsResponse{ |
| 5319 | ServerResponse: googleapi.ServerResponse{ |
| 5320 | Header: res.Header, |
| 5321 | HTTPStatusCode: res.StatusCode, |
| 5322 | }, |
| 5323 | } |
| 5324 | target := &ret |
| 5325 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 5326 | if err != nil { |
| 5327 | return nil, err |
| 5328 | } |
| 5329 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.list", "response", internallog.HTTPResponse(res, b)) |
| 5330 | return ret, nil |
| 5331 | } |
| 5332 | |
| 5333 | // Pages invokes f for each page of results. |
| 5334 | // A non-nil error returned from f will halt the iteration. |
| 5335 | // The provided context supersedes any context provided to the Context method. |
| 5336 | func (c *UsersDataTypesDataPointsListCall) Pages(ctx context.Context, f func(*ListDataPointsResponse) error) error { |
| 5337 | c.ctx_ = ctx |
| 5338 | defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 5339 | for { |
| 5340 | x, err := c.Do() |
| 5341 | if err != nil { |
| 5342 | return err |
| 5343 | } |
| 5344 | if err := f(x); err != nil { |
| 5345 | return err |
| 5346 | } |
| 5347 | if x.NextPageToken == "" { |
| 5348 | return nil |
| 5349 | } |
| 5350 | c.PageToken(x.NextPageToken) |
| 5351 | } |
| 5352 | } |
| 5353 | |
| 5354 | type UsersDataTypesDataPointsPatchCall struct { |
| 5355 | s *Service |
| 5356 | nameid string |
| 5357 | datapoint *DataPoint |
| 5358 | urlParams_ gensupport.URLParams |
| 5359 | ctx_ context.Context |
| 5360 | header_ http.Header |
| 5361 | } |
| 5362 | |
| 5363 | // Patch: Updates a single identifiable data point. If a data point with the |
| 5364 | // specified `name` is not found, the request will fail. |
| 5365 | // |
| 5366 | // - name: Identifier. Data point name, only supported for the subset of |
| 5367 | // identifiable data types. For the majority of the data types, individual |
| 5368 | // data points do not need to be identified and this field would be empty. |
| 5369 | // Format: `users/{user}/dataTypes/{data_type}/dataPoints/{data_point}` |
| 5370 | // Example: |
| 5371 | // `users/abcd1234/dataTypes/sleep/dataPoints/a1b2c3d4-e5f6-7890-1234-567890ab |
| 5372 | // cdef` The `{user}` ID is a system-generated identifier, as described in |
| 5373 | // Identity.health_user_id. The `{data_type}` ID corresponds to the |
| 5374 | // kebab-case version of the field names in the DataPoint data union field, |
| 5375 | // e.g. `total-calories` for the `total_calories` field. The `{data_point}` |
| 5376 | // ID can be client-provided or system-generated. If client-provided, it must |
| 5377 | // be a string of 4-63 characters, containing only lowercase letters, |
| 5378 | // numbers, and hyphens. |
| 5379 | func (r *UsersDataTypesDataPointsService) Patch(nameid string, datapoint *DataPoint) *UsersDataTypesDataPointsPatchCall { |
| 5380 | c := &UsersDataTypesDataPointsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 5381 | c.nameid = nameid |
| 5382 | c.datapoint = datapoint |
| 5383 | return c |
| 5384 | } |
| 5385 | |
| 5386 | // Fields allows partial responses to be retrieved. See |
| 5387 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 5388 | // details. |
| 5389 | func (c *UsersDataTypesDataPointsPatchCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsPatchCall { |
| 5390 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 5391 | return c |
| 5392 | } |
| 5393 | |
| 5394 | // Context sets the context to be used in this call's Do method. |
| 5395 | func (c *UsersDataTypesDataPointsPatchCall) Context(ctx context.Context) *UsersDataTypesDataPointsPatchCall { |
| 5396 | c.ctx_ = ctx |
| 5397 | return c |
| 5398 | } |
| 5399 | |
| 5400 | // Header returns a http.Header that can be modified by the caller to add |
| 5401 | // headers to the request. |
| 5402 | func (c *UsersDataTypesDataPointsPatchCall) Header() http.Header { |
| 5403 | if c.header_ == nil { |
| 5404 | c.header_ = make(http.Header) |
| 5405 | } |
| 5406 | return c.header_ |
| 5407 | } |
| 5408 | |
| 5409 | func (c *UsersDataTypesDataPointsPatchCall) doRequest(alt string) (*http.Response, error) { |
| 5410 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 5411 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datapoint) |
| 5412 | if err != nil { |
| 5413 | return nil, err |
| 5414 | } |
| 5415 | c.urlParams_.Set("alt", alt) |
| 5416 | c.urlParams_.Set("prettyPrint", "false") |
| 5417 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+name}") |
| 5418 | urls += "?" + c.urlParams_.Encode() |
| 5419 | req, err := http.NewRequest("PATCH", urls, body) |
| 5420 | if err != nil { |
| 5421 | return nil, err |
| 5422 | } |
| 5423 | req.Header = reqHeaders |
| 5424 | googleapi.Expand(req.URL, map[string]string{ |
| 5425 | "name": c.nameid, |
| 5426 | }) |
| 5427 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.patch", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 5428 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 5429 | } |
| 5430 | |
| 5431 | // Do executes the "health.users.dataTypes.dataPoints.patch" call. |
| 5432 | // Any non-2xx status code is an error. Response headers are in either |
| 5433 | // *Operation.ServerResponse.Header or (if a response was returned at all) in |
| 5434 | // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 5435 | // whether the returned error was because http.StatusNotModified was returned. |
| 5436 | func (c *UsersDataTypesDataPointsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { |
| 5437 | gensupport.SetOptions(c.urlParams_, opts...) |
| 5438 | res, err := c.doRequest("json") |
| 5439 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 5440 | if res.Body != nil { |
| 5441 | res.Body.Close() |
| 5442 | } |
| 5443 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 5444 | Code: res.StatusCode, |
| 5445 | Header: res.Header, |
| 5446 | }) |
| 5447 | } |
| 5448 | if err != nil { |
| 5449 | return nil, err |
| 5450 | } |
| 5451 | defer googleapi.CloseBody(res) |
| 5452 | if err := googleapi.CheckResponse(res); err != nil { |
| 5453 | return nil, gensupport.WrapError(err) |
| 5454 | } |
| 5455 | ret := &Operation{ |
| 5456 | ServerResponse: googleapi.ServerResponse{ |
| 5457 | Header: res.Header, |
| 5458 | HTTPStatusCode: res.StatusCode, |
| 5459 | }, |
| 5460 | } |
| 5461 | target := &ret |
| 5462 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 5463 | if err != nil { |
| 5464 | return nil, err |
| 5465 | } |
| 5466 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.patch", "response", internallog.HTTPResponse(res, b)) |
| 5467 | return ret, nil |
| 5468 | } |
| 5469 | |
| 5470 | type UsersDataTypesDataPointsReconcileCall struct { |
| 5471 | s *Service |
| 5472 | parent string |
| 5473 | urlParams_ gensupport.URLParams |
| 5474 | ifNoneMatch_ string |
| 5475 | ctx_ context.Context |
| 5476 | header_ http.Header |
| 5477 | } |
| 5478 | |
| 5479 | // Reconcile: Reconcile data points from multiple data sources into a single |
| 5480 | // data stream. |
| 5481 | // |
| 5482 | // - parent: Parent data type of the Data Point collection. Format: |
| 5483 | // `users/me/dataTypes/{data_type}`, e.g.: - `users/me/dataTypes/steps` - |
| 5484 | // `users/me/dataTypes/heart-rate` For a list of the supported data types see |
| 5485 | // the DataPoint data union field. |
| 5486 | func (r *UsersDataTypesDataPointsService) Reconcile(parent string) *UsersDataTypesDataPointsReconcileCall { |
| 5487 | c := &UsersDataTypesDataPointsReconcileCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 5488 | c.parent = parent |
| 5489 | return c |
| 5490 | } |
| 5491 | |
| 5492 | // DataSourceFamily sets the optional parameter "dataSourceFamily": The data |
| 5493 | // source family name to reconcile. If empty, data points from all data sources |
| 5494 | // will be reconciled. Format: |
| 5495 | // `users/me/dataSourceFamilies/{data_source_family}` The supported values are: |
| 5496 | // - `users/me/dataSourceFamilies/all-sources` - default value - |
| 5497 | // `users/me/dataSourceFamilies/google-wearables` - tracker devices - |
| 5498 | // `users/me/dataSourceFamilies/google-sources` - Google first party sources |
| 5499 | func (c *UsersDataTypesDataPointsReconcileCall) DataSourceFamily(dataSourceFamily string) *UsersDataTypesDataPointsReconcileCall { |
| 5500 | c.urlParams_.Set("dataSourceFamily", dataSourceFamily) |
| 5501 | return c |
| 5502 | } |
| 5503 | |
| 5504 | // Filter sets the optional parameter "filter": Filter expression based on |
| 5505 | // https://aip.dev/160. A time range, either physical or civil, can be |
| 5506 | // specified. See the ListDataPointsRequest.filter for the supported fields and |
| 5507 | // syntax. |
| 5508 | func (c *UsersDataTypesDataPointsReconcileCall) Filter(filter string) *UsersDataTypesDataPointsReconcileCall { |
| 5509 | c.urlParams_.Set("filter", filter) |
| 5510 | return c |
| 5511 | } |
| 5512 | |
| 5513 | // PageSize sets the optional parameter "pageSize": The maximum number of data |
| 5514 | // points to return. If unspecified, at most 1440 data points will be returned. |
| 5515 | // The maximum page size is 10000; values above that will be truncated |
| 5516 | // accordingly. For `exercise` and `sleep` the default page size is 25. The |
| 5517 | // maximum page size for `exercise` and `sleep` is 25. |
| 5518 | func (c *UsersDataTypesDataPointsReconcileCall) PageSize(pageSize int64) *UsersDataTypesDataPointsReconcileCall { |
| 5519 | c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 5520 | return c |
| 5521 | } |
| 5522 | |
| 5523 | // PageToken sets the optional parameter "pageToken": The `next_page_token` |
| 5524 | // from a previous request, if any. |
| 5525 | func (c *UsersDataTypesDataPointsReconcileCall) PageToken(pageToken string) *UsersDataTypesDataPointsReconcileCall { |
| 5526 | c.urlParams_.Set("pageToken", pageToken) |
| 5527 | return c |
| 5528 | } |
| 5529 | |
| 5530 | // Fields allows partial responses to be retrieved. See |
| 5531 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 5532 | // details. |
| 5533 | func (c *UsersDataTypesDataPointsReconcileCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsReconcileCall { |
| 5534 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 5535 | return c |
| 5536 | } |
| 5537 | |
| 5538 | // IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 5539 | // object's ETag matches the given value. This is useful for getting updates |
| 5540 | // only after the object has changed since the last request. |
| 5541 | func (c *UsersDataTypesDataPointsReconcileCall) IfNoneMatch(entityTag string) *UsersDataTypesDataPointsReconcileCall { |
| 5542 | c.ifNoneMatch_ = entityTag |
| 5543 | return c |
| 5544 | } |
| 5545 | |
| 5546 | // Context sets the context to be used in this call's Do method. |
| 5547 | func (c *UsersDataTypesDataPointsReconcileCall) Context(ctx context.Context) *UsersDataTypesDataPointsReconcileCall { |
| 5548 | c.ctx_ = ctx |
| 5549 | return c |
| 5550 | } |
| 5551 | |
| 5552 | // Header returns a http.Header that can be modified by the caller to add |
| 5553 | // headers to the request. |
| 5554 | func (c *UsersDataTypesDataPointsReconcileCall) Header() http.Header { |
| 5555 | if c.header_ == nil { |
| 5556 | c.header_ = make(http.Header) |
| 5557 | } |
| 5558 | return c.header_ |
| 5559 | } |
| 5560 | |
| 5561 | func (c *UsersDataTypesDataPointsReconcileCall) doRequest(alt string) (*http.Response, error) { |
| 5562 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 5563 | if c.ifNoneMatch_ != "" { |
| 5564 | reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 5565 | } |
| 5566 | c.urlParams_.Set("alt", alt) |
| 5567 | c.urlParams_.Set("prettyPrint", "false") |
| 5568 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/dataPoints:reconcile") |
| 5569 | urls += "?" + c.urlParams_.Encode() |
| 5570 | req, err := http.NewRequest("GET", urls, nil) |
| 5571 | if err != nil { |
| 5572 | return nil, err |
| 5573 | } |
| 5574 | req.Header = reqHeaders |
| 5575 | googleapi.Expand(req.URL, map[string]string{ |
| 5576 | "parent": c.parent, |
| 5577 | }) |
| 5578 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.reconcile", "request", internallog.HTTPRequest(req, nil)) |
| 5579 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 5580 | } |
| 5581 | |
| 5582 | // Do executes the "health.users.dataTypes.dataPoints.reconcile" call. |
| 5583 | // Any non-2xx status code is an error. Response headers are in either |
| 5584 | // *ReconcileDataPointsResponse.ServerResponse.Header or (if a response was |
| 5585 | // returned at all) in error.(*googleapi.Error).Header. Use |
| 5586 | // googleapi.IsNotModified to check whether the returned error was because |
| 5587 | // http.StatusNotModified was returned. |
| 5588 | func (c *UsersDataTypesDataPointsReconcileCall) Do(opts ...googleapi.CallOption) (*ReconcileDataPointsResponse, error) { |
| 5589 | gensupport.SetOptions(c.urlParams_, opts...) |
| 5590 | res, err := c.doRequest("json") |
| 5591 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 5592 | if res.Body != nil { |
| 5593 | res.Body.Close() |
| 5594 | } |
| 5595 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 5596 | Code: res.StatusCode, |
| 5597 | Header: res.Header, |
| 5598 | }) |
| 5599 | } |
| 5600 | if err != nil { |
| 5601 | return nil, err |
| 5602 | } |
| 5603 | defer googleapi.CloseBody(res) |
| 5604 | if err := googleapi.CheckResponse(res); err != nil { |
| 5605 | return nil, gensupport.WrapError(err) |
| 5606 | } |
| 5607 | ret := &ReconcileDataPointsResponse{ |
| 5608 | ServerResponse: googleapi.ServerResponse{ |
| 5609 | Header: res.Header, |
| 5610 | HTTPStatusCode: res.StatusCode, |
| 5611 | }, |
| 5612 | } |
| 5613 | target := &ret |
| 5614 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 5615 | if err != nil { |
| 5616 | return nil, err |
| 5617 | } |
| 5618 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.reconcile", "response", internallog.HTTPResponse(res, b)) |
| 5619 | return ret, nil |
| 5620 | } |
| 5621 | |
| 5622 | // Pages invokes f for each page of results. |
| 5623 | // A non-nil error returned from f will halt the iteration. |
| 5624 | // The provided context supersedes any context provided to the Context method. |
| 5625 | func (c *UsersDataTypesDataPointsReconcileCall) Pages(ctx context.Context, f func(*ReconcileDataPointsResponse) error) error { |
| 5626 | c.ctx_ = ctx |
| 5627 | defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 5628 | for { |
| 5629 | x, err := c.Do() |
| 5630 | if err != nil { |
| 5631 | return err |
| 5632 | } |
| 5633 | if err := f(x); err != nil { |
| 5634 | return err |
| 5635 | } |
| 5636 | if x.NextPageToken == "" { |
| 5637 | return nil |
| 5638 | } |
| 5639 | c.PageToken(x.NextPageToken) |
| 5640 | } |
| 5641 | } |
| 5642 | |
| 5643 | type UsersDataTypesDataPointsRollUpCall struct { |
| 5644 | s *Service |
| 5645 | parent string |
| 5646 | rollupdatapointsrequest *RollUpDataPointsRequest |
| 5647 | urlParams_ gensupport.URLParams |
| 5648 | ctx_ context.Context |
| 5649 | header_ http.Header |
| 5650 | } |
| 5651 | |
| 5652 | // RollUp: Roll up data points over physical time intervals for supported data |
| 5653 | // types. |
| 5654 | // |
| 5655 | // - parent: Parent data type of the Data Point collection. Format: |
| 5656 | // `users/{user}/dataTypes/{data_type}`, e.g.: - `users/me/dataTypes/steps` - |
| 5657 | // `users/me/dataTypes/distance` For a list of the supported data types see |
| 5658 | // the RollupDataPoint value union field. |
| 5659 | func (r *UsersDataTypesDataPointsService) RollUp(parent string, rollupdatapointsrequest *RollUpDataPointsRequest) *UsersDataTypesDataPointsRollUpCall { |
| 5660 | c := &UsersDataTypesDataPointsRollUpCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 5661 | c.parent = parent |
| 5662 | c.rollupdatapointsrequest = rollupdatapointsrequest |
| 5663 | return c |
| 5664 | } |
| 5665 | |
| 5666 | // Fields allows partial responses to be retrieved. See |
| 5667 | // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 5668 | // details. |
| 5669 | func (c *UsersDataTypesDataPointsRollUpCall) Fields(s ...googleapi.Field) *UsersDataTypesDataPointsRollUpCall { |
| 5670 | c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 5671 | return c |
| 5672 | } |
| 5673 | |
| 5674 | // Context sets the context to be used in this call's Do method. |
| 5675 | func (c *UsersDataTypesDataPointsRollUpCall) Context(ctx context.Context) *UsersDataTypesDataPointsRollUpCall { |
| 5676 | c.ctx_ = ctx |
| 5677 | return c |
| 5678 | } |
| 5679 | |
| 5680 | // Header returns a http.Header that can be modified by the caller to add |
| 5681 | // headers to the request. |
| 5682 | func (c *UsersDataTypesDataPointsRollUpCall) Header() http.Header { |
| 5683 | if c.header_ == nil { |
| 5684 | c.header_ = make(http.Header) |
| 5685 | } |
| 5686 | return c.header_ |
| 5687 | } |
| 5688 | |
| 5689 | func (c *UsersDataTypesDataPointsRollUpCall) doRequest(alt string) (*http.Response, error) { |
| 5690 | reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 5691 | body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollupdatapointsrequest) |
| 5692 | if err != nil { |
| 5693 | return nil, err |
| 5694 | } |
| 5695 | c.urlParams_.Set("alt", alt) |
| 5696 | c.urlParams_.Set("prettyPrint", "false") |
| 5697 | urls := googleapi.ResolveRelative(c.s.BasePath, "v4/{+parent}/dataPoints:rollUp") |
| 5698 | urls += "?" + c.urlParams_.Encode() |
| 5699 | req, err := http.NewRequest("POST", urls, body) |
| 5700 | if err != nil { |
| 5701 | return nil, err |
| 5702 | } |
| 5703 | req.Header = reqHeaders |
| 5704 | googleapi.Expand(req.URL, map[string]string{ |
| 5705 | "parent": c.parent, |
| 5706 | }) |
| 5707 | c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.rollUp", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 5708 | return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 5709 | } |
| 5710 | |
| 5711 | // Do executes the "health.users.dataTypes.dataPoints.rollUp" call. |
| 5712 | // Any non-2xx status code is an error. Response headers are in either |
| 5713 | // *RollUpDataPointsResponse.ServerResponse.Header or (if a response was |
| 5714 | // returned at all) in error.(*googleapi.Error).Header. Use |
| 5715 | // googleapi.IsNotModified to check whether the returned error was because |
| 5716 | // http.StatusNotModified was returned. |
| 5717 | func (c *UsersDataTypesDataPointsRollUpCall) Do(opts ...googleapi.CallOption) (*RollUpDataPointsResponse, error) { |
| 5718 | gensupport.SetOptions(c.urlParams_, opts...) |
| 5719 | res, err := c.doRequest("json") |
| 5720 | if res != nil && res.StatusCode == http.StatusNotModified { |
| 5721 | if res.Body != nil { |
| 5722 | res.Body.Close() |
| 5723 | } |
| 5724 | return nil, gensupport.WrapError(&googleapi.Error{ |
| 5725 | Code: res.StatusCode, |
| 5726 | Header: res.Header, |
| 5727 | }) |
| 5728 | } |
| 5729 | if err != nil { |
| 5730 | return nil, err |
| 5731 | } |
| 5732 | defer googleapi.CloseBody(res) |
| 5733 | if err := googleapi.CheckResponse(res); err != nil { |
| 5734 | return nil, gensupport.WrapError(err) |
| 5735 | } |
| 5736 | ret := &RollUpDataPointsResponse{ |
| 5737 | ServerResponse: googleapi.ServerResponse{ |
| 5738 | Header: res.Header, |
| 5739 | HTTPStatusCode: res.StatusCode, |
| 5740 | }, |
| 5741 | } |
| 5742 | target := &ret |
| 5743 | b, err := gensupport.DecodeResponseBytes(target, res) |
| 5744 | if err != nil { |
| 5745 | return nil, err |
| 5746 | } |
| 5747 | c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "health.users.dataTypes.dataPoints.rollUp", "response", internallog.HTTPResponse(res, b)) |
| 5748 | return ret, nil |
| 5749 | } |
| 5750 | |
| 5751 | // Pages invokes f for each page of results. |
| 5752 | // A non-nil error returned from f will halt the iteration. |
| 5753 | // The provided context supersedes any context provided to the Context method. |
| 5754 | func (c *UsersDataTypesDataPointsRollUpCall) Pages(ctx context.Context, f func(*RollUpDataPointsResponse) error) error { |
| 5755 | c.ctx_ = ctx |
| 5756 | defer func(pt string) { c.rollupdatapointsrequest.PageToken = pt }(c.rollupdatapointsrequest.PageToken) |
| 5757 | for { |
| 5758 | x, err := c.Do() |
| 5759 | if err != nil { |
| 5760 | return err |
| 5761 | } |
| 5762 | if err := f(x); err != nil { |
| 5763 | return err |
| 5764 | } |
| 5765 | if x.NextPageToken == "" { |
| 5766 | return nil |
| 5767 | } |
| 5768 | c.rollupdatapointsrequest.PageToken = x.NextPageToken |
| 5769 | } |
| 5770 | } |