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 package mirror
43
44 import (
45 "bytes"
46 "context"
47 "encoding/json"
48 "errors"
49 "fmt"
50 "io"
51 "net/http"
52 "net/url"
53 "strconv"
54 "strings"
55
56 googleapi "google.golang.org/api/googleapi"
57 gensupport "google.golang.org/api/internal/gensupport"
58 option "google.golang.org/api/option"
59 internaloption "google.golang.org/api/option/internaloption"
60 htransport "google.golang.org/api/transport/http"
61 )
62
63
64
65 var _ = bytes.NewBuffer
66 var _ = strconv.Itoa
67 var _ = fmt.Sprintf
68 var _ = json.NewDecoder
69 var _ = io.Copy
70 var _ = url.Parse
71 var _ = gensupport.MarshalJSON
72 var _ = googleapi.Version
73 var _ = errors.New
74 var _ = strings.Replace
75 var _ = context.Canceled
76 var _ = internaloption.WithDefaultEndpoint
77
78 const apiId = "mirror:v1"
79 const apiName = "mirror"
80 const apiVersion = "v1"
81 const basePath = "https://www.googleapis.com/mirror/v1/"
82
83
84 const (
85
86 GlassLocationScope = "https://www.googleapis.com/auth/glass.location"
87
88
89 GlassTimelineScope = "https://www.googleapis.com/auth/glass.timeline"
90 )
91
92
93 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
94 scopesOption := option.WithScopes(
95 "https://www.googleapis.com/auth/glass.location",
96 "https://www.googleapis.com/auth/glass.timeline",
97 )
98
99 opts = append([]option.ClientOption{scopesOption}, opts...)
100 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
101 client, endpoint, err := htransport.NewClient(ctx, opts...)
102 if err != nil {
103 return nil, err
104 }
105 s, err := New(client)
106 if err != nil {
107 return nil, err
108 }
109 if endpoint != "" {
110 s.BasePath = endpoint
111 }
112 return s, nil
113 }
114
115
116
117
118
119
120 func New(client *http.Client) (*Service, error) {
121 if client == nil {
122 return nil, errors.New("client is nil")
123 }
124 s := &Service{client: client, BasePath: basePath}
125 s.Accounts = NewAccountsService(s)
126 s.Contacts = NewContactsService(s)
127 s.Locations = NewLocationsService(s)
128 s.Settings = NewSettingsService(s)
129 s.Subscriptions = NewSubscriptionsService(s)
130 s.Timeline = NewTimelineService(s)
131 return s, nil
132 }
133
134 type Service struct {
135 client *http.Client
136 BasePath string
137 UserAgent string
138
139 Accounts *AccountsService
140
141 Contacts *ContactsService
142
143 Locations *LocationsService
144
145 Settings *SettingsService
146
147 Subscriptions *SubscriptionsService
148
149 Timeline *TimelineService
150 }
151
152 func (s *Service) userAgent() string {
153 if s.UserAgent == "" {
154 return googleapi.UserAgent
155 }
156 return googleapi.UserAgent + " " + s.UserAgent
157 }
158
159 func NewAccountsService(s *Service) *AccountsService {
160 rs := &AccountsService{s: s}
161 return rs
162 }
163
164 type AccountsService struct {
165 s *Service
166 }
167
168 func NewContactsService(s *Service) *ContactsService {
169 rs := &ContactsService{s: s}
170 return rs
171 }
172
173 type ContactsService struct {
174 s *Service
175 }
176
177 func NewLocationsService(s *Service) *LocationsService {
178 rs := &LocationsService{s: s}
179 return rs
180 }
181
182 type LocationsService struct {
183 s *Service
184 }
185
186 func NewSettingsService(s *Service) *SettingsService {
187 rs := &SettingsService{s: s}
188 return rs
189 }
190
191 type SettingsService struct {
192 s *Service
193 }
194
195 func NewSubscriptionsService(s *Service) *SubscriptionsService {
196 rs := &SubscriptionsService{s: s}
197 return rs
198 }
199
200 type SubscriptionsService struct {
201 s *Service
202 }
203
204 func NewTimelineService(s *Service) *TimelineService {
205 rs := &TimelineService{s: s}
206 rs.Attachments = NewTimelineAttachmentsService(s)
207 return rs
208 }
209
210 type TimelineService struct {
211 s *Service
212
213 Attachments *TimelineAttachmentsService
214 }
215
216 func NewTimelineAttachmentsService(s *Service) *TimelineAttachmentsService {
217 rs := &TimelineAttachmentsService{s: s}
218 return rs
219 }
220
221 type TimelineAttachmentsService struct {
222 s *Service
223 }
224
225
226
227 type Account struct {
228 AuthTokens []*AuthToken `json:"authTokens,omitempty"`
229
230 Features []string `json:"features,omitempty"`
231
232 Password string `json:"password,omitempty"`
233
234 UserData []*UserData `json:"userData,omitempty"`
235
236
237
238 googleapi.ServerResponse `json:"-"`
239
240
241
242
243
244
245
246 ForceSendFields []string `json:"-"`
247
248
249
250
251
252
253
254 NullFields []string `json:"-"`
255 }
256
257 func (s *Account) MarshalJSON() ([]byte, error) {
258 type NoMethod Account
259 raw := NoMethod(*s)
260 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
261 }
262
263
264
265 type Attachment struct {
266
267 ContentType string `json:"contentType,omitempty"`
268
269
270 ContentUrl string `json:"contentUrl,omitempty"`
271
272
273 Id string `json:"id,omitempty"`
274
275
276
277
278 IsProcessingContent bool `json:"isProcessingContent,omitempty"`
279
280
281
282 googleapi.ServerResponse `json:"-"`
283
284
285
286
287
288
289
290 ForceSendFields []string `json:"-"`
291
292
293
294
295
296
297
298 NullFields []string `json:"-"`
299 }
300
301 func (s *Attachment) MarshalJSON() ([]byte, error) {
302 type NoMethod Attachment
303 raw := NoMethod(*s)
304 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
305 }
306
307
308
309 type AttachmentsListResponse struct {
310
311 Items []*Attachment `json:"items,omitempty"`
312
313
314 Kind string `json:"kind,omitempty"`
315
316
317
318 googleapi.ServerResponse `json:"-"`
319
320
321
322
323
324
325
326 ForceSendFields []string `json:"-"`
327
328
329
330
331
332
333
334 NullFields []string `json:"-"`
335 }
336
337 func (s *AttachmentsListResponse) MarshalJSON() ([]byte, error) {
338 type NoMethod AttachmentsListResponse
339 raw := NoMethod(*s)
340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
341 }
342
343 type AuthToken struct {
344 AuthToken string `json:"authToken,omitempty"`
345
346 Type string `json:"type,omitempty"`
347
348
349
350
351
352
353
354 ForceSendFields []string `json:"-"`
355
356
357
358
359
360
361
362 NullFields []string `json:"-"`
363 }
364
365 func (s *AuthToken) MarshalJSON() ([]byte, error) {
366 type NoMethod AuthToken
367 raw := NoMethod(*s)
368 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
369 }
370
371
372 type Command struct {
373
374
375
376
377
378
379 Type string `json:"type,omitempty"`
380
381
382
383
384
385
386
387 ForceSendFields []string `json:"-"`
388
389
390
391
392
393
394
395 NullFields []string `json:"-"`
396 }
397
398 func (s *Command) MarshalJSON() ([]byte, error) {
399 type NoMethod Command
400 raw := NoMethod(*s)
401 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
402 }
403
404
405
406 type Contact struct {
407
408
409
410
411 AcceptCommands []*Command `json:"acceptCommands,omitempty"`
412
413
414
415
416
417 AcceptTypes []string `json:"acceptTypes,omitempty"`
418
419
420 DisplayName string `json:"displayName,omitempty"`
421
422
423
424 Id string `json:"id,omitempty"`
425
426
427
428
429
430 ImageUrls []string `json:"imageUrls,omitempty"`
431
432
433 Kind string `json:"kind,omitempty"`
434
435
436
437
438 PhoneNumber string `json:"phoneNumber,omitempty"`
439
440
441
442
443 Priority int64 `json:"priority,omitempty"`
444
445
446
447
448 SharingFeatures []string `json:"sharingFeatures,omitempty"`
449
450
451
452 Source string `json:"source,omitempty"`
453
454
455
456
457
458
459 SpeakableName string `json:"speakableName,omitempty"`
460
461
462
463
464
465 Type string `json:"type,omitempty"`
466
467
468
469 googleapi.ServerResponse `json:"-"`
470
471
472
473
474
475
476
477 ForceSendFields []string `json:"-"`
478
479
480
481
482
483
484
485
486 NullFields []string `json:"-"`
487 }
488
489 func (s *Contact) MarshalJSON() ([]byte, error) {
490 type NoMethod Contact
491 raw := NoMethod(*s)
492 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
493 }
494
495
496
497
498 type ContactsListResponse struct {
499
500 Items []*Contact `json:"items,omitempty"`
501
502
503 Kind string `json:"kind,omitempty"`
504
505
506
507 googleapi.ServerResponse `json:"-"`
508
509
510
511
512
513
514
515 ForceSendFields []string `json:"-"`
516
517
518
519
520
521
522
523 NullFields []string `json:"-"`
524 }
525
526 func (s *ContactsListResponse) MarshalJSON() ([]byte, error) {
527 type NoMethod ContactsListResponse
528 raw := NoMethod(*s)
529 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
530 }
531
532
533
534 type Location struct {
535
536 Accuracy float64 `json:"accuracy,omitempty"`
537
538
539 Address string `json:"address,omitempty"`
540
541
542
543 DisplayName string `json:"displayName,omitempty"`
544
545
546 Id string `json:"id,omitempty"`
547
548
549 Kind string `json:"kind,omitempty"`
550
551
552 Latitude float64 `json:"latitude,omitempty"`
553
554
555 Longitude float64 `json:"longitude,omitempty"`
556
557
558
559 Timestamp string `json:"timestamp,omitempty"`
560
561
562
563 googleapi.ServerResponse `json:"-"`
564
565
566
567
568
569
570
571 ForceSendFields []string `json:"-"`
572
573
574
575
576
577
578
579 NullFields []string `json:"-"`
580 }
581
582 func (s *Location) MarshalJSON() ([]byte, error) {
583 type NoMethod Location
584 raw := NoMethod(*s)
585 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
586 }
587
588 func (s *Location) UnmarshalJSON(data []byte) error {
589 type NoMethod Location
590 var s1 struct {
591 Accuracy gensupport.JSONFloat64 `json:"accuracy"`
592 Latitude gensupport.JSONFloat64 `json:"latitude"`
593 Longitude gensupport.JSONFloat64 `json:"longitude"`
594 *NoMethod
595 }
596 s1.NoMethod = (*NoMethod)(s)
597 if err := json.Unmarshal(data, &s1); err != nil {
598 return err
599 }
600 s.Accuracy = float64(s1.Accuracy)
601 s.Latitude = float64(s1.Latitude)
602 s.Longitude = float64(s1.Longitude)
603 return nil
604 }
605
606
607
608 type LocationsListResponse struct {
609
610 Items []*Location `json:"items,omitempty"`
611
612
613 Kind string `json:"kind,omitempty"`
614
615
616
617 googleapi.ServerResponse `json:"-"`
618
619
620
621
622
623
624
625 ForceSendFields []string `json:"-"`
626
627
628
629
630
631
632
633 NullFields []string `json:"-"`
634 }
635
636 func (s *LocationsListResponse) MarshalJSON() ([]byte, error) {
637 type NoMethod LocationsListResponse
638 raw := NoMethod(*s)
639 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
640 }
641
642
643
644 type MenuItem struct {
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 Action string `json:"action,omitempty"`
680
681
682
683
684
685
686
687 ContextualCommand string `json:"contextual_command,omitempty"`
688
689
690
691 Id string `json:"id,omitempty"`
692
693
694
695
696
697
698
699
700
701 Payload string `json:"payload,omitempty"`
702
703
704
705 RemoveWhenSelected bool `json:"removeWhenSelected,omitempty"`
706
707
708
709
710
711 Values []*MenuValue `json:"values,omitempty"`
712
713
714
715
716
717
718
719 ForceSendFields []string `json:"-"`
720
721
722
723
724
725
726
727 NullFields []string `json:"-"`
728 }
729
730 func (s *MenuItem) MarshalJSON() ([]byte, error) {
731 type NoMethod MenuItem
732 raw := NoMethod(*s)
733 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
734 }
735
736
737 type MenuValue struct {
738
739
740
741 DisplayName string `json:"displayName,omitempty"`
742
743
744 IconUrl string `json:"iconUrl,omitempty"`
745
746
747
748
749
750
751
752
753 State string `json:"state,omitempty"`
754
755
756
757
758
759
760
761 ForceSendFields []string `json:"-"`
762
763
764
765
766
767
768
769 NullFields []string `json:"-"`
770 }
771
772 func (s *MenuValue) MarshalJSON() ([]byte, error) {
773 type NoMethod MenuValue
774 raw := NoMethod(*s)
775 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
776 }
777
778
779 type Notification struct {
780
781 Collection string `json:"collection,omitempty"`
782
783
784 ItemId string `json:"itemId,omitempty"`
785
786
787 Operation string `json:"operation,omitempty"`
788
789
790
791 UserActions []*UserAction `json:"userActions,omitempty"`
792
793
794
795 UserToken string `json:"userToken,omitempty"`
796
797
798
799 VerifyToken string `json:"verifyToken,omitempty"`
800
801
802
803
804
805
806
807 ForceSendFields []string `json:"-"`
808
809
810
811
812
813
814
815 NullFields []string `json:"-"`
816 }
817
818 func (s *Notification) MarshalJSON() ([]byte, error) {
819 type NoMethod Notification
820 raw := NoMethod(*s)
821 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
822 }
823
824
825
826 type NotificationConfig struct {
827
828 DeliveryTime string `json:"deliveryTime,omitempty"`
829
830
831
832
833
834 Level string `json:"level,omitempty"`
835
836
837
838
839
840
841
842 ForceSendFields []string `json:"-"`
843
844
845
846
847
848
849
850 NullFields []string `json:"-"`
851 }
852
853 func (s *NotificationConfig) MarshalJSON() ([]byte, error) {
854 type NoMethod NotificationConfig
855 raw := NoMethod(*s)
856 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
857 }
858
859
860 type Setting struct {
861
862
863
864
865
866
867 Id string `json:"id,omitempty"`
868
869
870 Kind string `json:"kind,omitempty"`
871
872
873 Value string `json:"value,omitempty"`
874
875
876
877 googleapi.ServerResponse `json:"-"`
878
879
880
881
882
883
884
885 ForceSendFields []string `json:"-"`
886
887
888
889
890
891
892
893 NullFields []string `json:"-"`
894 }
895
896 func (s *Setting) MarshalJSON() ([]byte, error) {
897 type NoMethod Setting
898 raw := NoMethod(*s)
899 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
900 }
901
902
903 type Subscription struct {
904
905
906 CallbackUrl string `json:"callbackUrl,omitempty"`
907
908
909
910
911
912
913 Collection string `json:"collection,omitempty"`
914
915
916 Id string `json:"id,omitempty"`
917
918
919 Kind string `json:"kind,omitempty"`
920
921
922
923 Notification *Notification `json:"notification,omitempty"`
924
925
926
927
928
929
930
931
932 Operation []string `json:"operation,omitempty"`
933
934
935
936 Updated string `json:"updated,omitempty"`
937
938
939
940 UserToken string `json:"userToken,omitempty"`
941
942
943
944 VerifyToken string `json:"verifyToken,omitempty"`
945
946
947
948 googleapi.ServerResponse `json:"-"`
949
950
951
952
953
954
955
956 ForceSendFields []string `json:"-"`
957
958
959
960
961
962
963
964 NullFields []string `json:"-"`
965 }
966
967 func (s *Subscription) MarshalJSON() ([]byte, error) {
968 type NoMethod Subscription
969 raw := NoMethod(*s)
970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
971 }
972
973
974
975
976 type SubscriptionsListResponse struct {
977
978 Items []*Subscription `json:"items,omitempty"`
979
980
981 Kind string `json:"kind,omitempty"`
982
983
984
985 googleapi.ServerResponse `json:"-"`
986
987
988
989
990
991
992
993 ForceSendFields []string `json:"-"`
994
995
996
997
998
999
1000
1001 NullFields []string `json:"-"`
1002 }
1003
1004 func (s *SubscriptionsListResponse) MarshalJSON() ([]byte, error) {
1005 type NoMethod SubscriptionsListResponse
1006 raw := NoMethod(*s)
1007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1008 }
1009
1010
1011
1012 type TimelineItem struct {
1013
1014
1015
1016
1017
1018
1019
1020 Attachments []*Attachment `json:"attachments,omitempty"`
1021
1022
1023
1024
1025 BundleId string `json:"bundleId,omitempty"`
1026
1027
1028
1029 CanonicalUrl string `json:"canonicalUrl,omitempty"`
1030
1031
1032
1033 Created string `json:"created,omitempty"`
1034
1035
1036 Creator *Contact `json:"creator,omitempty"`
1037
1038
1039
1040
1041
1042
1043 DisplayTime string `json:"displayTime,omitempty"`
1044
1045
1046 Etag string `json:"etag,omitempty"`
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071 Html string `json:"html,omitempty"`
1072
1073
1074
1075 Id string `json:"id,omitempty"`
1076
1077
1078
1079
1080
1081 InReplyTo string `json:"inReplyTo,omitempty"`
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096 IsBundleCover bool `json:"isBundleCover,omitempty"`
1097
1098
1099
1100 IsDeleted bool `json:"isDeleted,omitempty"`
1101
1102
1103
1104
1105
1106
1107 IsPinned bool `json:"isPinned,omitempty"`
1108
1109
1110 Kind string `json:"kind,omitempty"`
1111
1112
1113 Location *Location `json:"location,omitempty"`
1114
1115
1116
1117 MenuItems []*MenuItem `json:"menuItems,omitempty"`
1118
1119
1120
1121 Notification *NotificationConfig `json:"notification,omitempty"`
1122
1123
1124
1125
1126
1127 PinScore int64 `json:"pinScore,omitempty"`
1128
1129
1130
1131 Recipients []*Contact `json:"recipients,omitempty"`
1132
1133
1134 SelfLink string `json:"selfLink,omitempty"`
1135
1136
1137
1138 SourceItemId string `json:"sourceItemId,omitempty"`
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149 SpeakableText string `json:"speakableText,omitempty"`
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164 SpeakableType string `json:"speakableType,omitempty"`
1165
1166
1167 Text string `json:"text,omitempty"`
1168
1169
1170 Title string `json:"title,omitempty"`
1171
1172
1173
1174 Updated string `json:"updated,omitempty"`
1175
1176
1177
1178 googleapi.ServerResponse `json:"-"`
1179
1180
1181
1182
1183
1184
1185
1186 ForceSendFields []string `json:"-"`
1187
1188
1189
1190
1191
1192
1193
1194 NullFields []string `json:"-"`
1195 }
1196
1197 func (s *TimelineItem) MarshalJSON() ([]byte, error) {
1198 type NoMethod TimelineItem
1199 raw := NoMethod(*s)
1200 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1201 }
1202
1203
1204
1205 type TimelineListResponse struct {
1206
1207 Items []*TimelineItem `json:"items,omitempty"`
1208
1209
1210 Kind string `json:"kind,omitempty"`
1211
1212
1213
1214 NextPageToken string `json:"nextPageToken,omitempty"`
1215
1216
1217
1218 googleapi.ServerResponse `json:"-"`
1219
1220
1221
1222
1223
1224
1225
1226 ForceSendFields []string `json:"-"`
1227
1228
1229
1230
1231
1232
1233
1234 NullFields []string `json:"-"`
1235 }
1236
1237 func (s *TimelineListResponse) MarshalJSON() ([]byte, error) {
1238 type NoMethod TimelineListResponse
1239 raw := NoMethod(*s)
1240 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1241 }
1242
1243
1244
1245 type UserAction struct {
1246
1247
1248
1249
1250 Payload string `json:"payload,omitempty"`
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264 Type string `json:"type,omitempty"`
1265
1266
1267
1268
1269
1270
1271
1272 ForceSendFields []string `json:"-"`
1273
1274
1275
1276
1277
1278
1279
1280 NullFields []string `json:"-"`
1281 }
1282
1283 func (s *UserAction) MarshalJSON() ([]byte, error) {
1284 type NoMethod UserAction
1285 raw := NoMethod(*s)
1286 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1287 }
1288
1289 type UserData struct {
1290 Key string `json:"key,omitempty"`
1291
1292 Value string `json:"value,omitempty"`
1293
1294
1295
1296
1297
1298
1299
1300 ForceSendFields []string `json:"-"`
1301
1302
1303
1304
1305
1306
1307
1308 NullFields []string `json:"-"`
1309 }
1310
1311 func (s *UserData) MarshalJSON() ([]byte, error) {
1312 type NoMethod UserData
1313 raw := NoMethod(*s)
1314 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1315 }
1316
1317
1318
1319 type AccountsInsertCall struct {
1320 s *Service
1321 userToken string
1322 accountType string
1323 accountName string
1324 account *Account
1325 urlParams_ gensupport.URLParams
1326 ctx_ context.Context
1327 header_ http.Header
1328 }
1329
1330
1331 func (r *AccountsService) Insert(userToken string, accountType string, accountName string, account *Account) *AccountsInsertCall {
1332 c := &AccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1333 c.userToken = userToken
1334 c.accountType = accountType
1335 c.accountName = accountName
1336 c.account = account
1337 return c
1338 }
1339
1340
1341
1342
1343 func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall {
1344 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1345 return c
1346 }
1347
1348
1349
1350
1351 func (c *AccountsInsertCall) Context(ctx context.Context) *AccountsInsertCall {
1352 c.ctx_ = ctx
1353 return c
1354 }
1355
1356
1357
1358 func (c *AccountsInsertCall) Header() http.Header {
1359 if c.header_ == nil {
1360 c.header_ = make(http.Header)
1361 }
1362 return c.header_
1363 }
1364
1365 func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, error) {
1366 reqHeaders := make(http.Header)
1367 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
1368 for k, v := range c.header_ {
1369 reqHeaders[k] = v
1370 }
1371 reqHeaders.Set("User-Agent", c.s.userAgent())
1372 var body io.Reader = nil
1373 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
1374 if err != nil {
1375 return nil, err
1376 }
1377 reqHeaders.Set("Content-Type", "application/json")
1378 c.urlParams_.Set("alt", alt)
1379 c.urlParams_.Set("prettyPrint", "false")
1380 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{userToken}/{accountType}/{accountName}")
1381 urls += "?" + c.urlParams_.Encode()
1382 req, err := http.NewRequest("POST", urls, body)
1383 if err != nil {
1384 return nil, err
1385 }
1386 req.Header = reqHeaders
1387 googleapi.Expand(req.URL, map[string]string{
1388 "userToken": c.userToken,
1389 "accountType": c.accountType,
1390 "accountName": c.accountName,
1391 })
1392 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1393 }
1394
1395
1396
1397
1398
1399
1400
1401
1402 func (c *AccountsInsertCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1403 gensupport.SetOptions(c.urlParams_, opts...)
1404 res, err := c.doRequest("json")
1405 if res != nil && res.StatusCode == http.StatusNotModified {
1406 if res.Body != nil {
1407 res.Body.Close()
1408 }
1409 return nil, &googleapi.Error{
1410 Code: res.StatusCode,
1411 Header: res.Header,
1412 }
1413 }
1414 if err != nil {
1415 return nil, err
1416 }
1417 defer googleapi.CloseBody(res)
1418 if err := googleapi.CheckResponse(res); err != nil {
1419 return nil, err
1420 }
1421 ret := &Account{
1422 ServerResponse: googleapi.ServerResponse{
1423 Header: res.Header,
1424 HTTPStatusCode: res.StatusCode,
1425 },
1426 }
1427 target := &ret
1428 if err := gensupport.DecodeResponse(target, res); err != nil {
1429 return nil, err
1430 }
1431 return ret, nil
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470 }
1471
1472
1473
1474 type ContactsDeleteCall struct {
1475 s *Service
1476 id string
1477 urlParams_ gensupport.URLParams
1478 ctx_ context.Context
1479 header_ http.Header
1480 }
1481
1482
1483 func (r *ContactsService) Delete(id string) *ContactsDeleteCall {
1484 c := &ContactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1485 c.id = id
1486 return c
1487 }
1488
1489
1490
1491
1492 func (c *ContactsDeleteCall) Fields(s ...googleapi.Field) *ContactsDeleteCall {
1493 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1494 return c
1495 }
1496
1497
1498
1499
1500 func (c *ContactsDeleteCall) Context(ctx context.Context) *ContactsDeleteCall {
1501 c.ctx_ = ctx
1502 return c
1503 }
1504
1505
1506
1507 func (c *ContactsDeleteCall) Header() http.Header {
1508 if c.header_ == nil {
1509 c.header_ = make(http.Header)
1510 }
1511 return c.header_
1512 }
1513
1514 func (c *ContactsDeleteCall) doRequest(alt string) (*http.Response, error) {
1515 reqHeaders := make(http.Header)
1516 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
1517 for k, v := range c.header_ {
1518 reqHeaders[k] = v
1519 }
1520 reqHeaders.Set("User-Agent", c.s.userAgent())
1521 var body io.Reader = nil
1522 c.urlParams_.Set("alt", alt)
1523 c.urlParams_.Set("prettyPrint", "false")
1524 urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
1525 urls += "?" + c.urlParams_.Encode()
1526 req, err := http.NewRequest("DELETE", urls, body)
1527 if err != nil {
1528 return nil, err
1529 }
1530 req.Header = reqHeaders
1531 googleapi.Expand(req.URL, map[string]string{
1532 "id": c.id,
1533 })
1534 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1535 }
1536
1537
1538 func (c *ContactsDeleteCall) Do(opts ...googleapi.CallOption) error {
1539 gensupport.SetOptions(c.urlParams_, opts...)
1540 res, err := c.doRequest("json")
1541 if err != nil {
1542 return err
1543 }
1544 defer googleapi.CloseBody(res)
1545 if err := googleapi.CheckResponse(res); err != nil {
1546 return err
1547 }
1548 return nil
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570 }
1571
1572
1573
1574 type ContactsGetCall struct {
1575 s *Service
1576 id string
1577 urlParams_ gensupport.URLParams
1578 ifNoneMatch_ string
1579 ctx_ context.Context
1580 header_ http.Header
1581 }
1582
1583
1584 func (r *ContactsService) Get(id string) *ContactsGetCall {
1585 c := &ContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1586 c.id = id
1587 return c
1588 }
1589
1590
1591
1592
1593 func (c *ContactsGetCall) Fields(s ...googleapi.Field) *ContactsGetCall {
1594 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1595 return c
1596 }
1597
1598
1599
1600
1601
1602
1603 func (c *ContactsGetCall) IfNoneMatch(entityTag string) *ContactsGetCall {
1604 c.ifNoneMatch_ = entityTag
1605 return c
1606 }
1607
1608
1609
1610
1611 func (c *ContactsGetCall) Context(ctx context.Context) *ContactsGetCall {
1612 c.ctx_ = ctx
1613 return c
1614 }
1615
1616
1617
1618 func (c *ContactsGetCall) Header() http.Header {
1619 if c.header_ == nil {
1620 c.header_ = make(http.Header)
1621 }
1622 return c.header_
1623 }
1624
1625 func (c *ContactsGetCall) doRequest(alt string) (*http.Response, error) {
1626 reqHeaders := make(http.Header)
1627 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
1628 for k, v := range c.header_ {
1629 reqHeaders[k] = v
1630 }
1631 reqHeaders.Set("User-Agent", c.s.userAgent())
1632 if c.ifNoneMatch_ != "" {
1633 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1634 }
1635 var body io.Reader = nil
1636 c.urlParams_.Set("alt", alt)
1637 c.urlParams_.Set("prettyPrint", "false")
1638 urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
1639 urls += "?" + c.urlParams_.Encode()
1640 req, err := http.NewRequest("GET", urls, body)
1641 if err != nil {
1642 return nil, err
1643 }
1644 req.Header = reqHeaders
1645 googleapi.Expand(req.URL, map[string]string{
1646 "id": c.id,
1647 })
1648 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1649 }
1650
1651
1652
1653
1654
1655
1656
1657
1658 func (c *ContactsGetCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
1659 gensupport.SetOptions(c.urlParams_, opts...)
1660 res, err := c.doRequest("json")
1661 if res != nil && res.StatusCode == http.StatusNotModified {
1662 if res.Body != nil {
1663 res.Body.Close()
1664 }
1665 return nil, &googleapi.Error{
1666 Code: res.StatusCode,
1667 Header: res.Header,
1668 }
1669 }
1670 if err != nil {
1671 return nil, err
1672 }
1673 defer googleapi.CloseBody(res)
1674 if err := googleapi.CheckResponse(res); err != nil {
1675 return nil, err
1676 }
1677 ret := &Contact{
1678 ServerResponse: googleapi.ServerResponse{
1679 Header: res.Header,
1680 HTTPStatusCode: res.StatusCode,
1681 },
1682 }
1683 target := &ret
1684 if err := gensupport.DecodeResponse(target, res); err != nil {
1685 return nil, err
1686 }
1687 return ret, nil
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712 }
1713
1714
1715
1716 type ContactsInsertCall struct {
1717 s *Service
1718 contact *Contact
1719 urlParams_ gensupport.URLParams
1720 ctx_ context.Context
1721 header_ http.Header
1722 }
1723
1724
1725 func (r *ContactsService) Insert(contact *Contact) *ContactsInsertCall {
1726 c := &ContactsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1727 c.contact = contact
1728 return c
1729 }
1730
1731
1732
1733
1734 func (c *ContactsInsertCall) Fields(s ...googleapi.Field) *ContactsInsertCall {
1735 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1736 return c
1737 }
1738
1739
1740
1741
1742 func (c *ContactsInsertCall) Context(ctx context.Context) *ContactsInsertCall {
1743 c.ctx_ = ctx
1744 return c
1745 }
1746
1747
1748
1749 func (c *ContactsInsertCall) Header() http.Header {
1750 if c.header_ == nil {
1751 c.header_ = make(http.Header)
1752 }
1753 return c.header_
1754 }
1755
1756 func (c *ContactsInsertCall) doRequest(alt string) (*http.Response, error) {
1757 reqHeaders := make(http.Header)
1758 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
1759 for k, v := range c.header_ {
1760 reqHeaders[k] = v
1761 }
1762 reqHeaders.Set("User-Agent", c.s.userAgent())
1763 var body io.Reader = nil
1764 body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
1765 if err != nil {
1766 return nil, err
1767 }
1768 reqHeaders.Set("Content-Type", "application/json")
1769 c.urlParams_.Set("alt", alt)
1770 c.urlParams_.Set("prettyPrint", "false")
1771 urls := googleapi.ResolveRelative(c.s.BasePath, "contacts")
1772 urls += "?" + c.urlParams_.Encode()
1773 req, err := http.NewRequest("POST", urls, body)
1774 if err != nil {
1775 return nil, err
1776 }
1777 req.Header = reqHeaders
1778 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1779 }
1780
1781
1782
1783
1784
1785
1786
1787
1788 func (c *ContactsInsertCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
1789 gensupport.SetOptions(c.urlParams_, opts...)
1790 res, err := c.doRequest("json")
1791 if res != nil && res.StatusCode == http.StatusNotModified {
1792 if res.Body != nil {
1793 res.Body.Close()
1794 }
1795 return nil, &googleapi.Error{
1796 Code: res.StatusCode,
1797 Header: res.Header,
1798 }
1799 }
1800 if err != nil {
1801 return nil, err
1802 }
1803 defer googleapi.CloseBody(res)
1804 if err := googleapi.CheckResponse(res); err != nil {
1805 return nil, err
1806 }
1807 ret := &Contact{
1808 ServerResponse: googleapi.ServerResponse{
1809 Header: res.Header,
1810 HTTPStatusCode: res.StatusCode,
1811 },
1812 }
1813 target := &ret
1814 if err := gensupport.DecodeResponse(target, res); err != nil {
1815 return nil, err
1816 }
1817 return ret, nil
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834 }
1835
1836
1837
1838 type ContactsListCall struct {
1839 s *Service
1840 urlParams_ gensupport.URLParams
1841 ifNoneMatch_ string
1842 ctx_ context.Context
1843 header_ http.Header
1844 }
1845
1846
1847 func (r *ContactsService) List() *ContactsListCall {
1848 c := &ContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1849 return c
1850 }
1851
1852
1853
1854
1855 func (c *ContactsListCall) Fields(s ...googleapi.Field) *ContactsListCall {
1856 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1857 return c
1858 }
1859
1860
1861
1862
1863
1864
1865 func (c *ContactsListCall) IfNoneMatch(entityTag string) *ContactsListCall {
1866 c.ifNoneMatch_ = entityTag
1867 return c
1868 }
1869
1870
1871
1872
1873 func (c *ContactsListCall) Context(ctx context.Context) *ContactsListCall {
1874 c.ctx_ = ctx
1875 return c
1876 }
1877
1878
1879
1880 func (c *ContactsListCall) Header() http.Header {
1881 if c.header_ == nil {
1882 c.header_ = make(http.Header)
1883 }
1884 return c.header_
1885 }
1886
1887 func (c *ContactsListCall) doRequest(alt string) (*http.Response, error) {
1888 reqHeaders := make(http.Header)
1889 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
1890 for k, v := range c.header_ {
1891 reqHeaders[k] = v
1892 }
1893 reqHeaders.Set("User-Agent", c.s.userAgent())
1894 if c.ifNoneMatch_ != "" {
1895 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1896 }
1897 var body io.Reader = nil
1898 c.urlParams_.Set("alt", alt)
1899 c.urlParams_.Set("prettyPrint", "false")
1900 urls := googleapi.ResolveRelative(c.s.BasePath, "contacts")
1901 urls += "?" + c.urlParams_.Encode()
1902 req, err := http.NewRequest("GET", urls, body)
1903 if err != nil {
1904 return nil, err
1905 }
1906 req.Header = reqHeaders
1907 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1908 }
1909
1910
1911
1912
1913
1914
1915
1916
1917 func (c *ContactsListCall) Do(opts ...googleapi.CallOption) (*ContactsListResponse, error) {
1918 gensupport.SetOptions(c.urlParams_, opts...)
1919 res, err := c.doRequest("json")
1920 if res != nil && res.StatusCode == http.StatusNotModified {
1921 if res.Body != nil {
1922 res.Body.Close()
1923 }
1924 return nil, &googleapi.Error{
1925 Code: res.StatusCode,
1926 Header: res.Header,
1927 }
1928 }
1929 if err != nil {
1930 return nil, err
1931 }
1932 defer googleapi.CloseBody(res)
1933 if err := googleapi.CheckResponse(res); err != nil {
1934 return nil, err
1935 }
1936 ret := &ContactsListResponse{
1937 ServerResponse: googleapi.ServerResponse{
1938 Header: res.Header,
1939 HTTPStatusCode: res.StatusCode,
1940 },
1941 }
1942 target := &ret
1943 if err := gensupport.DecodeResponse(target, res); err != nil {
1944 return nil, err
1945 }
1946 return ret, nil
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960 }
1961
1962
1963
1964 type ContactsPatchCall struct {
1965 s *Service
1966 id string
1967 contact *Contact
1968 urlParams_ gensupport.URLParams
1969 ctx_ context.Context
1970 header_ http.Header
1971 }
1972
1973
1974
1975 func (r *ContactsService) Patch(id string, contact *Contact) *ContactsPatchCall {
1976 c := &ContactsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1977 c.id = id
1978 c.contact = contact
1979 return c
1980 }
1981
1982
1983
1984
1985 func (c *ContactsPatchCall) Fields(s ...googleapi.Field) *ContactsPatchCall {
1986 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1987 return c
1988 }
1989
1990
1991
1992
1993 func (c *ContactsPatchCall) Context(ctx context.Context) *ContactsPatchCall {
1994 c.ctx_ = ctx
1995 return c
1996 }
1997
1998
1999
2000 func (c *ContactsPatchCall) Header() http.Header {
2001 if c.header_ == nil {
2002 c.header_ = make(http.Header)
2003 }
2004 return c.header_
2005 }
2006
2007 func (c *ContactsPatchCall) doRequest(alt string) (*http.Response, error) {
2008 reqHeaders := make(http.Header)
2009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2010 for k, v := range c.header_ {
2011 reqHeaders[k] = v
2012 }
2013 reqHeaders.Set("User-Agent", c.s.userAgent())
2014 var body io.Reader = nil
2015 body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
2016 if err != nil {
2017 return nil, err
2018 }
2019 reqHeaders.Set("Content-Type", "application/json")
2020 c.urlParams_.Set("alt", alt)
2021 c.urlParams_.Set("prettyPrint", "false")
2022 urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
2023 urls += "?" + c.urlParams_.Encode()
2024 req, err := http.NewRequest("PATCH", urls, body)
2025 if err != nil {
2026 return nil, err
2027 }
2028 req.Header = reqHeaders
2029 googleapi.Expand(req.URL, map[string]string{
2030 "id": c.id,
2031 })
2032 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2033 }
2034
2035
2036
2037
2038
2039
2040
2041
2042 func (c *ContactsPatchCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
2043 gensupport.SetOptions(c.urlParams_, opts...)
2044 res, err := c.doRequest("json")
2045 if res != nil && res.StatusCode == http.StatusNotModified {
2046 if res.Body != nil {
2047 res.Body.Close()
2048 }
2049 return nil, &googleapi.Error{
2050 Code: res.StatusCode,
2051 Header: res.Header,
2052 }
2053 }
2054 if err != nil {
2055 return nil, err
2056 }
2057 defer googleapi.CloseBody(res)
2058 if err := googleapi.CheckResponse(res); err != nil {
2059 return nil, err
2060 }
2061 ret := &Contact{
2062 ServerResponse: googleapi.ServerResponse{
2063 Header: res.Header,
2064 HTTPStatusCode: res.StatusCode,
2065 },
2066 }
2067 target := &ret
2068 if err := gensupport.DecodeResponse(target, res); err != nil {
2069 return nil, err
2070 }
2071 return ret, nil
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099 }
2100
2101
2102
2103 type ContactsUpdateCall struct {
2104 s *Service
2105 id string
2106 contact *Contact
2107 urlParams_ gensupport.URLParams
2108 ctx_ context.Context
2109 header_ http.Header
2110 }
2111
2112
2113 func (r *ContactsService) Update(id string, contact *Contact) *ContactsUpdateCall {
2114 c := &ContactsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2115 c.id = id
2116 c.contact = contact
2117 return c
2118 }
2119
2120
2121
2122
2123 func (c *ContactsUpdateCall) Fields(s ...googleapi.Field) *ContactsUpdateCall {
2124 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2125 return c
2126 }
2127
2128
2129
2130
2131 func (c *ContactsUpdateCall) Context(ctx context.Context) *ContactsUpdateCall {
2132 c.ctx_ = ctx
2133 return c
2134 }
2135
2136
2137
2138 func (c *ContactsUpdateCall) Header() http.Header {
2139 if c.header_ == nil {
2140 c.header_ = make(http.Header)
2141 }
2142 return c.header_
2143 }
2144
2145 func (c *ContactsUpdateCall) doRequest(alt string) (*http.Response, error) {
2146 reqHeaders := make(http.Header)
2147 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2148 for k, v := range c.header_ {
2149 reqHeaders[k] = v
2150 }
2151 reqHeaders.Set("User-Agent", c.s.userAgent())
2152 var body io.Reader = nil
2153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
2154 if err != nil {
2155 return nil, err
2156 }
2157 reqHeaders.Set("Content-Type", "application/json")
2158 c.urlParams_.Set("alt", alt)
2159 c.urlParams_.Set("prettyPrint", "false")
2160 urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
2161 urls += "?" + c.urlParams_.Encode()
2162 req, err := http.NewRequest("PUT", urls, body)
2163 if err != nil {
2164 return nil, err
2165 }
2166 req.Header = reqHeaders
2167 googleapi.Expand(req.URL, map[string]string{
2168 "id": c.id,
2169 })
2170 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2171 }
2172
2173
2174
2175
2176
2177
2178
2179
2180 func (c *ContactsUpdateCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
2181 gensupport.SetOptions(c.urlParams_, opts...)
2182 res, err := c.doRequest("json")
2183 if res != nil && res.StatusCode == http.StatusNotModified {
2184 if res.Body != nil {
2185 res.Body.Close()
2186 }
2187 return nil, &googleapi.Error{
2188 Code: res.StatusCode,
2189 Header: res.Header,
2190 }
2191 }
2192 if err != nil {
2193 return nil, err
2194 }
2195 defer googleapi.CloseBody(res)
2196 if err := googleapi.CheckResponse(res); err != nil {
2197 return nil, err
2198 }
2199 ret := &Contact{
2200 ServerResponse: googleapi.ServerResponse{
2201 Header: res.Header,
2202 HTTPStatusCode: res.StatusCode,
2203 },
2204 }
2205 target := &ret
2206 if err := gensupport.DecodeResponse(target, res); err != nil {
2207 return nil, err
2208 }
2209 return ret, nil
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237 }
2238
2239
2240
2241 type LocationsGetCall struct {
2242 s *Service
2243 id string
2244 urlParams_ gensupport.URLParams
2245 ifNoneMatch_ string
2246 ctx_ context.Context
2247 header_ http.Header
2248 }
2249
2250
2251 func (r *LocationsService) Get(id string) *LocationsGetCall {
2252 c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2253 c.id = id
2254 return c
2255 }
2256
2257
2258
2259
2260 func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
2261 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2262 return c
2263 }
2264
2265
2266
2267
2268
2269
2270 func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall {
2271 c.ifNoneMatch_ = entityTag
2272 return c
2273 }
2274
2275
2276
2277
2278 func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall {
2279 c.ctx_ = ctx
2280 return c
2281 }
2282
2283
2284
2285 func (c *LocationsGetCall) Header() http.Header {
2286 if c.header_ == nil {
2287 c.header_ = make(http.Header)
2288 }
2289 return c.header_
2290 }
2291
2292 func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) {
2293 reqHeaders := make(http.Header)
2294 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2295 for k, v := range c.header_ {
2296 reqHeaders[k] = v
2297 }
2298 reqHeaders.Set("User-Agent", c.s.userAgent())
2299 if c.ifNoneMatch_ != "" {
2300 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2301 }
2302 var body io.Reader = nil
2303 c.urlParams_.Set("alt", alt)
2304 c.urlParams_.Set("prettyPrint", "false")
2305 urls := googleapi.ResolveRelative(c.s.BasePath, "locations/{id}")
2306 urls += "?" + c.urlParams_.Encode()
2307 req, err := http.NewRequest("GET", urls, body)
2308 if err != nil {
2309 return nil, err
2310 }
2311 req.Header = reqHeaders
2312 googleapi.Expand(req.URL, map[string]string{
2313 "id": c.id,
2314 })
2315 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2316 }
2317
2318
2319
2320
2321
2322
2323
2324
2325 func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
2326 gensupport.SetOptions(c.urlParams_, opts...)
2327 res, err := c.doRequest("json")
2328 if res != nil && res.StatusCode == http.StatusNotModified {
2329 if res.Body != nil {
2330 res.Body.Close()
2331 }
2332 return nil, &googleapi.Error{
2333 Code: res.StatusCode,
2334 Header: res.Header,
2335 }
2336 }
2337 if err != nil {
2338 return nil, err
2339 }
2340 defer googleapi.CloseBody(res)
2341 if err := googleapi.CheckResponse(res); err != nil {
2342 return nil, err
2343 }
2344 ret := &Location{
2345 ServerResponse: googleapi.ServerResponse{
2346 Header: res.Header,
2347 HTTPStatusCode: res.StatusCode,
2348 },
2349 }
2350 target := &ret
2351 if err := gensupport.DecodeResponse(target, res); err != nil {
2352 return nil, err
2353 }
2354 return ret, nil
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380 }
2381
2382
2383
2384 type LocationsListCall struct {
2385 s *Service
2386 urlParams_ gensupport.URLParams
2387 ifNoneMatch_ string
2388 ctx_ context.Context
2389 header_ http.Header
2390 }
2391
2392
2393 func (r *LocationsService) List() *LocationsListCall {
2394 c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2395 return c
2396 }
2397
2398
2399
2400
2401 func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall {
2402 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2403 return c
2404 }
2405
2406
2407
2408
2409
2410
2411 func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall {
2412 c.ifNoneMatch_ = entityTag
2413 return c
2414 }
2415
2416
2417
2418
2419 func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall {
2420 c.ctx_ = ctx
2421 return c
2422 }
2423
2424
2425
2426 func (c *LocationsListCall) Header() http.Header {
2427 if c.header_ == nil {
2428 c.header_ = make(http.Header)
2429 }
2430 return c.header_
2431 }
2432
2433 func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) {
2434 reqHeaders := make(http.Header)
2435 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2436 for k, v := range c.header_ {
2437 reqHeaders[k] = v
2438 }
2439 reqHeaders.Set("User-Agent", c.s.userAgent())
2440 if c.ifNoneMatch_ != "" {
2441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2442 }
2443 var body io.Reader = nil
2444 c.urlParams_.Set("alt", alt)
2445 c.urlParams_.Set("prettyPrint", "false")
2446 urls := googleapi.ResolveRelative(c.s.BasePath, "locations")
2447 urls += "?" + c.urlParams_.Encode()
2448 req, err := http.NewRequest("GET", urls, body)
2449 if err != nil {
2450 return nil, err
2451 }
2452 req.Header = reqHeaders
2453 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2454 }
2455
2456
2457
2458
2459
2460
2461
2462
2463 func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*LocationsListResponse, error) {
2464 gensupport.SetOptions(c.urlParams_, opts...)
2465 res, err := c.doRequest("json")
2466 if res != nil && res.StatusCode == http.StatusNotModified {
2467 if res.Body != nil {
2468 res.Body.Close()
2469 }
2470 return nil, &googleapi.Error{
2471 Code: res.StatusCode,
2472 Header: res.Header,
2473 }
2474 }
2475 if err != nil {
2476 return nil, err
2477 }
2478 defer googleapi.CloseBody(res)
2479 if err := googleapi.CheckResponse(res); err != nil {
2480 return nil, err
2481 }
2482 ret := &LocationsListResponse{
2483 ServerResponse: googleapi.ServerResponse{
2484 Header: res.Header,
2485 HTTPStatusCode: res.StatusCode,
2486 },
2487 }
2488 target := &ret
2489 if err := gensupport.DecodeResponse(target, res); err != nil {
2490 return nil, err
2491 }
2492 return ret, nil
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507 }
2508
2509
2510
2511 type SettingsGetCall struct {
2512 s *Service
2513 id string
2514 urlParams_ gensupport.URLParams
2515 ifNoneMatch_ string
2516 ctx_ context.Context
2517 header_ http.Header
2518 }
2519
2520
2521 func (r *SettingsService) Get(id string) *SettingsGetCall {
2522 c := &SettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2523 c.id = id
2524 return c
2525 }
2526
2527
2528
2529
2530 func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall {
2531 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2532 return c
2533 }
2534
2535
2536
2537
2538
2539
2540 func (c *SettingsGetCall) IfNoneMatch(entityTag string) *SettingsGetCall {
2541 c.ifNoneMatch_ = entityTag
2542 return c
2543 }
2544
2545
2546
2547
2548 func (c *SettingsGetCall) Context(ctx context.Context) *SettingsGetCall {
2549 c.ctx_ = ctx
2550 return c
2551 }
2552
2553
2554
2555 func (c *SettingsGetCall) Header() http.Header {
2556 if c.header_ == nil {
2557 c.header_ = make(http.Header)
2558 }
2559 return c.header_
2560 }
2561
2562 func (c *SettingsGetCall) doRequest(alt string) (*http.Response, error) {
2563 reqHeaders := make(http.Header)
2564 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2565 for k, v := range c.header_ {
2566 reqHeaders[k] = v
2567 }
2568 reqHeaders.Set("User-Agent", c.s.userAgent())
2569 if c.ifNoneMatch_ != "" {
2570 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2571 }
2572 var body io.Reader = nil
2573 c.urlParams_.Set("alt", alt)
2574 c.urlParams_.Set("prettyPrint", "false")
2575 urls := googleapi.ResolveRelative(c.s.BasePath, "settings/{id}")
2576 urls += "?" + c.urlParams_.Encode()
2577 req, err := http.NewRequest("GET", urls, body)
2578 if err != nil {
2579 return nil, err
2580 }
2581 req.Header = reqHeaders
2582 googleapi.Expand(req.URL, map[string]string{
2583 "id": c.id,
2584 })
2585 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2586 }
2587
2588
2589
2590
2591
2592
2593
2594
2595 func (c *SettingsGetCall) Do(opts ...googleapi.CallOption) (*Setting, error) {
2596 gensupport.SetOptions(c.urlParams_, opts...)
2597 res, err := c.doRequest("json")
2598 if res != nil && res.StatusCode == http.StatusNotModified {
2599 if res.Body != nil {
2600 res.Body.Close()
2601 }
2602 return nil, &googleapi.Error{
2603 Code: res.StatusCode,
2604 Header: res.Header,
2605 }
2606 }
2607 if err != nil {
2608 return nil, err
2609 }
2610 defer googleapi.CloseBody(res)
2611 if err := googleapi.CheckResponse(res); err != nil {
2612 return nil, err
2613 }
2614 ret := &Setting{
2615 ServerResponse: googleapi.ServerResponse{
2616 Header: res.Header,
2617 HTTPStatusCode: res.StatusCode,
2618 },
2619 }
2620 target := &ret
2621 if err := gensupport.DecodeResponse(target, res); err != nil {
2622 return nil, err
2623 }
2624 return ret, nil
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649 }
2650
2651
2652
2653 type SubscriptionsDeleteCall struct {
2654 s *Service
2655 id string
2656 urlParams_ gensupport.URLParams
2657 ctx_ context.Context
2658 header_ http.Header
2659 }
2660
2661
2662 func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
2663 c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2664 c.id = id
2665 return c
2666 }
2667
2668
2669
2670
2671 func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
2672 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2673 return c
2674 }
2675
2676
2677
2678
2679 func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
2680 c.ctx_ = ctx
2681 return c
2682 }
2683
2684
2685
2686 func (c *SubscriptionsDeleteCall) Header() http.Header {
2687 if c.header_ == nil {
2688 c.header_ = make(http.Header)
2689 }
2690 return c.header_
2691 }
2692
2693 func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
2694 reqHeaders := make(http.Header)
2695 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2696 for k, v := range c.header_ {
2697 reqHeaders[k] = v
2698 }
2699 reqHeaders.Set("User-Agent", c.s.userAgent())
2700 var body io.Reader = nil
2701 c.urlParams_.Set("alt", alt)
2702 c.urlParams_.Set("prettyPrint", "false")
2703 urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}")
2704 urls += "?" + c.urlParams_.Encode()
2705 req, err := http.NewRequest("DELETE", urls, body)
2706 if err != nil {
2707 return nil, err
2708 }
2709 req.Header = reqHeaders
2710 googleapi.Expand(req.URL, map[string]string{
2711 "id": c.id,
2712 })
2713 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2714 }
2715
2716
2717 func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
2718 gensupport.SetOptions(c.urlParams_, opts...)
2719 res, err := c.doRequest("json")
2720 if err != nil {
2721 return err
2722 }
2723 defer googleapi.CloseBody(res)
2724 if err := googleapi.CheckResponse(res); err != nil {
2725 return err
2726 }
2727 return nil
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749 }
2750
2751
2752
2753 type SubscriptionsInsertCall struct {
2754 s *Service
2755 subscription *Subscription
2756 urlParams_ gensupport.URLParams
2757 ctx_ context.Context
2758 header_ http.Header
2759 }
2760
2761
2762 func (r *SubscriptionsService) Insert(subscription *Subscription) *SubscriptionsInsertCall {
2763 c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2764 c.subscription = subscription
2765 return c
2766 }
2767
2768
2769
2770
2771 func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
2772 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2773 return c
2774 }
2775
2776
2777
2778
2779 func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
2780 c.ctx_ = ctx
2781 return c
2782 }
2783
2784
2785
2786 func (c *SubscriptionsInsertCall) Header() http.Header {
2787 if c.header_ == nil {
2788 c.header_ = make(http.Header)
2789 }
2790 return c.header_
2791 }
2792
2793 func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
2794 reqHeaders := make(http.Header)
2795 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2796 for k, v := range c.header_ {
2797 reqHeaders[k] = v
2798 }
2799 reqHeaders.Set("User-Agent", c.s.userAgent())
2800 var body io.Reader = nil
2801 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
2802 if err != nil {
2803 return nil, err
2804 }
2805 reqHeaders.Set("Content-Type", "application/json")
2806 c.urlParams_.Set("alt", alt)
2807 c.urlParams_.Set("prettyPrint", "false")
2808 urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
2809 urls += "?" + c.urlParams_.Encode()
2810 req, err := http.NewRequest("POST", urls, body)
2811 if err != nil {
2812 return nil, err
2813 }
2814 req.Header = reqHeaders
2815 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2816 }
2817
2818
2819
2820
2821
2822
2823
2824
2825 func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
2826 gensupport.SetOptions(c.urlParams_, opts...)
2827 res, err := c.doRequest("json")
2828 if res != nil && res.StatusCode == http.StatusNotModified {
2829 if res.Body != nil {
2830 res.Body.Close()
2831 }
2832 return nil, &googleapi.Error{
2833 Code: res.StatusCode,
2834 Header: res.Header,
2835 }
2836 }
2837 if err != nil {
2838 return nil, err
2839 }
2840 defer googleapi.CloseBody(res)
2841 if err := googleapi.CheckResponse(res); err != nil {
2842 return nil, err
2843 }
2844 ret := &Subscription{
2845 ServerResponse: googleapi.ServerResponse{
2846 Header: res.Header,
2847 HTTPStatusCode: res.StatusCode,
2848 },
2849 }
2850 target := &ret
2851 if err := gensupport.DecodeResponse(target, res); err != nil {
2852 return nil, err
2853 }
2854 return ret, nil
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871 }
2872
2873
2874
2875 type SubscriptionsListCall struct {
2876 s *Service
2877 urlParams_ gensupport.URLParams
2878 ifNoneMatch_ string
2879 ctx_ context.Context
2880 header_ http.Header
2881 }
2882
2883
2884
2885 func (r *SubscriptionsService) List() *SubscriptionsListCall {
2886 c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2887 return c
2888 }
2889
2890
2891
2892
2893 func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
2894 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2895 return c
2896 }
2897
2898
2899
2900
2901
2902
2903 func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
2904 c.ifNoneMatch_ = entityTag
2905 return c
2906 }
2907
2908
2909
2910
2911 func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
2912 c.ctx_ = ctx
2913 return c
2914 }
2915
2916
2917
2918 func (c *SubscriptionsListCall) Header() http.Header {
2919 if c.header_ == nil {
2920 c.header_ = make(http.Header)
2921 }
2922 return c.header_
2923 }
2924
2925 func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
2926 reqHeaders := make(http.Header)
2927 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
2928 for k, v := range c.header_ {
2929 reqHeaders[k] = v
2930 }
2931 reqHeaders.Set("User-Agent", c.s.userAgent())
2932 if c.ifNoneMatch_ != "" {
2933 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2934 }
2935 var body io.Reader = nil
2936 c.urlParams_.Set("alt", alt)
2937 c.urlParams_.Set("prettyPrint", "false")
2938 urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
2939 urls += "?" + c.urlParams_.Encode()
2940 req, err := http.NewRequest("GET", urls, body)
2941 if err != nil {
2942 return nil, err
2943 }
2944 req.Header = reqHeaders
2945 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2946 }
2947
2948
2949
2950
2951
2952
2953
2954
2955 func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*SubscriptionsListResponse, error) {
2956 gensupport.SetOptions(c.urlParams_, opts...)
2957 res, err := c.doRequest("json")
2958 if res != nil && res.StatusCode == http.StatusNotModified {
2959 if res.Body != nil {
2960 res.Body.Close()
2961 }
2962 return nil, &googleapi.Error{
2963 Code: res.StatusCode,
2964 Header: res.Header,
2965 }
2966 }
2967 if err != nil {
2968 return nil, err
2969 }
2970 defer googleapi.CloseBody(res)
2971 if err := googleapi.CheckResponse(res); err != nil {
2972 return nil, err
2973 }
2974 ret := &SubscriptionsListResponse{
2975 ServerResponse: googleapi.ServerResponse{
2976 Header: res.Header,
2977 HTTPStatusCode: res.StatusCode,
2978 },
2979 }
2980 target := &ret
2981 if err := gensupport.DecodeResponse(target, res); err != nil {
2982 return nil, err
2983 }
2984 return ret, nil
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998 }
2999
3000
3001
3002 type SubscriptionsUpdateCall struct {
3003 s *Service
3004 id string
3005 subscription *Subscription
3006 urlParams_ gensupport.URLParams
3007 ctx_ context.Context
3008 header_ http.Header
3009 }
3010
3011
3012 func (r *SubscriptionsService) Update(id string, subscription *Subscription) *SubscriptionsUpdateCall {
3013 c := &SubscriptionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3014 c.id = id
3015 c.subscription = subscription
3016 return c
3017 }
3018
3019
3020
3021
3022 func (c *SubscriptionsUpdateCall) Fields(s ...googleapi.Field) *SubscriptionsUpdateCall {
3023 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3024 return c
3025 }
3026
3027
3028
3029
3030 func (c *SubscriptionsUpdateCall) Context(ctx context.Context) *SubscriptionsUpdateCall {
3031 c.ctx_ = ctx
3032 return c
3033 }
3034
3035
3036
3037 func (c *SubscriptionsUpdateCall) Header() http.Header {
3038 if c.header_ == nil {
3039 c.header_ = make(http.Header)
3040 }
3041 return c.header_
3042 }
3043
3044 func (c *SubscriptionsUpdateCall) doRequest(alt string) (*http.Response, error) {
3045 reqHeaders := make(http.Header)
3046 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
3047 for k, v := range c.header_ {
3048 reqHeaders[k] = v
3049 }
3050 reqHeaders.Set("User-Agent", c.s.userAgent())
3051 var body io.Reader = nil
3052 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
3053 if err != nil {
3054 return nil, err
3055 }
3056 reqHeaders.Set("Content-Type", "application/json")
3057 c.urlParams_.Set("alt", alt)
3058 c.urlParams_.Set("prettyPrint", "false")
3059 urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}")
3060 urls += "?" + c.urlParams_.Encode()
3061 req, err := http.NewRequest("PUT", urls, body)
3062 if err != nil {
3063 return nil, err
3064 }
3065 req.Header = reqHeaders
3066 googleapi.Expand(req.URL, map[string]string{
3067 "id": c.id,
3068 })
3069 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3070 }
3071
3072
3073
3074
3075
3076
3077
3078
3079 func (c *SubscriptionsUpdateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
3080 gensupport.SetOptions(c.urlParams_, opts...)
3081 res, err := c.doRequest("json")
3082 if res != nil && res.StatusCode == http.StatusNotModified {
3083 if res.Body != nil {
3084 res.Body.Close()
3085 }
3086 return nil, &googleapi.Error{
3087 Code: res.StatusCode,
3088 Header: res.Header,
3089 }
3090 }
3091 if err != nil {
3092 return nil, err
3093 }
3094 defer googleapi.CloseBody(res)
3095 if err := googleapi.CheckResponse(res); err != nil {
3096 return nil, err
3097 }
3098 ret := &Subscription{
3099 ServerResponse: googleapi.ServerResponse{
3100 Header: res.Header,
3101 HTTPStatusCode: res.StatusCode,
3102 },
3103 }
3104 target := &ret
3105 if err := gensupport.DecodeResponse(target, res); err != nil {
3106 return nil, err
3107 }
3108 return ret, nil
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136 }
3137
3138
3139
3140 type TimelineDeleteCall struct {
3141 s *Service
3142 id string
3143 urlParams_ gensupport.URLParams
3144 ctx_ context.Context
3145 header_ http.Header
3146 }
3147
3148
3149 func (r *TimelineService) Delete(id string) *TimelineDeleteCall {
3150 c := &TimelineDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3151 c.id = id
3152 return c
3153 }
3154
3155
3156
3157
3158 func (c *TimelineDeleteCall) Fields(s ...googleapi.Field) *TimelineDeleteCall {
3159 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3160 return c
3161 }
3162
3163
3164
3165
3166 func (c *TimelineDeleteCall) Context(ctx context.Context) *TimelineDeleteCall {
3167 c.ctx_ = ctx
3168 return c
3169 }
3170
3171
3172
3173 func (c *TimelineDeleteCall) Header() http.Header {
3174 if c.header_ == nil {
3175 c.header_ = make(http.Header)
3176 }
3177 return c.header_
3178 }
3179
3180 func (c *TimelineDeleteCall) doRequest(alt string) (*http.Response, error) {
3181 reqHeaders := make(http.Header)
3182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
3183 for k, v := range c.header_ {
3184 reqHeaders[k] = v
3185 }
3186 reqHeaders.Set("User-Agent", c.s.userAgent())
3187 var body io.Reader = nil
3188 c.urlParams_.Set("alt", alt)
3189 c.urlParams_.Set("prettyPrint", "false")
3190 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
3191 urls += "?" + c.urlParams_.Encode()
3192 req, err := http.NewRequest("DELETE", urls, body)
3193 if err != nil {
3194 return nil, err
3195 }
3196 req.Header = reqHeaders
3197 googleapi.Expand(req.URL, map[string]string{
3198 "id": c.id,
3199 })
3200 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3201 }
3202
3203
3204 func (c *TimelineDeleteCall) Do(opts ...googleapi.CallOption) error {
3205 gensupport.SetOptions(c.urlParams_, opts...)
3206 res, err := c.doRequest("json")
3207 if err != nil {
3208 return err
3209 }
3210 defer googleapi.CloseBody(res)
3211 if err := googleapi.CheckResponse(res); err != nil {
3212 return err
3213 }
3214 return nil
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237 }
3238
3239
3240
3241 type TimelineGetCall struct {
3242 s *Service
3243 id string
3244 urlParams_ gensupport.URLParams
3245 ifNoneMatch_ string
3246 ctx_ context.Context
3247 header_ http.Header
3248 }
3249
3250
3251 func (r *TimelineService) Get(id string) *TimelineGetCall {
3252 c := &TimelineGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3253 c.id = id
3254 return c
3255 }
3256
3257
3258
3259
3260 func (c *TimelineGetCall) Fields(s ...googleapi.Field) *TimelineGetCall {
3261 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3262 return c
3263 }
3264
3265
3266
3267
3268
3269
3270 func (c *TimelineGetCall) IfNoneMatch(entityTag string) *TimelineGetCall {
3271 c.ifNoneMatch_ = entityTag
3272 return c
3273 }
3274
3275
3276
3277
3278 func (c *TimelineGetCall) Context(ctx context.Context) *TimelineGetCall {
3279 c.ctx_ = ctx
3280 return c
3281 }
3282
3283
3284
3285 func (c *TimelineGetCall) Header() http.Header {
3286 if c.header_ == nil {
3287 c.header_ = make(http.Header)
3288 }
3289 return c.header_
3290 }
3291
3292 func (c *TimelineGetCall) doRequest(alt string) (*http.Response, error) {
3293 reqHeaders := make(http.Header)
3294 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
3295 for k, v := range c.header_ {
3296 reqHeaders[k] = v
3297 }
3298 reqHeaders.Set("User-Agent", c.s.userAgent())
3299 if c.ifNoneMatch_ != "" {
3300 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3301 }
3302 var body io.Reader = nil
3303 c.urlParams_.Set("alt", alt)
3304 c.urlParams_.Set("prettyPrint", "false")
3305 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
3306 urls += "?" + c.urlParams_.Encode()
3307 req, err := http.NewRequest("GET", urls, body)
3308 if err != nil {
3309 return nil, err
3310 }
3311 req.Header = reqHeaders
3312 googleapi.Expand(req.URL, map[string]string{
3313 "id": c.id,
3314 })
3315 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3316 }
3317
3318
3319
3320
3321
3322
3323
3324
3325 func (c *TimelineGetCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
3326 gensupport.SetOptions(c.urlParams_, opts...)
3327 res, err := c.doRequest("json")
3328 if res != nil && res.StatusCode == http.StatusNotModified {
3329 if res.Body != nil {
3330 res.Body.Close()
3331 }
3332 return nil, &googleapi.Error{
3333 Code: res.StatusCode,
3334 Header: res.Header,
3335 }
3336 }
3337 if err != nil {
3338 return nil, err
3339 }
3340 defer googleapi.CloseBody(res)
3341 if err := googleapi.CheckResponse(res); err != nil {
3342 return nil, err
3343 }
3344 ret := &TimelineItem{
3345 ServerResponse: googleapi.ServerResponse{
3346 Header: res.Header,
3347 HTTPStatusCode: res.StatusCode,
3348 },
3349 }
3350 target := &ret
3351 if err := gensupport.DecodeResponse(target, res); err != nil {
3352 return nil, err
3353 }
3354 return ret, nil
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380 }
3381
3382
3383
3384 type TimelineInsertCall struct {
3385 s *Service
3386 timelineitem *TimelineItem
3387 urlParams_ gensupport.URLParams
3388 mediaInfo_ *gensupport.MediaInfo
3389 ctx_ context.Context
3390 header_ http.Header
3391 }
3392
3393
3394 func (r *TimelineService) Insert(timelineitem *TimelineItem) *TimelineInsertCall {
3395 c := &TimelineInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3396 c.timelineitem = timelineitem
3397 return c
3398 }
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408 func (c *TimelineInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *TimelineInsertCall {
3409 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
3410 return c
3411 }
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422 func (c *TimelineInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineInsertCall {
3423 c.ctx_ = ctx
3424 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
3425 return c
3426 }
3427
3428
3429
3430
3431
3432 func (c *TimelineInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineInsertCall {
3433 c.mediaInfo_.SetProgressUpdater(pu)
3434 return c
3435 }
3436
3437
3438
3439
3440 func (c *TimelineInsertCall) Fields(s ...googleapi.Field) *TimelineInsertCall {
3441 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3442 return c
3443 }
3444
3445
3446
3447
3448
3449
3450 func (c *TimelineInsertCall) Context(ctx context.Context) *TimelineInsertCall {
3451 c.ctx_ = ctx
3452 return c
3453 }
3454
3455
3456
3457 func (c *TimelineInsertCall) Header() http.Header {
3458 if c.header_ == nil {
3459 c.header_ = make(http.Header)
3460 }
3461 return c.header_
3462 }
3463
3464 func (c *TimelineInsertCall) doRequest(alt string) (*http.Response, error) {
3465 reqHeaders := make(http.Header)
3466 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
3467 for k, v := range c.header_ {
3468 reqHeaders[k] = v
3469 }
3470 reqHeaders.Set("User-Agent", c.s.userAgent())
3471 var body io.Reader = nil
3472 body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
3473 if err != nil {
3474 return nil, err
3475 }
3476 reqHeaders.Set("Content-Type", "application/json")
3477 c.urlParams_.Set("alt", alt)
3478 c.urlParams_.Set("prettyPrint", "false")
3479 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline")
3480 if c.mediaInfo_ != nil {
3481 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/mirror/v1/timeline")
3482 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
3483 }
3484 if body == nil {
3485 body = new(bytes.Buffer)
3486 reqHeaders.Set("Content-Type", "application/json")
3487 }
3488 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
3489 defer cleanup()
3490 urls += "?" + c.urlParams_.Encode()
3491 req, err := http.NewRequest("POST", urls, body)
3492 if err != nil {
3493 return nil, err
3494 }
3495 req.Header = reqHeaders
3496 req.GetBody = getBody
3497 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3498 }
3499
3500
3501
3502
3503
3504
3505
3506
3507 func (c *TimelineInsertCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
3508 gensupport.SetOptions(c.urlParams_, opts...)
3509 res, err := c.doRequest("json")
3510 if res != nil && res.StatusCode == http.StatusNotModified {
3511 if res.Body != nil {
3512 res.Body.Close()
3513 }
3514 return nil, &googleapi.Error{
3515 Code: res.StatusCode,
3516 Header: res.Header,
3517 }
3518 }
3519 if err != nil {
3520 return nil, err
3521 }
3522 defer googleapi.CloseBody(res)
3523 if err := googleapi.CheckResponse(res); err != nil {
3524 return nil, err
3525 }
3526 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
3527 if rx != nil {
3528 rx.Client = c.s.client
3529 rx.UserAgent = c.s.userAgent()
3530 ctx := c.ctx_
3531 if ctx == nil {
3532 ctx = context.TODO()
3533 }
3534 res, err = rx.Upload(ctx)
3535 if err != nil {
3536 return nil, err
3537 }
3538 defer res.Body.Close()
3539 if err := googleapi.CheckResponse(res); err != nil {
3540 return nil, err
3541 }
3542 }
3543 ret := &TimelineItem{
3544 ServerResponse: googleapi.ServerResponse{
3545 Header: res.Header,
3546 HTTPStatusCode: res.StatusCode,
3547 },
3548 }
3549 target := &ret
3550 if err := gensupport.DecodeResponse(target, res); err != nil {
3551 return nil, err
3552 }
3553 return ret, nil
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590 }
3591
3592
3593
3594 type TimelineListCall struct {
3595 s *Service
3596 urlParams_ gensupport.URLParams
3597 ifNoneMatch_ string
3598 ctx_ context.Context
3599 header_ http.Header
3600 }
3601
3602
3603 func (r *TimelineService) List() *TimelineListCall {
3604 c := &TimelineListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3605 return c
3606 }
3607
3608
3609
3610 func (c *TimelineListCall) BundleId(bundleId string) *TimelineListCall {
3611 c.urlParams_.Set("bundleId", bundleId)
3612 return c
3613 }
3614
3615
3616
3617 func (c *TimelineListCall) IncludeDeleted(includeDeleted bool) *TimelineListCall {
3618 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
3619 return c
3620 }
3621
3622
3623
3624 func (c *TimelineListCall) MaxResults(maxResults int64) *TimelineListCall {
3625 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3626 return c
3627 }
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641 func (c *TimelineListCall) OrderBy(orderBy string) *TimelineListCall {
3642 c.urlParams_.Set("orderBy", orderBy)
3643 return c
3644 }
3645
3646
3647
3648 func (c *TimelineListCall) PageToken(pageToken string) *TimelineListCall {
3649 c.urlParams_.Set("pageToken", pageToken)
3650 return c
3651 }
3652
3653
3654
3655 func (c *TimelineListCall) PinnedOnly(pinnedOnly bool) *TimelineListCall {
3656 c.urlParams_.Set("pinnedOnly", fmt.Sprint(pinnedOnly))
3657 return c
3658 }
3659
3660
3661
3662 func (c *TimelineListCall) SourceItemId(sourceItemId string) *TimelineListCall {
3663 c.urlParams_.Set("sourceItemId", sourceItemId)
3664 return c
3665 }
3666
3667
3668
3669
3670 func (c *TimelineListCall) Fields(s ...googleapi.Field) *TimelineListCall {
3671 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3672 return c
3673 }
3674
3675
3676
3677
3678
3679
3680 func (c *TimelineListCall) IfNoneMatch(entityTag string) *TimelineListCall {
3681 c.ifNoneMatch_ = entityTag
3682 return c
3683 }
3684
3685
3686
3687
3688 func (c *TimelineListCall) Context(ctx context.Context) *TimelineListCall {
3689 c.ctx_ = ctx
3690 return c
3691 }
3692
3693
3694
3695 func (c *TimelineListCall) Header() http.Header {
3696 if c.header_ == nil {
3697 c.header_ = make(http.Header)
3698 }
3699 return c.header_
3700 }
3701
3702 func (c *TimelineListCall) doRequest(alt string) (*http.Response, error) {
3703 reqHeaders := make(http.Header)
3704 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
3705 for k, v := range c.header_ {
3706 reqHeaders[k] = v
3707 }
3708 reqHeaders.Set("User-Agent", c.s.userAgent())
3709 if c.ifNoneMatch_ != "" {
3710 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3711 }
3712 var body io.Reader = nil
3713 c.urlParams_.Set("alt", alt)
3714 c.urlParams_.Set("prettyPrint", "false")
3715 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline")
3716 urls += "?" + c.urlParams_.Encode()
3717 req, err := http.NewRequest("GET", urls, body)
3718 if err != nil {
3719 return nil, err
3720 }
3721 req.Header = reqHeaders
3722 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3723 }
3724
3725
3726
3727
3728
3729
3730
3731
3732 func (c *TimelineListCall) Do(opts ...googleapi.CallOption) (*TimelineListResponse, error) {
3733 gensupport.SetOptions(c.urlParams_, opts...)
3734 res, err := c.doRequest("json")
3735 if res != nil && res.StatusCode == http.StatusNotModified {
3736 if res.Body != nil {
3737 res.Body.Close()
3738 }
3739 return nil, &googleapi.Error{
3740 Code: res.StatusCode,
3741 Header: res.Header,
3742 }
3743 }
3744 if err != nil {
3745 return nil, err
3746 }
3747 defer googleapi.CloseBody(res)
3748 if err := googleapi.CheckResponse(res); err != nil {
3749 return nil, err
3750 }
3751 ret := &TimelineListResponse{
3752 ServerResponse: googleapi.ServerResponse{
3753 Header: res.Header,
3754 HTTPStatusCode: res.StatusCode,
3755 },
3756 }
3757 target := &ret
3758 if err := gensupport.DecodeResponse(target, res); err != nil {
3759 return nil, err
3760 }
3761 return ret, nil
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822 }
3823
3824
3825
3826
3827 func (c *TimelineListCall) Pages(ctx context.Context, f func(*TimelineListResponse) error) error {
3828 c.ctx_ = ctx
3829 defer c.PageToken(c.urlParams_.Get("pageToken"))
3830 for {
3831 x, err := c.Do()
3832 if err != nil {
3833 return err
3834 }
3835 if err := f(x); err != nil {
3836 return err
3837 }
3838 if x.NextPageToken == "" {
3839 return nil
3840 }
3841 c.PageToken(x.NextPageToken)
3842 }
3843 }
3844
3845
3846
3847 type TimelinePatchCall struct {
3848 s *Service
3849 id string
3850 timelineitem *TimelineItem
3851 urlParams_ gensupport.URLParams
3852 ctx_ context.Context
3853 header_ http.Header
3854 }
3855
3856
3857
3858 func (r *TimelineService) Patch(id string, timelineitem *TimelineItem) *TimelinePatchCall {
3859 c := &TimelinePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3860 c.id = id
3861 c.timelineitem = timelineitem
3862 return c
3863 }
3864
3865
3866
3867
3868 func (c *TimelinePatchCall) Fields(s ...googleapi.Field) *TimelinePatchCall {
3869 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3870 return c
3871 }
3872
3873
3874
3875
3876 func (c *TimelinePatchCall) Context(ctx context.Context) *TimelinePatchCall {
3877 c.ctx_ = ctx
3878 return c
3879 }
3880
3881
3882
3883 func (c *TimelinePatchCall) Header() http.Header {
3884 if c.header_ == nil {
3885 c.header_ = make(http.Header)
3886 }
3887 return c.header_
3888 }
3889
3890 func (c *TimelinePatchCall) doRequest(alt string) (*http.Response, error) {
3891 reqHeaders := make(http.Header)
3892 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
3893 for k, v := range c.header_ {
3894 reqHeaders[k] = v
3895 }
3896 reqHeaders.Set("User-Agent", c.s.userAgent())
3897 var body io.Reader = nil
3898 body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
3899 if err != nil {
3900 return nil, err
3901 }
3902 reqHeaders.Set("Content-Type", "application/json")
3903 c.urlParams_.Set("alt", alt)
3904 c.urlParams_.Set("prettyPrint", "false")
3905 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
3906 urls += "?" + c.urlParams_.Encode()
3907 req, err := http.NewRequest("PATCH", urls, body)
3908 if err != nil {
3909 return nil, err
3910 }
3911 req.Header = reqHeaders
3912 googleapi.Expand(req.URL, map[string]string{
3913 "id": c.id,
3914 })
3915 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3916 }
3917
3918
3919
3920
3921
3922
3923
3924
3925 func (c *TimelinePatchCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
3926 gensupport.SetOptions(c.urlParams_, opts...)
3927 res, err := c.doRequest("json")
3928 if res != nil && res.StatusCode == http.StatusNotModified {
3929 if res.Body != nil {
3930 res.Body.Close()
3931 }
3932 return nil, &googleapi.Error{
3933 Code: res.StatusCode,
3934 Header: res.Header,
3935 }
3936 }
3937 if err != nil {
3938 return nil, err
3939 }
3940 defer googleapi.CloseBody(res)
3941 if err := googleapi.CheckResponse(res); err != nil {
3942 return nil, err
3943 }
3944 ret := &TimelineItem{
3945 ServerResponse: googleapi.ServerResponse{
3946 Header: res.Header,
3947 HTTPStatusCode: res.StatusCode,
3948 },
3949 }
3950 target := &ret
3951 if err := gensupport.DecodeResponse(target, res); err != nil {
3952 return nil, err
3953 }
3954 return ret, nil
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983 }
3984
3985
3986
3987 type TimelineUpdateCall struct {
3988 s *Service
3989 id string
3990 timelineitem *TimelineItem
3991 urlParams_ gensupport.URLParams
3992 mediaInfo_ *gensupport.MediaInfo
3993 ctx_ context.Context
3994 header_ http.Header
3995 }
3996
3997
3998 func (r *TimelineService) Update(id string, timelineitem *TimelineItem) *TimelineUpdateCall {
3999 c := &TimelineUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4000 c.id = id
4001 c.timelineitem = timelineitem
4002 return c
4003 }
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013 func (c *TimelineUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *TimelineUpdateCall {
4014 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
4015 return c
4016 }
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027 func (c *TimelineUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineUpdateCall {
4028 c.ctx_ = ctx
4029 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
4030 return c
4031 }
4032
4033
4034
4035
4036
4037 func (c *TimelineUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineUpdateCall {
4038 c.mediaInfo_.SetProgressUpdater(pu)
4039 return c
4040 }
4041
4042
4043
4044
4045 func (c *TimelineUpdateCall) Fields(s ...googleapi.Field) *TimelineUpdateCall {
4046 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4047 return c
4048 }
4049
4050
4051
4052
4053
4054
4055 func (c *TimelineUpdateCall) Context(ctx context.Context) *TimelineUpdateCall {
4056 c.ctx_ = ctx
4057 return c
4058 }
4059
4060
4061
4062 func (c *TimelineUpdateCall) Header() http.Header {
4063 if c.header_ == nil {
4064 c.header_ = make(http.Header)
4065 }
4066 return c.header_
4067 }
4068
4069 func (c *TimelineUpdateCall) doRequest(alt string) (*http.Response, error) {
4070 reqHeaders := make(http.Header)
4071 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
4072 for k, v := range c.header_ {
4073 reqHeaders[k] = v
4074 }
4075 reqHeaders.Set("User-Agent", c.s.userAgent())
4076 var body io.Reader = nil
4077 body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
4078 if err != nil {
4079 return nil, err
4080 }
4081 reqHeaders.Set("Content-Type", "application/json")
4082 c.urlParams_.Set("alt", alt)
4083 c.urlParams_.Set("prettyPrint", "false")
4084 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
4085 if c.mediaInfo_ != nil {
4086 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/mirror/v1/timeline/{id}")
4087 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
4088 }
4089 if body == nil {
4090 body = new(bytes.Buffer)
4091 reqHeaders.Set("Content-Type", "application/json")
4092 }
4093 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
4094 defer cleanup()
4095 urls += "?" + c.urlParams_.Encode()
4096 req, err := http.NewRequest("PUT", urls, body)
4097 if err != nil {
4098 return nil, err
4099 }
4100 req.Header = reqHeaders
4101 req.GetBody = getBody
4102 googleapi.Expand(req.URL, map[string]string{
4103 "id": c.id,
4104 })
4105 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4106 }
4107
4108
4109
4110
4111
4112
4113
4114
4115 func (c *TimelineUpdateCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
4116 gensupport.SetOptions(c.urlParams_, opts...)
4117 res, err := c.doRequest("json")
4118 if res != nil && res.StatusCode == http.StatusNotModified {
4119 if res.Body != nil {
4120 res.Body.Close()
4121 }
4122 return nil, &googleapi.Error{
4123 Code: res.StatusCode,
4124 Header: res.Header,
4125 }
4126 }
4127 if err != nil {
4128 return nil, err
4129 }
4130 defer googleapi.CloseBody(res)
4131 if err := googleapi.CheckResponse(res); err != nil {
4132 return nil, err
4133 }
4134 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
4135 if rx != nil {
4136 rx.Client = c.s.client
4137 rx.UserAgent = c.s.userAgent()
4138 ctx := c.ctx_
4139 if ctx == nil {
4140 ctx = context.TODO()
4141 }
4142 res, err = rx.Upload(ctx)
4143 if err != nil {
4144 return nil, err
4145 }
4146 defer res.Body.Close()
4147 if err := googleapi.CheckResponse(res); err != nil {
4148 return nil, err
4149 }
4150 }
4151 ret := &TimelineItem{
4152 ServerResponse: googleapi.ServerResponse{
4153 Header: res.Header,
4154 HTTPStatusCode: res.StatusCode,
4155 },
4156 }
4157 target := &ret
4158 if err := gensupport.DecodeResponse(target, res); err != nil {
4159 return nil, err
4160 }
4161 return ret, nil
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209 }
4210
4211
4212
4213 type TimelineAttachmentsDeleteCall struct {
4214 s *Service
4215 itemId string
4216 attachmentId string
4217 urlParams_ gensupport.URLParams
4218 ctx_ context.Context
4219 header_ http.Header
4220 }
4221
4222
4223 func (r *TimelineAttachmentsService) Delete(itemId string, attachmentId string) *TimelineAttachmentsDeleteCall {
4224 c := &TimelineAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4225 c.itemId = itemId
4226 c.attachmentId = attachmentId
4227 return c
4228 }
4229
4230
4231
4232
4233 func (c *TimelineAttachmentsDeleteCall) Fields(s ...googleapi.Field) *TimelineAttachmentsDeleteCall {
4234 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4235 return c
4236 }
4237
4238
4239
4240
4241 func (c *TimelineAttachmentsDeleteCall) Context(ctx context.Context) *TimelineAttachmentsDeleteCall {
4242 c.ctx_ = ctx
4243 return c
4244 }
4245
4246
4247
4248 func (c *TimelineAttachmentsDeleteCall) Header() http.Header {
4249 if c.header_ == nil {
4250 c.header_ = make(http.Header)
4251 }
4252 return c.header_
4253 }
4254
4255 func (c *TimelineAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
4256 reqHeaders := make(http.Header)
4257 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
4258 for k, v := range c.header_ {
4259 reqHeaders[k] = v
4260 }
4261 reqHeaders.Set("User-Agent", c.s.userAgent())
4262 var body io.Reader = nil
4263 c.urlParams_.Set("alt", alt)
4264 c.urlParams_.Set("prettyPrint", "false")
4265 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}")
4266 urls += "?" + c.urlParams_.Encode()
4267 req, err := http.NewRequest("DELETE", urls, body)
4268 if err != nil {
4269 return nil, err
4270 }
4271 req.Header = reqHeaders
4272 googleapi.Expand(req.URL, map[string]string{
4273 "itemId": c.itemId,
4274 "attachmentId": c.attachmentId,
4275 })
4276 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4277 }
4278
4279
4280 func (c *TimelineAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) error {
4281 gensupport.SetOptions(c.urlParams_, opts...)
4282 res, err := c.doRequest("json")
4283 if err != nil {
4284 return err
4285 }
4286 defer googleapi.CloseBody(res)
4287 if err := googleapi.CheckResponse(res); err != nil {
4288 return err
4289 }
4290 return nil
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319 }
4320
4321
4322
4323 type TimelineAttachmentsGetCall struct {
4324 s *Service
4325 itemId string
4326 attachmentId string
4327 urlParams_ gensupport.URLParams
4328 ifNoneMatch_ string
4329 ctx_ context.Context
4330 header_ http.Header
4331 }
4332
4333
4334
4335 func (r *TimelineAttachmentsService) Get(itemId string, attachmentId string) *TimelineAttachmentsGetCall {
4336 c := &TimelineAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4337 c.itemId = itemId
4338 c.attachmentId = attachmentId
4339 return c
4340 }
4341
4342
4343
4344
4345 func (c *TimelineAttachmentsGetCall) Fields(s ...googleapi.Field) *TimelineAttachmentsGetCall {
4346 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4347 return c
4348 }
4349
4350
4351
4352
4353
4354
4355 func (c *TimelineAttachmentsGetCall) IfNoneMatch(entityTag string) *TimelineAttachmentsGetCall {
4356 c.ifNoneMatch_ = entityTag
4357 return c
4358 }
4359
4360
4361
4362
4363 func (c *TimelineAttachmentsGetCall) Context(ctx context.Context) *TimelineAttachmentsGetCall {
4364 c.ctx_ = ctx
4365 return c
4366 }
4367
4368
4369
4370 func (c *TimelineAttachmentsGetCall) Header() http.Header {
4371 if c.header_ == nil {
4372 c.header_ = make(http.Header)
4373 }
4374 return c.header_
4375 }
4376
4377 func (c *TimelineAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
4378 reqHeaders := make(http.Header)
4379 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
4380 for k, v := range c.header_ {
4381 reqHeaders[k] = v
4382 }
4383 reqHeaders.Set("User-Agent", c.s.userAgent())
4384 if c.ifNoneMatch_ != "" {
4385 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4386 }
4387 var body io.Reader = nil
4388 c.urlParams_.Set("alt", alt)
4389 c.urlParams_.Set("prettyPrint", "false")
4390 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}")
4391 urls += "?" + c.urlParams_.Encode()
4392 req, err := http.NewRequest("GET", urls, body)
4393 if err != nil {
4394 return nil, err
4395 }
4396 req.Header = reqHeaders
4397 googleapi.Expand(req.URL, map[string]string{
4398 "itemId": c.itemId,
4399 "attachmentId": c.attachmentId,
4400 })
4401 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4402 }
4403
4404
4405
4406
4407 func (c *TimelineAttachmentsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
4408 gensupport.SetOptions(c.urlParams_, opts...)
4409 res, err := c.doRequest("media")
4410 if err != nil {
4411 return nil, err
4412 }
4413 if err := googleapi.CheckMediaResponse(res); err != nil {
4414 res.Body.Close()
4415 return nil, err
4416 }
4417 return res, nil
4418 }
4419
4420
4421
4422
4423
4424
4425
4426
4427 func (c *TimelineAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*Attachment, error) {
4428 gensupport.SetOptions(c.urlParams_, opts...)
4429 res, err := c.doRequest("json")
4430 if res != nil && res.StatusCode == http.StatusNotModified {
4431 if res.Body != nil {
4432 res.Body.Close()
4433 }
4434 return nil, &googleapi.Error{
4435 Code: res.StatusCode,
4436 Header: res.Header,
4437 }
4438 }
4439 if err != nil {
4440 return nil, err
4441 }
4442 defer googleapi.CloseBody(res)
4443 if err := googleapi.CheckResponse(res); err != nil {
4444 return nil, err
4445 }
4446 ret := &Attachment{
4447 ServerResponse: googleapi.ServerResponse{
4448 Header: res.Header,
4449 HTTPStatusCode: res.StatusCode,
4450 },
4451 }
4452 target := &ret
4453 if err := gensupport.DecodeResponse(target, res); err != nil {
4454 return nil, err
4455 }
4456 return ret, nil
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489 }
4490
4491
4492
4493 type TimelineAttachmentsInsertCall struct {
4494 s *Service
4495 itemId string
4496 urlParams_ gensupport.URLParams
4497 mediaInfo_ *gensupport.MediaInfo
4498 ctx_ context.Context
4499 header_ http.Header
4500 }
4501
4502
4503 func (r *TimelineAttachmentsService) Insert(itemId string) *TimelineAttachmentsInsertCall {
4504 c := &TimelineAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4505 c.itemId = itemId
4506 return c
4507 }
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517 func (c *TimelineAttachmentsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *TimelineAttachmentsInsertCall {
4518 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
4519 return c
4520 }
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531 func (c *TimelineAttachmentsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineAttachmentsInsertCall {
4532 c.ctx_ = ctx
4533 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
4534 return c
4535 }
4536
4537
4538
4539
4540
4541 func (c *TimelineAttachmentsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineAttachmentsInsertCall {
4542 c.mediaInfo_.SetProgressUpdater(pu)
4543 return c
4544 }
4545
4546
4547
4548
4549 func (c *TimelineAttachmentsInsertCall) Fields(s ...googleapi.Field) *TimelineAttachmentsInsertCall {
4550 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4551 return c
4552 }
4553
4554
4555
4556
4557
4558
4559 func (c *TimelineAttachmentsInsertCall) Context(ctx context.Context) *TimelineAttachmentsInsertCall {
4560 c.ctx_ = ctx
4561 return c
4562 }
4563
4564
4565
4566 func (c *TimelineAttachmentsInsertCall) Header() http.Header {
4567 if c.header_ == nil {
4568 c.header_ = make(http.Header)
4569 }
4570 return c.header_
4571 }
4572
4573 func (c *TimelineAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
4574 reqHeaders := make(http.Header)
4575 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
4576 for k, v := range c.header_ {
4577 reqHeaders[k] = v
4578 }
4579 reqHeaders.Set("User-Agent", c.s.userAgent())
4580 var body io.Reader = nil
4581 c.urlParams_.Set("alt", alt)
4582 c.urlParams_.Set("prettyPrint", "false")
4583 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments")
4584 if c.mediaInfo_ != nil {
4585 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/mirror/v1/timeline/{itemId}/attachments")
4586 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
4587 }
4588 if body == nil {
4589 body = new(bytes.Buffer)
4590 reqHeaders.Set("Content-Type", "application/json")
4591 }
4592 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
4593 defer cleanup()
4594 urls += "?" + c.urlParams_.Encode()
4595 req, err := http.NewRequest("POST", urls, body)
4596 if err != nil {
4597 return nil, err
4598 }
4599 req.Header = reqHeaders
4600 req.GetBody = getBody
4601 googleapi.Expand(req.URL, map[string]string{
4602 "itemId": c.itemId,
4603 })
4604 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4605 }
4606
4607
4608
4609
4610
4611
4612
4613
4614 func (c *TimelineAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Attachment, error) {
4615 gensupport.SetOptions(c.urlParams_, opts...)
4616 res, err := c.doRequest("json")
4617 if res != nil && res.StatusCode == http.StatusNotModified {
4618 if res.Body != nil {
4619 res.Body.Close()
4620 }
4621 return nil, &googleapi.Error{
4622 Code: res.StatusCode,
4623 Header: res.Header,
4624 }
4625 }
4626 if err != nil {
4627 return nil, err
4628 }
4629 defer googleapi.CloseBody(res)
4630 if err := googleapi.CheckResponse(res); err != nil {
4631 return nil, err
4632 }
4633 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
4634 if rx != nil {
4635 rx.Client = c.s.client
4636 rx.UserAgent = c.s.userAgent()
4637 ctx := c.ctx_
4638 if ctx == nil {
4639 ctx = context.TODO()
4640 }
4641 res, err = rx.Upload(ctx)
4642 if err != nil {
4643 return nil, err
4644 }
4645 defer res.Body.Close()
4646 if err := googleapi.CheckResponse(res); err != nil {
4647 return nil, err
4648 }
4649 }
4650 ret := &Attachment{
4651 ServerResponse: googleapi.ServerResponse{
4652 Header: res.Header,
4653 HTTPStatusCode: res.StatusCode,
4654 },
4655 }
4656 target := &ret
4657 if err := gensupport.DecodeResponse(target, res); err != nil {
4658 return nil, err
4659 }
4660 return ret, nil
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704 }
4705
4706
4707
4708 type TimelineAttachmentsListCall struct {
4709 s *Service
4710 itemId string
4711 urlParams_ gensupport.URLParams
4712 ifNoneMatch_ string
4713 ctx_ context.Context
4714 header_ http.Header
4715 }
4716
4717
4718 func (r *TimelineAttachmentsService) List(itemId string) *TimelineAttachmentsListCall {
4719 c := &TimelineAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4720 c.itemId = itemId
4721 return c
4722 }
4723
4724
4725
4726
4727 func (c *TimelineAttachmentsListCall) Fields(s ...googleapi.Field) *TimelineAttachmentsListCall {
4728 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4729 return c
4730 }
4731
4732
4733
4734
4735
4736
4737 func (c *TimelineAttachmentsListCall) IfNoneMatch(entityTag string) *TimelineAttachmentsListCall {
4738 c.ifNoneMatch_ = entityTag
4739 return c
4740 }
4741
4742
4743
4744
4745 func (c *TimelineAttachmentsListCall) Context(ctx context.Context) *TimelineAttachmentsListCall {
4746 c.ctx_ = ctx
4747 return c
4748 }
4749
4750
4751
4752 func (c *TimelineAttachmentsListCall) Header() http.Header {
4753 if c.header_ == nil {
4754 c.header_ = make(http.Header)
4755 }
4756 return c.header_
4757 }
4758
4759 func (c *TimelineAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
4760 reqHeaders := make(http.Header)
4761 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
4762 for k, v := range c.header_ {
4763 reqHeaders[k] = v
4764 }
4765 reqHeaders.Set("User-Agent", c.s.userAgent())
4766 if c.ifNoneMatch_ != "" {
4767 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4768 }
4769 var body io.Reader = nil
4770 c.urlParams_.Set("alt", alt)
4771 c.urlParams_.Set("prettyPrint", "false")
4772 urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments")
4773 urls += "?" + c.urlParams_.Encode()
4774 req, err := http.NewRequest("GET", urls, body)
4775 if err != nil {
4776 return nil, err
4777 }
4778 req.Header = reqHeaders
4779 googleapi.Expand(req.URL, map[string]string{
4780 "itemId": c.itemId,
4781 })
4782 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4783 }
4784
4785
4786
4787
4788
4789
4790
4791
4792 func (c *TimelineAttachmentsListCall) Do(opts ...googleapi.CallOption) (*AttachmentsListResponse, error) {
4793 gensupport.SetOptions(c.urlParams_, opts...)
4794 res, err := c.doRequest("json")
4795 if res != nil && res.StatusCode == http.StatusNotModified {
4796 if res.Body != nil {
4797 res.Body.Close()
4798 }
4799 return nil, &googleapi.Error{
4800 Code: res.StatusCode,
4801 Header: res.Header,
4802 }
4803 }
4804 if err != nil {
4805 return nil, err
4806 }
4807 defer googleapi.CloseBody(res)
4808 if err := googleapi.CheckResponse(res); err != nil {
4809 return nil, err
4810 }
4811 ret := &AttachmentsListResponse{
4812 ServerResponse: googleapi.ServerResponse{
4813 Header: res.Header,
4814 HTTPStatusCode: res.StatusCode,
4815 },
4816 }
4817 target := &ret
4818 if err := gensupport.DecodeResponse(target, res); err != nil {
4819 return nil, err
4820 }
4821 return ret, nil
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846 }
4847
View as plain text