-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathfitness-gen.go
3704 lines (3358 loc) · 140 KB
/
fitness-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package fitness provides access to the Fitness.
//
// For product documentation, see: https://developers.google.com/fit/rest/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/fitness/v1"
// ...
// ctx := context.Background()
// fitnessService, err := fitness.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// fitnessService, err := fitness.NewService(ctx, option.WithScopes(fitness.FitnessReproductiveHealthWriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// fitnessService, err := fitness.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// fitnessService, err := fitness.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package fitness // import "google.golang.org/api/fitness/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "fitness:v1"
const apiName = "fitness"
const apiVersion = "v1"
const basePath = "https://www.googleapis.com/fitness/v1/users/"
// OAuth2 scopes used by this API.
const (
// Use Google Fit to see and store your physical activity data
FitnessActivityReadScope = "https://www.googleapis.com/auth/fitness.activity.read"
// See and add to your Google Fit physical activity data
FitnessActivityWriteScope = "https://www.googleapis.com/auth/fitness.activity.write"
// See info about your blood glucose in Google Fit
FitnessBloodGlucoseReadScope = "https://www.googleapis.com/auth/fitness.blood_glucose.read"
// See and add info about your blood glucose to Google Fit
FitnessBloodGlucoseWriteScope = "https://www.googleapis.com/auth/fitness.blood_glucose.write"
// See info about your blood pressure in Google Fit
FitnessBloodPressureReadScope = "https://www.googleapis.com/auth/fitness.blood_pressure.read"
// See and add info about your blood pressure in Google Fit
FitnessBloodPressureWriteScope = "https://www.googleapis.com/auth/fitness.blood_pressure.write"
// See info about your body measurements and heart rate in Google Fit
FitnessBodyReadScope = "https://www.googleapis.com/auth/fitness.body.read"
// See and add info about your body measurements and heart rate to
// Google Fit
FitnessBodyWriteScope = "https://www.googleapis.com/auth/fitness.body.write"
// See info about your body temperature in Google Fit
FitnessBodyTemperatureReadScope = "https://www.googleapis.com/auth/fitness.body_temperature.read"
// See and add to info about your body temperature in Google Fit
FitnessBodyTemperatureWriteScope = "https://www.googleapis.com/auth/fitness.body_temperature.write"
// See your Google Fit speed and distance data
FitnessLocationReadScope = "https://www.googleapis.com/auth/fitness.location.read"
// See and add to your Google Fit location data
FitnessLocationWriteScope = "https://www.googleapis.com/auth/fitness.location.write"
// See info about your nutrition in Google Fit
FitnessNutritionReadScope = "https://www.googleapis.com/auth/fitness.nutrition.read"
// See and add to info about your nutrition in Google Fit
FitnessNutritionWriteScope = "https://www.googleapis.com/auth/fitness.nutrition.write"
// See info about your oxygen saturation in Google Fit
FitnessOxygenSaturationReadScope = "https://www.googleapis.com/auth/fitness.oxygen_saturation.read"
// See and add info about your oxygen saturation in Google Fit
FitnessOxygenSaturationWriteScope = "https://www.googleapis.com/auth/fitness.oxygen_saturation.write"
// See info about your reproductive health in Google Fit
FitnessReproductiveHealthReadScope = "https://www.googleapis.com/auth/fitness.reproductive_health.read"
// See and add info about your reproductive health in Google Fit
FitnessReproductiveHealthWriteScope = "https://www.googleapis.com/auth/fitness.reproductive_health.write"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/fitness.activity.read",
"https://www.googleapis.com/auth/fitness.activity.write",
"https://www.googleapis.com/auth/fitness.blood_glucose.read",
"https://www.googleapis.com/auth/fitness.blood_glucose.write",
"https://www.googleapis.com/auth/fitness.blood_pressure.read",
"https://www.googleapis.com/auth/fitness.blood_pressure.write",
"https://www.googleapis.com/auth/fitness.body.read",
"https://www.googleapis.com/auth/fitness.body.write",
"https://www.googleapis.com/auth/fitness.body_temperature.read",
"https://www.googleapis.com/auth/fitness.body_temperature.write",
"https://www.googleapis.com/auth/fitness.location.read",
"https://www.googleapis.com/auth/fitness.location.write",
"https://www.googleapis.com/auth/fitness.nutrition.read",
"https://www.googleapis.com/auth/fitness.nutrition.write",
"https://www.googleapis.com/auth/fitness.oxygen_saturation.read",
"https://www.googleapis.com/auth/fitness.oxygen_saturation.write",
"https://www.googleapis.com/auth/fitness.reproductive_health.read",
"https://www.googleapis.com/auth/fitness.reproductive_health.write",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Users = NewUsersService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Users *UsersService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewUsersService(s *Service) *UsersService {
rs := &UsersService{s: s}
rs.DataSources = NewUsersDataSourcesService(s)
rs.Dataset = NewUsersDatasetService(s)
rs.Sessions = NewUsersSessionsService(s)
return rs
}
type UsersService struct {
s *Service
DataSources *UsersDataSourcesService
Dataset *UsersDatasetService
Sessions *UsersSessionsService
}
func NewUsersDataSourcesService(s *Service) *UsersDataSourcesService {
rs := &UsersDataSourcesService{s: s}
rs.DataPointChanges = NewUsersDataSourcesDataPointChangesService(s)
rs.Datasets = NewUsersDataSourcesDatasetsService(s)
return rs
}
type UsersDataSourcesService struct {
s *Service
DataPointChanges *UsersDataSourcesDataPointChangesService
Datasets *UsersDataSourcesDatasetsService
}
func NewUsersDataSourcesDataPointChangesService(s *Service) *UsersDataSourcesDataPointChangesService {
rs := &UsersDataSourcesDataPointChangesService{s: s}
return rs
}
type UsersDataSourcesDataPointChangesService struct {
s *Service
}
func NewUsersDataSourcesDatasetsService(s *Service) *UsersDataSourcesDatasetsService {
rs := &UsersDataSourcesDatasetsService{s: s}
return rs
}
type UsersDataSourcesDatasetsService struct {
s *Service
}
func NewUsersDatasetService(s *Service) *UsersDatasetService {
rs := &UsersDatasetService{s: s}
return rs
}
type UsersDatasetService struct {
s *Service
}
func NewUsersSessionsService(s *Service) *UsersSessionsService {
rs := &UsersSessionsService{s: s}
return rs
}
type UsersSessionsService struct {
s *Service
}
type AggregateBucket struct {
// Activity: Available for Bucket.Type.ACTIVITY_TYPE,
// Bucket.Type.ACTIVITY_SEGMENT
Activity int64 `json:"activity,omitempty"`
// Dataset: There will be one dataset per AggregateBy in the request.
Dataset []*Dataset `json:"dataset,omitempty"`
// EndTimeMillis: The end time for the aggregated data, in milliseconds
// since epoch, inclusive.
EndTimeMillis int64 `json:"endTimeMillis,omitempty,string"`
// Session: Available for Bucket.Type.SESSION
Session *Session `json:"session,omitempty"`
// StartTimeMillis: The start time for the aggregated data, in
// milliseconds since epoch, inclusive.
StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"`
// Type: The type of a bucket signifies how the data aggregation is
// performed in the bucket.
//
// Possible values:
// "activitySegment"
// "activityType"
// "session"
// "time"
// "unknown"
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Activity") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Activity") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AggregateBucket) MarshalJSON() ([]byte, error) {
type NoMethod AggregateBucket
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AggregateBy: The specification of which data to aggregate.
type AggregateBy struct {
// DataSourceId: A data source ID to aggregate. Mutually exclusive of
// dataTypeName. Only data from the specified data source ID will be
// included in the aggregation. The dataset in the response will have
// the same data source ID.
DataSourceId string `json:"dataSourceId,omitempty"`
// DataTypeName: The data type to aggregate. All data sources providing
// this data type will contribute data to the aggregation. The response
// will contain a single dataset for this data type name. The dataset
// will have a data source ID of
// derived:com.google.:com.google.android.gms:aggregated
DataTypeName string `json:"dataTypeName,omitempty"`
// ForceSendFields is a list of field names (e.g. "DataSourceId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DataSourceId") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AggregateBy) MarshalJSON() ([]byte, error) {
type NoMethod AggregateBy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AggregateRequest: Next id: 10
type AggregateRequest struct {
// AggregateBy: The specification of data to be aggregated. At least one
// aggregateBy spec must be provided. All data that is specified will be
// aggregated using the same bucketing criteria. There will be one
// dataset in the response for every aggregateBy spec.
AggregateBy []*AggregateBy `json:"aggregateBy,omitempty"`
// BucketByActivitySegment: Specifies that data be aggregated each
// activity segment recored for a user. Similar to
// bucketByActivitySegment, but bucketing is done for each activity
// segment rather than all segments of the same type. Mutually exclusive
// of other bucketing specifications.
BucketByActivitySegment *BucketByActivity `json:"bucketByActivitySegment,omitempty"`
// BucketByActivityType: Specifies that data be aggregated by the type
// of activity being performed when the data was recorded. All data that
// was recorded during a certain activity type (for the given time
// range) will be aggregated into the same bucket. Data that was
// recorded while the user was not active will not be included in the
// response. Mutually exclusive of other bucketing specifications.
BucketByActivityType *BucketByActivity `json:"bucketByActivityType,omitempty"`
// BucketBySession: Specifies that data be aggregated by user sessions.
// Data that does not fall within the time range of a session will not
// be included in the response. Mutually exclusive of other bucketing
// specifications.
BucketBySession *BucketBySession `json:"bucketBySession,omitempty"`
// BucketByTime: Specifies that data be aggregated by a single time
// interval. Mutually exclusive of other bucketing specifications.
BucketByTime *BucketByTime `json:"bucketByTime,omitempty"`
// EndTimeMillis: The end of a window of time. Data that intersects with
// this time window will be aggregated. The time is in milliseconds
// since epoch, inclusive.
EndTimeMillis int64 `json:"endTimeMillis,omitempty,string"`
// FilteredDataQualityStandard: DO NOT POPULATE THIS FIELD. It is
// ignored.
//
// Possible values:
// "dataQualityBloodGlucoseIso151972003"
// "dataQualityBloodGlucoseIso151972013"
// "dataQualityBloodPressureAami"
// "dataQualityBloodPressureBhsAA"
// "dataQualityBloodPressureBhsAB"
// "dataQualityBloodPressureBhsBA"
// "dataQualityBloodPressureBhsBB"
// "dataQualityBloodPressureEsh2002"
// "dataQualityBloodPressureEsh2010"
// "dataQualityUnknown"
FilteredDataQualityStandard []string `json:"filteredDataQualityStandard,omitempty"`
// StartTimeMillis: The start of a window of time. Data that intersects
// with this time window will be aggregated. The time is in milliseconds
// since epoch, inclusive.
StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "AggregateBy") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AggregateBy") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AggregateRequest) MarshalJSON() ([]byte, error) {
type NoMethod AggregateRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type AggregateResponse struct {
// Bucket: A list of buckets containing the aggregated data.
Bucket []*AggregateBucket `json:"bucket,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Bucket") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Bucket") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AggregateResponse) MarshalJSON() ([]byte, error) {
type NoMethod AggregateResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type Application struct {
// DetailsUrl: An optional URI that can be used to link back to the
// application.
DetailsUrl string `json:"detailsUrl,omitempty"`
// Name: The name of this application. This is required for REST
// clients, but we do not enforce uniqueness of this name. It is
// provided as a matter of convenience for other developers who would
// like to identify which REST created an Application or Data Source.
Name string `json:"name,omitempty"`
// PackageName: Package name for this application. This is used as a
// unique identifier when created by Android applications, but cannot be
// specified by REST clients. REST clients will have their developer
// project number reflected into the Data Source data stream IDs,
// instead of the packageName.
PackageName string `json:"packageName,omitempty"`
// Version: Version of the application. You should update this field
// whenever the application changes in a way that affects the
// computation of the data.
Version string `json:"version,omitempty"`
// ForceSendFields is a list of field names (e.g. "DetailsUrl") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DetailsUrl") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Application) MarshalJSON() ([]byte, error) {
type NoMethod Application
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BucketByActivity struct {
// ActivityDataSourceId: The default activity stream will be used if a
// specific activityDataSourceId is not specified.
ActivityDataSourceId string `json:"activityDataSourceId,omitempty"`
// MinDurationMillis: Specifies that only activity segments of duration
// longer than minDurationMillis are considered and used as a container
// for aggregated data.
MinDurationMillis int64 `json:"minDurationMillis,omitempty,string"`
// ForceSendFields is a list of field names (e.g.
// "ActivityDataSourceId") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ActivityDataSourceId") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BucketByActivity) MarshalJSON() ([]byte, error) {
type NoMethod BucketByActivity
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BucketBySession struct {
// MinDurationMillis: Specifies that only sessions of duration longer
// than minDurationMillis are considered and used as a container for
// aggregated data.
MinDurationMillis int64 `json:"minDurationMillis,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "MinDurationMillis")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MinDurationMillis") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BucketBySession) MarshalJSON() ([]byte, error) {
type NoMethod BucketBySession
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BucketByTime struct {
// DurationMillis: Specifies that result buckets aggregate data by
// exactly durationMillis time frames. Time frames that contain no data
// will be included in the response with an empty dataset.
DurationMillis int64 `json:"durationMillis,omitempty,string"`
Period *BucketByTimePeriod `json:"period,omitempty"`
// ForceSendFields is a list of field names (e.g. "DurationMillis") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DurationMillis") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BucketByTime) MarshalJSON() ([]byte, error) {
type NoMethod BucketByTime
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BucketByTimePeriod struct {
// TimeZoneId: org.joda.timezone.DateTimeZone
TimeZoneId string `json:"timeZoneId,omitempty"`
// Possible values:
// "day"
// "month"
// "week"
Type string `json:"type,omitempty"`
Value int64 `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "TimeZoneId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "TimeZoneId") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BucketByTimePeriod) MarshalJSON() ([]byte, error) {
type NoMethod BucketByTimePeriod
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DataPoint: Represents a single data point, generated by a particular
// data source. A data point holds a value for each field, an end
// timestamp and an optional start time. The exact semantics of each of
// these attributes are specified in the documentation for the
// particular data type.
//
// A data point can represent an instantaneous measurement, reading or
// input observation, as well as averages or aggregates over a time
// interval. Check the data type documentation to determine which is the
// case for a particular data type.
//
// Data points always contain one value for each field of the data type.
type DataPoint struct {
// ComputationTimeMillis: DO NOT USE THIS FIELD. It is ignored, and not
// stored.
ComputationTimeMillis int64 `json:"computationTimeMillis,omitempty,string"`
// DataTypeName: The data type defining the format of the values in this
// data point.
DataTypeName string `json:"dataTypeName,omitempty"`
// EndTimeNanos: The end time of the interval represented by this data
// point, in nanoseconds since epoch.
EndTimeNanos int64 `json:"endTimeNanos,omitempty,string"`
// ModifiedTimeMillis: Indicates the last time this data point was
// modified. Useful only in contexts where we are listing the data
// changes, rather than representing the current state of the data.
ModifiedTimeMillis int64 `json:"modifiedTimeMillis,omitempty,string"`
// OriginDataSourceId: If the data point is contained in a dataset for a
// derived data source, this field will be populated with the data
// source stream ID that created the data point originally.
//
// WARNING: do not rely on this field for anything other than debugging.
// The value of this field, if it is set at all, is an implementation
// detail and is not guaranteed to remain consistent.
OriginDataSourceId string `json:"originDataSourceId,omitempty"`
// RawTimestampNanos: The raw timestamp from the original SensorEvent.
RawTimestampNanos int64 `json:"rawTimestampNanos,omitempty,string"`
// StartTimeNanos: The start time of the interval represented by this
// data point, in nanoseconds since epoch.
StartTimeNanos int64 `json:"startTimeNanos,omitempty,string"`
// Value: Values of each data type field for the data point. It is
// expected that each value corresponding to a data type field will
// occur in the same order that the field is listed with in the data
// type specified in a data source.
//
// Only one of integer and floating point fields will be populated,
// depending on the format enum value within data source's type field.
Value []*Value `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ComputationTimeMillis") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ComputationTimeMillis") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *DataPoint) MarshalJSON() ([]byte, error) {
type NoMethod DataPoint
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DataSource: Definition of a unique source of sensor data. Data
// sources can expose raw data coming from hardware sensors on local or
// companion devices. They can also expose derived data, created by
// transforming or merging other data sources. Multiple data sources can
// exist for the same data type. Every data point inserted into or read
// from this service has an associated data source.
//
// The data source contains enough information to uniquely identify its
// data, including the hardware device and the application that
// collected and/or transformed the data. It also holds useful metadata,
// such as the hardware and application versions, and the device
// type.
//
// Each data source produces a unique stream of data, with a unique
// identifier. Not all changes to data source affect the stream
// identifier, so that data collected by updated versions of the same
// application/device can still be considered to belong to the same data
// stream.
type DataSource struct {
// Application: Information about an application which feeds sensor data
// into the platform.
Application *Application `json:"application,omitempty"`
// DataQualityStandard: DO NOT POPULATE THIS FIELD. It is never
// populated in responses from the platform, and is ignored in queries.
// It will be removed in a future version entirely.
//
// Possible values:
// "dataQualityBloodGlucoseIso151972003"
// "dataQualityBloodGlucoseIso151972013"
// "dataQualityBloodPressureAami"
// "dataQualityBloodPressureBhsAA"
// "dataQualityBloodPressureBhsAB"
// "dataQualityBloodPressureBhsBA"
// "dataQualityBloodPressureBhsBB"
// "dataQualityBloodPressureEsh2002"
// "dataQualityBloodPressureEsh2010"
// "dataQualityUnknown"
DataQualityStandard []string `json:"dataQualityStandard,omitempty"`
// DataStreamId: A unique identifier for the data stream produced by
// this data source. The identifier includes:
//
//
// - The physical device's manufacturer, model, and serial number (UID).
//
// - The application's package name or name. Package name is used when
// the data source was created by an Android application. The developer
// project number is used when the data source was created by a REST
// client.
// - The data source's type.
// - The data source's stream name. Note that not all attributes of the
// data source are used as part of the stream identifier. In particular,
// the version of the hardware/the application isn't used. This allows
// us to preserve the same stream through version updates. This also
// means that two DataSource objects may represent the same data stream
// even if they're not equal.
//
// The exact format of the data stream ID created by an Android
// application is:
// type:dataType.name:application.packageName:device.manufacturer:device.
// model:device.uid:dataStreamName
//
// The exact format of the data stream ID created by a REST client is:
// type:dataType.name:developer project
// number:device.manufacturer:device.model:device.uid:dataStreamName
//
//
// When any of the optional fields that make up the data stream ID are
// absent, they will be omitted from the data stream ID. The minimum
// viable data stream ID would be: type:dataType.name:developer project
// number
//
// Finally, the developer project number is obfuscated when read by any
// REST or Android client that did not create the data source. Only the
// data source creator will see the developer project number in clear
// and normal form.
DataStreamId string `json:"dataStreamId,omitempty"`
// DataStreamName: The stream name uniquely identifies this particular
// data source among other data sources of the same type from the same
// underlying producer. Setting the stream name is optional, but should
// be done whenever an application exposes two streams for the same data
// type, or when a device has two equivalent sensors.
DataStreamName string `json:"dataStreamName,omitempty"`
// DataType: The data type defines the schema for a stream of data being
// collected by, inserted into, or queried from the Fitness API.
DataType *DataType `json:"dataType,omitempty"`
// Device: Representation of an integrated device (such as a phone or a
// wearable) that can hold sensors.
Device *Device `json:"device,omitempty"`
// Name: An end-user visible name for this data source.
Name string `json:"name,omitempty"`
// Type: A constant describing the type of this data source. Indicates
// whether this data source produces raw or derived data.
//
// Possible values:
// "derived"
// "raw"
Type string `json:"type,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Application") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Application") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DataSource) MarshalJSON() ([]byte, error) {
type NoMethod DataSource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type DataType struct {
// Field: A field represents one dimension of a data type.
Field []*DataTypeField `json:"field,omitempty"`
// Name: Each data type has a unique, namespaced, name. All data types
// in the com.google namespace are shared as part of the platform.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Field") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Field") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DataType) MarshalJSON() ([]byte, error) {
type NoMethod DataType
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DataTypeField: In case of multi-dimensional data (such as an
// accelerometer with x, y, and z axes) each field represents one
// dimension. Each data type field has a unique name which identifies
// it. The field also defines the format of the data (int, float,
// etc.).
//
// This message is only instantiated in code and not used for wire comms
// or stored in any way.
type DataTypeField struct {
// Format: The different supported formats for each field in a data
// type.
//
// Possible values:
// "blob"
// "floatList"
// "floatPoint"
// "integer"
// "integerList"
// "map"
// "string"
Format string `json:"format,omitempty"`
// Name: Defines the name and format of data. Unlike data type names,
// field names are not namespaced, and only need to be unique within the
// data type.
Name string `json:"name,omitempty"`
Optional bool `json:"optional,omitempty"`
// ForceSendFields is a list of field names (e.g. "Format") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Format") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DataTypeField) MarshalJSON() ([]byte, error) {
type NoMethod DataTypeField
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Dataset: A dataset represents a projection container for data points.
// They do not carry any info of their own. Datasets represent a set of
// data points from a particular data source. A data point can be found
// in more than one dataset.
type Dataset struct {
// DataSourceId: The data stream ID of the data source that created the
// points in this dataset.
DataSourceId string `json:"dataSourceId,omitempty"`
// MaxEndTimeNs: The largest end time of all data points in this
// possibly partial representation of the dataset. Time is in
// nanoseconds from epoch. This should also match the second part of the
// dataset identifier.
MaxEndTimeNs int64 `json:"maxEndTimeNs,omitempty,string"`
// MinStartTimeNs: The smallest start time of all data points in this
// possibly partial representation of the dataset. Time is in
// nanoseconds from epoch. This should also match the first part of the
// dataset identifier.
MinStartTimeNs int64 `json:"minStartTimeNs,omitempty,string"`
// NextPageToken: This token will be set when a dataset is received in
// response to a GET request and the dataset is too large to be included
// in a single response. Provide this value in a subsequent GET request
// to return the next page of data points within this dataset.
NextPageToken string `json:"nextPageToken,omitempty"`
// Point: A partial list of data points contained in the dataset,
// ordered by largest endTimeNanos first. This list is considered
// complete when retrieving a small dataset and partial when patching a
// dataset or retrieving a dataset that is too large to include in a
// single response.
Point []*DataPoint `json:"point,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DataSourceId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DataSourceId") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with