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 fusiontables
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 htransport "google.golang.org/api/transport/http"
60 )
61
62
63
64 var _ = bytes.NewBuffer
65 var _ = strconv.Itoa
66 var _ = fmt.Sprintf
67 var _ = json.NewDecoder
68 var _ = io.Copy
69 var _ = url.Parse
70 var _ = gensupport.MarshalJSON
71 var _ = googleapi.Version
72 var _ = errors.New
73 var _ = strings.Replace
74 var _ = context.Canceled
75
76 const apiId = "fusiontables:v1"
77 const apiName = "fusiontables"
78 const apiVersion = "v1"
79 const basePath = "https://www.googleapis.com/fusiontables/v1/"
80
81
82 const (
83
84 FusiontablesScope = "https://www.googleapis.com/auth/fusiontables"
85
86
87 FusiontablesReadonlyScope = "https://www.googleapis.com/auth/fusiontables.readonly"
88 )
89
90
91 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
92 scopesOption := option.WithScopes(
93 "https://www.googleapis.com/auth/fusiontables",
94 "https://www.googleapis.com/auth/fusiontables.readonly",
95 )
96
97 opts = append([]option.ClientOption{scopesOption}, opts...)
98 client, endpoint, err := htransport.NewClient(ctx, opts...)
99 if err != nil {
100 return nil, err
101 }
102 s, err := New(client)
103 if err != nil {
104 return nil, err
105 }
106 if endpoint != "" {
107 s.BasePath = endpoint
108 }
109 return s, nil
110 }
111
112
113
114
115
116
117 func New(client *http.Client) (*Service, error) {
118 if client == nil {
119 return nil, errors.New("client is nil")
120 }
121 s := &Service{client: client, BasePath: basePath}
122 s.Column = NewColumnService(s)
123 s.Query = NewQueryService(s)
124 s.Style = NewStyleService(s)
125 s.Table = NewTableService(s)
126 s.Task = NewTaskService(s)
127 s.Template = NewTemplateService(s)
128 return s, nil
129 }
130
131 type Service struct {
132 client *http.Client
133 BasePath string
134 UserAgent string
135
136 Column *ColumnService
137
138 Query *QueryService
139
140 Style *StyleService
141
142 Table *TableService
143
144 Task *TaskService
145
146 Template *TemplateService
147 }
148
149 func (s *Service) userAgent() string {
150 if s.UserAgent == "" {
151 return googleapi.UserAgent
152 }
153 return googleapi.UserAgent + " " + s.UserAgent
154 }
155
156 func NewColumnService(s *Service) *ColumnService {
157 rs := &ColumnService{s: s}
158 return rs
159 }
160
161 type ColumnService struct {
162 s *Service
163 }
164
165 func NewQueryService(s *Service) *QueryService {
166 rs := &QueryService{s: s}
167 return rs
168 }
169
170 type QueryService struct {
171 s *Service
172 }
173
174 func NewStyleService(s *Service) *StyleService {
175 rs := &StyleService{s: s}
176 return rs
177 }
178
179 type StyleService struct {
180 s *Service
181 }
182
183 func NewTableService(s *Service) *TableService {
184 rs := &TableService{s: s}
185 return rs
186 }
187
188 type TableService struct {
189 s *Service
190 }
191
192 func NewTaskService(s *Service) *TaskService {
193 rs := &TaskService{s: s}
194 return rs
195 }
196
197 type TaskService struct {
198 s *Service
199 }
200
201 func NewTemplateService(s *Service) *TemplateService {
202 rs := &TemplateService{s: s}
203 return rs
204 }
205
206 type TemplateService struct {
207 s *Service
208 }
209
210
211
212 type Bucket struct {
213
214 Color string `json:"color,omitempty"`
215
216
217 Icon string `json:"icon,omitempty"`
218
219
220
221 Max float64 `json:"max,omitempty"`
222
223
224
225 Min float64 `json:"min,omitempty"`
226
227
228 Opacity float64 `json:"opacity,omitempty"`
229
230
231 Weight int64 `json:"weight,omitempty"`
232
233
234
235
236
237
238
239 ForceSendFields []string `json:"-"`
240
241
242
243
244
245
246
247 NullFields []string `json:"-"`
248 }
249
250 func (s *Bucket) MarshalJSON() ([]byte, error) {
251 type NoMethod Bucket
252 raw := NoMethod(*s)
253 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
254 }
255
256 func (s *Bucket) UnmarshalJSON(data []byte) error {
257 type NoMethod Bucket
258 var s1 struct {
259 Max gensupport.JSONFloat64 `json:"max"`
260 Min gensupport.JSONFloat64 `json:"min"`
261 Opacity gensupport.JSONFloat64 `json:"opacity"`
262 *NoMethod
263 }
264 s1.NoMethod = (*NoMethod)(s)
265 if err := json.Unmarshal(data, &s1); err != nil {
266 return err
267 }
268 s.Max = float64(s1.Max)
269 s.Min = float64(s1.Min)
270 s.Opacity = float64(s1.Opacity)
271 return nil
272 }
273
274
275 type Column struct {
276
277
278 BaseColumn *ColumnBaseColumn `json:"baseColumn,omitempty"`
279
280
281 ColumnId int64 `json:"columnId,omitempty"`
282
283
284 Description string `json:"description,omitempty"`
285
286
287
288
289 GraphPredicate string `json:"graph_predicate,omitempty"`
290
291
292 Kind string `json:"kind,omitempty"`
293
294
295 Name string `json:"name,omitempty"`
296
297
298 Type string `json:"type,omitempty"`
299
300
301
302 googleapi.ServerResponse `json:"-"`
303
304
305
306
307
308
309
310 ForceSendFields []string `json:"-"`
311
312
313
314
315
316
317
318 NullFields []string `json:"-"`
319 }
320
321 func (s *Column) MarshalJSON() ([]byte, error) {
322 type NoMethod Column
323 raw := NoMethod(*s)
324 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
325 }
326
327
328
329 type ColumnBaseColumn struct {
330
331
332 ColumnId int64 `json:"columnId,omitempty"`
333
334
335
336 TableIndex int64 `json:"tableIndex,omitempty"`
337
338
339
340
341
342
343
344 ForceSendFields []string `json:"-"`
345
346
347
348
349
350
351
352 NullFields []string `json:"-"`
353 }
354
355 func (s *ColumnBaseColumn) MarshalJSON() ([]byte, error) {
356 type NoMethod ColumnBaseColumn
357 raw := NoMethod(*s)
358 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
359 }
360
361
362 type ColumnList struct {
363
364 Items []*Column `json:"items,omitempty"`
365
366
367 Kind string `json:"kind,omitempty"`
368
369
370
371 NextPageToken string `json:"nextPageToken,omitempty"`
372
373
374 TotalItems int64 `json:"totalItems,omitempty"`
375
376
377
378 googleapi.ServerResponse `json:"-"`
379
380
381
382
383
384
385
386 ForceSendFields []string `json:"-"`
387
388
389
390
391
392
393
394 NullFields []string `json:"-"`
395 }
396
397 func (s *ColumnList) MarshalJSON() ([]byte, error) {
398 type NoMethod ColumnList
399 raw := NoMethod(*s)
400 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
401 }
402
403
404 type Geometry struct {
405
406 Geometries []interface{} `json:"geometries,omitempty"`
407
408 Geometry interface{} `json:"geometry,omitempty"`
409
410
411 Type string `json:"type,omitempty"`
412
413
414
415
416
417
418
419 ForceSendFields []string `json:"-"`
420
421
422
423
424
425
426
427 NullFields []string `json:"-"`
428 }
429
430 func (s *Geometry) MarshalJSON() ([]byte, error) {
431 type NoMethod Geometry
432 raw := NoMethod(*s)
433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
434 }
435
436
437 type Import struct {
438
439 Kind string `json:"kind,omitempty"`
440
441
442 NumRowsReceived int64 `json:"numRowsReceived,omitempty,string"`
443
444
445
446 googleapi.ServerResponse `json:"-"`
447
448
449
450
451
452
453
454 ForceSendFields []string `json:"-"`
455
456
457
458
459
460
461
462 NullFields []string `json:"-"`
463 }
464
465 func (s *Import) MarshalJSON() ([]byte, error) {
466 type NoMethod Import
467 raw := NoMethod(*s)
468 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
469 }
470
471
472 type Line struct {
473
474 Coordinates [][]float64 `json:"coordinates,omitempty"`
475
476
477 Type string `json:"type,omitempty"`
478
479
480
481
482
483
484
485 ForceSendFields []string `json:"-"`
486
487
488
489
490
491
492
493 NullFields []string `json:"-"`
494 }
495
496 func (s *Line) MarshalJSON() ([]byte, error) {
497 type NoMethod Line
498 raw := NoMethod(*s)
499 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
500 }
501
502
503 type LineStyle struct {
504
505 StrokeColor string `json:"strokeColor,omitempty"`
506
507
508
509 StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"`
510
511
512
513 StrokeOpacity float64 `json:"strokeOpacity,omitempty"`
514
515
516 StrokeWeight int64 `json:"strokeWeight,omitempty"`
517
518
519
520 StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"`
521
522
523
524
525
526
527
528 ForceSendFields []string `json:"-"`
529
530
531
532
533
534
535
536 NullFields []string `json:"-"`
537 }
538
539 func (s *LineStyle) MarshalJSON() ([]byte, error) {
540 type NoMethod LineStyle
541 raw := NoMethod(*s)
542 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
543 }
544
545 func (s *LineStyle) UnmarshalJSON(data []byte) error {
546 type NoMethod LineStyle
547 var s1 struct {
548 StrokeOpacity gensupport.JSONFloat64 `json:"strokeOpacity"`
549 *NoMethod
550 }
551 s1.NoMethod = (*NoMethod)(s)
552 if err := json.Unmarshal(data, &s1); err != nil {
553 return err
554 }
555 s.StrokeOpacity = float64(s1.StrokeOpacity)
556 return nil
557 }
558
559
560 type Point struct {
561
562 Coordinates []float64 `json:"coordinates,omitempty"`
563
564
565 Type string `json:"type,omitempty"`
566
567
568
569
570
571
572
573 ForceSendFields []string `json:"-"`
574
575
576
577
578
579
580
581 NullFields []string `json:"-"`
582 }
583
584 func (s *Point) MarshalJSON() ([]byte, error) {
585 type NoMethod Point
586 raw := NoMethod(*s)
587 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
588 }
589
590
591 type PointStyle struct {
592
593
594 IconName string `json:"iconName,omitempty"`
595
596
597
598 IconStyler *StyleFunction `json:"iconStyler,omitempty"`
599
600
601
602
603
604
605
606 ForceSendFields []string `json:"-"`
607
608
609
610
611
612
613
614 NullFields []string `json:"-"`
615 }
616
617 func (s *PointStyle) MarshalJSON() ([]byte, error) {
618 type NoMethod PointStyle
619 raw := NoMethod(*s)
620 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
621 }
622
623
624 type Polygon struct {
625
626 Coordinates [][][]float64 `json:"coordinates,omitempty"`
627
628
629 Type string `json:"type,omitempty"`
630
631
632
633
634
635
636
637 ForceSendFields []string `json:"-"`
638
639
640
641
642
643
644
645 NullFields []string `json:"-"`
646 }
647
648 func (s *Polygon) MarshalJSON() ([]byte, error) {
649 type NoMethod Polygon
650 raw := NoMethod(*s)
651 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
652 }
653
654
655 type PolygonStyle struct {
656
657 FillColor string `json:"fillColor,omitempty"`
658
659
660
661 FillColorStyler *StyleFunction `json:"fillColorStyler,omitempty"`
662
663
664
665 FillOpacity float64 `json:"fillOpacity,omitempty"`
666
667
668 StrokeColor string `json:"strokeColor,omitempty"`
669
670
671
672 StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"`
673
674
675
676 StrokeOpacity float64 `json:"strokeOpacity,omitempty"`
677
678
679 StrokeWeight int64 `json:"strokeWeight,omitempty"`
680
681
682
683 StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"`
684
685
686
687
688
689
690
691 ForceSendFields []string `json:"-"`
692
693
694
695
696
697
698
699 NullFields []string `json:"-"`
700 }
701
702 func (s *PolygonStyle) MarshalJSON() ([]byte, error) {
703 type NoMethod PolygonStyle
704 raw := NoMethod(*s)
705 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
706 }
707
708 func (s *PolygonStyle) UnmarshalJSON(data []byte) error {
709 type NoMethod PolygonStyle
710 var s1 struct {
711 FillOpacity gensupport.JSONFloat64 `json:"fillOpacity"`
712 StrokeOpacity gensupport.JSONFloat64 `json:"strokeOpacity"`
713 *NoMethod
714 }
715 s1.NoMethod = (*NoMethod)(s)
716 if err := json.Unmarshal(data, &s1); err != nil {
717 return err
718 }
719 s.FillOpacity = float64(s1.FillOpacity)
720 s.StrokeOpacity = float64(s1.StrokeOpacity)
721 return nil
722 }
723
724
725 type Sqlresponse struct {
726
727 Columns []string `json:"columns,omitempty"`
728
729
730 Kind string `json:"kind,omitempty"`
731
732
733
734
735 Rows [][]interface{} `json:"rows,omitempty"`
736
737
738
739 googleapi.ServerResponse `json:"-"`
740
741
742
743
744
745
746
747 ForceSendFields []string `json:"-"`
748
749
750
751
752
753
754
755 NullFields []string `json:"-"`
756 }
757
758 func (s *Sqlresponse) MarshalJSON() ([]byte, error) {
759 type NoMethod Sqlresponse
760 raw := NoMethod(*s)
761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
762 }
763
764
765 type StyleFunction struct {
766
767
768 Buckets []*Bucket `json:"buckets,omitempty"`
769
770
771 ColumnName string `json:"columnName,omitempty"`
772
773
774
775 Gradient *StyleFunctionGradient `json:"gradient,omitempty"`
776
777
778
779
780
781
782
783
784 Kind string `json:"kind,omitempty"`
785
786
787
788
789
790
791
792 ForceSendFields []string `json:"-"`
793
794
795
796
797
798
799
800 NullFields []string `json:"-"`
801 }
802
803 func (s *StyleFunction) MarshalJSON() ([]byte, error) {
804 type NoMethod StyleFunction
805 raw := NoMethod(*s)
806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
807 }
808
809
810
811 type StyleFunctionGradient struct {
812
813 Colors []*StyleFunctionGradientColors `json:"colors,omitempty"`
814
815
816
817 Max float64 `json:"max,omitempty"`
818
819
820
821 Min float64 `json:"min,omitempty"`
822
823
824
825
826
827
828
829 ForceSendFields []string `json:"-"`
830
831
832
833
834
835
836
837 NullFields []string `json:"-"`
838 }
839
840 func (s *StyleFunctionGradient) MarshalJSON() ([]byte, error) {
841 type NoMethod StyleFunctionGradient
842 raw := NoMethod(*s)
843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
844 }
845
846 func (s *StyleFunctionGradient) UnmarshalJSON(data []byte) error {
847 type NoMethod StyleFunctionGradient
848 var s1 struct {
849 Max gensupport.JSONFloat64 `json:"max"`
850 Min gensupport.JSONFloat64 `json:"min"`
851 *NoMethod
852 }
853 s1.NoMethod = (*NoMethod)(s)
854 if err := json.Unmarshal(data, &s1); err != nil {
855 return err
856 }
857 s.Max = float64(s1.Max)
858 s.Min = float64(s1.Min)
859 return nil
860 }
861
862 type StyleFunctionGradientColors struct {
863
864 Color string `json:"color,omitempty"`
865
866
867 Opacity float64 `json:"opacity,omitempty"`
868
869
870
871
872
873
874
875 ForceSendFields []string `json:"-"`
876
877
878
879
880
881
882
883 NullFields []string `json:"-"`
884 }
885
886 func (s *StyleFunctionGradientColors) MarshalJSON() ([]byte, error) {
887 type NoMethod StyleFunctionGradientColors
888 raw := NoMethod(*s)
889 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
890 }
891
892 func (s *StyleFunctionGradientColors) UnmarshalJSON(data []byte) error {
893 type NoMethod StyleFunctionGradientColors
894 var s1 struct {
895 Opacity gensupport.JSONFloat64 `json:"opacity"`
896 *NoMethod
897 }
898 s1.NoMethod = (*NoMethod)(s)
899 if err := json.Unmarshal(data, &s1); err != nil {
900 return err
901 }
902 s.Opacity = float64(s1.Opacity)
903 return nil
904 }
905
906
907
908 type StyleSetting struct {
909
910
911
912
913 Kind string `json:"kind,omitempty"`
914
915
916 MarkerOptions *PointStyle `json:"markerOptions,omitempty"`
917
918
919 Name string `json:"name,omitempty"`
920
921
922 PolygonOptions *PolygonStyle `json:"polygonOptions,omitempty"`
923
924
925 PolylineOptions *LineStyle `json:"polylineOptions,omitempty"`
926
927
928
929 StyleId int64 `json:"styleId,omitempty"`
930
931
932 TableId string `json:"tableId,omitempty"`
933
934
935
936 googleapi.ServerResponse `json:"-"`
937
938
939
940
941
942
943
944 ForceSendFields []string `json:"-"`
945
946
947
948
949
950
951
952 NullFields []string `json:"-"`
953 }
954
955 func (s *StyleSetting) MarshalJSON() ([]byte, error) {
956 type NoMethod StyleSetting
957 raw := NoMethod(*s)
958 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
959 }
960
961
962 type StyleSettingList struct {
963
964 Items []*StyleSetting `json:"items,omitempty"`
965
966
967 Kind string `json:"kind,omitempty"`
968
969
970
971 NextPageToken string `json:"nextPageToken,omitempty"`
972
973
974 TotalItems int64 `json:"totalItems,omitempty"`
975
976
977
978 googleapi.ServerResponse `json:"-"`
979
980
981
982
983
984
985
986 ForceSendFields []string `json:"-"`
987
988
989
990
991
992
993
994 NullFields []string `json:"-"`
995 }
996
997 func (s *StyleSettingList) MarshalJSON() ([]byte, error) {
998 type NoMethod StyleSettingList
999 raw := NoMethod(*s)
1000 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1001 }
1002
1003
1004
1005 type Table struct {
1006
1007 Attribution string `json:"attribution,omitempty"`
1008
1009
1010 AttributionLink string `json:"attributionLink,omitempty"`
1011
1012
1013
1014 BaseTableIds []string `json:"baseTableIds,omitempty"`
1015
1016
1017 Columns []*Column `json:"columns,omitempty"`
1018
1019
1020 Description string `json:"description,omitempty"`
1021
1022
1023 IsExportable bool `json:"isExportable,omitempty"`
1024
1025
1026 Kind string `json:"kind,omitempty"`
1027
1028
1029 Name string `json:"name,omitempty"`
1030
1031
1032
1033 Sql string `json:"sql,omitempty"`
1034
1035
1036 TableId string `json:"tableId,omitempty"`
1037
1038
1039
1040 googleapi.ServerResponse `json:"-"`
1041
1042
1043
1044
1045
1046
1047
1048 ForceSendFields []string `json:"-"`
1049
1050
1051
1052
1053
1054
1055
1056 NullFields []string `json:"-"`
1057 }
1058
1059 func (s *Table) MarshalJSON() ([]byte, error) {
1060 type NoMethod Table
1061 raw := NoMethod(*s)
1062 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1063 }
1064
1065
1066 type TableList struct {
1067
1068 Items []*Table `json:"items,omitempty"`
1069
1070
1071 Kind string `json:"kind,omitempty"`
1072
1073
1074
1075 NextPageToken string `json:"nextPageToken,omitempty"`
1076
1077
1078
1079 googleapi.ServerResponse `json:"-"`
1080
1081
1082
1083
1084
1085
1086
1087 ForceSendFields []string `json:"-"`
1088
1089
1090
1091
1092
1093
1094
1095 NullFields []string `json:"-"`
1096 }
1097
1098 func (s *TableList) MarshalJSON() ([]byte, error) {
1099 type NoMethod TableList
1100 raw := NoMethod(*s)
1101 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1102 }
1103
1104
1105 type Task struct {
1106
1107 Kind string `json:"kind,omitempty"`
1108
1109
1110 Progress string `json:"progress,omitempty"`
1111
1112
1113
1114 Started bool `json:"started,omitempty"`
1115
1116
1117 TaskId int64 `json:"taskId,omitempty,string"`
1118
1119
1120
1121
1122
1123
1124 Type string `json:"type,omitempty"`
1125
1126
1127
1128 googleapi.ServerResponse `json:"-"`
1129
1130
1131
1132
1133
1134
1135
1136 ForceSendFields []string `json:"-"`
1137
1138
1139
1140
1141
1142
1143
1144 NullFields []string `json:"-"`
1145 }
1146
1147 func (s *Task) MarshalJSON() ([]byte, error) {
1148 type NoMethod Task
1149 raw := NoMethod(*s)
1150 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1151 }
1152
1153
1154 type TaskList struct {
1155
1156 Items []*Task `json:"items,omitempty"`
1157
1158
1159 Kind string `json:"kind,omitempty"`
1160
1161
1162
1163 NextPageToken string `json:"nextPageToken,omitempty"`
1164
1165
1166 TotalItems int64 `json:"totalItems,omitempty"`
1167
1168
1169
1170 googleapi.ServerResponse `json:"-"`
1171
1172
1173
1174
1175
1176
1177
1178 ForceSendFields []string `json:"-"`
1179
1180
1181
1182
1183
1184
1185
1186 NullFields []string `json:"-"`
1187 }
1188
1189 func (s *TaskList) MarshalJSON() ([]byte, error) {
1190 type NoMethod TaskList
1191 raw := NoMethod(*s)
1192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1193 }
1194
1195
1196 type Template struct {
1197
1198
1199
1200 AutomaticColumnNames []string `json:"automaticColumnNames,omitempty"`
1201
1202
1203
1204
1205
1206 Body string `json:"body,omitempty"`
1207
1208
1209
1210
1211 Kind string `json:"kind,omitempty"`
1212
1213
1214 Name string `json:"name,omitempty"`
1215
1216
1217 TableId string `json:"tableId,omitempty"`
1218
1219
1220
1221 TemplateId int64 `json:"templateId,omitempty"`
1222
1223
1224
1225 googleapi.ServerResponse `json:"-"`
1226
1227
1228
1229
1230
1231
1232
1233
1234 ForceSendFields []string `json:"-"`
1235
1236
1237
1238
1239
1240
1241
1242
1243 NullFields []string `json:"-"`
1244 }
1245
1246 func (s *Template) MarshalJSON() ([]byte, error) {
1247 type NoMethod Template
1248 raw := NoMethod(*s)
1249 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1250 }
1251
1252
1253 type TemplateList struct {
1254
1255 Items []*Template `json:"items,omitempty"`
1256
1257
1258 Kind string `json:"kind,omitempty"`
1259
1260
1261
1262 NextPageToken string `json:"nextPageToken,omitempty"`
1263
1264
1265 TotalItems int64 `json:"totalItems,omitempty"`
1266
1267
1268
1269 googleapi.ServerResponse `json:"-"`
1270
1271
1272
1273
1274
1275
1276
1277 ForceSendFields []string `json:"-"`
1278
1279
1280
1281
1282
1283
1284
1285 NullFields []string `json:"-"`
1286 }
1287
1288 func (s *TemplateList) MarshalJSON() ([]byte, error) {
1289 type NoMethod TemplateList
1290 raw := NoMethod(*s)
1291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1292 }
1293
1294
1295
1296 type ColumnDeleteCall struct {
1297 s *Service
1298 tableId string
1299 columnId string
1300 urlParams_ gensupport.URLParams
1301 ctx_ context.Context
1302 header_ http.Header
1303 }
1304
1305
1306 func (r *ColumnService) Delete(tableId string, columnId string) *ColumnDeleteCall {
1307 c := &ColumnDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1308 c.tableId = tableId
1309 c.columnId = columnId
1310 return c
1311 }
1312
1313
1314
1315
1316 func (c *ColumnDeleteCall) Fields(s ...googleapi.Field) *ColumnDeleteCall {
1317 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1318 return c
1319 }
1320
1321
1322
1323
1324 func (c *ColumnDeleteCall) Context(ctx context.Context) *ColumnDeleteCall {
1325 c.ctx_ = ctx
1326 return c
1327 }
1328
1329
1330
1331 func (c *ColumnDeleteCall) Header() http.Header {
1332 if c.header_ == nil {
1333 c.header_ = make(http.Header)
1334 }
1335 return c.header_
1336 }
1337
1338 func (c *ColumnDeleteCall) doRequest(alt string) (*http.Response, error) {
1339 reqHeaders := make(http.Header)
1340 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1341 for k, v := range c.header_ {
1342 reqHeaders[k] = v
1343 }
1344 reqHeaders.Set("User-Agent", c.s.userAgent())
1345 var body io.Reader = nil
1346 c.urlParams_.Set("alt", alt)
1347 c.urlParams_.Set("prettyPrint", "false")
1348 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
1349 urls += "?" + c.urlParams_.Encode()
1350 req, err := http.NewRequest("DELETE", urls, body)
1351 if err != nil {
1352 return nil, err
1353 }
1354 req.Header = reqHeaders
1355 googleapi.Expand(req.URL, map[string]string{
1356 "tableId": c.tableId,
1357 "columnId": c.columnId,
1358 })
1359 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1360 }
1361
1362
1363 func (c *ColumnDeleteCall) Do(opts ...googleapi.CallOption) error {
1364 gensupport.SetOptions(c.urlParams_, opts...)
1365 res, err := c.doRequest("json")
1366 if err != nil {
1367 return err
1368 }
1369 defer googleapi.CloseBody(res)
1370 if err := googleapi.CheckResponse(res); err != nil {
1371 return err
1372 }
1373 return nil
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402 }
1403
1404
1405
1406 type ColumnGetCall struct {
1407 s *Service
1408 tableId string
1409 columnId string
1410 urlParams_ gensupport.URLParams
1411 ifNoneMatch_ string
1412 ctx_ context.Context
1413 header_ http.Header
1414 }
1415
1416
1417 func (r *ColumnService) Get(tableId string, columnId string) *ColumnGetCall {
1418 c := &ColumnGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1419 c.tableId = tableId
1420 c.columnId = columnId
1421 return c
1422 }
1423
1424
1425
1426
1427 func (c *ColumnGetCall) Fields(s ...googleapi.Field) *ColumnGetCall {
1428 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1429 return c
1430 }
1431
1432
1433
1434
1435
1436
1437 func (c *ColumnGetCall) IfNoneMatch(entityTag string) *ColumnGetCall {
1438 c.ifNoneMatch_ = entityTag
1439 return c
1440 }
1441
1442
1443
1444
1445 func (c *ColumnGetCall) Context(ctx context.Context) *ColumnGetCall {
1446 c.ctx_ = ctx
1447 return c
1448 }
1449
1450
1451
1452 func (c *ColumnGetCall) Header() http.Header {
1453 if c.header_ == nil {
1454 c.header_ = make(http.Header)
1455 }
1456 return c.header_
1457 }
1458
1459 func (c *ColumnGetCall) doRequest(alt string) (*http.Response, error) {
1460 reqHeaders := make(http.Header)
1461 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1462 for k, v := range c.header_ {
1463 reqHeaders[k] = v
1464 }
1465 reqHeaders.Set("User-Agent", c.s.userAgent())
1466 if c.ifNoneMatch_ != "" {
1467 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1468 }
1469 var body io.Reader = nil
1470 c.urlParams_.Set("alt", alt)
1471 c.urlParams_.Set("prettyPrint", "false")
1472 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
1473 urls += "?" + c.urlParams_.Encode()
1474 req, err := http.NewRequest("GET", urls, body)
1475 if err != nil {
1476 return nil, err
1477 }
1478 req.Header = reqHeaders
1479 googleapi.Expand(req.URL, map[string]string{
1480 "tableId": c.tableId,
1481 "columnId": c.columnId,
1482 })
1483 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1484 }
1485
1486
1487
1488
1489
1490
1491
1492
1493 func (c *ColumnGetCall) Do(opts ...googleapi.CallOption) (*Column, error) {
1494 gensupport.SetOptions(c.urlParams_, opts...)
1495 res, err := c.doRequest("json")
1496 if res != nil && res.StatusCode == http.StatusNotModified {
1497 if res.Body != nil {
1498 res.Body.Close()
1499 }
1500 return nil, &googleapi.Error{
1501 Code: res.StatusCode,
1502 Header: res.Header,
1503 }
1504 }
1505 if err != nil {
1506 return nil, err
1507 }
1508 defer googleapi.CloseBody(res)
1509 if err := googleapi.CheckResponse(res); err != nil {
1510 return nil, err
1511 }
1512 ret := &Column{
1513 ServerResponse: googleapi.ServerResponse{
1514 Header: res.Header,
1515 HTTPStatusCode: res.StatusCode,
1516 },
1517 }
1518 target := &ret
1519 if err := gensupport.DecodeResponse(target, res); err != nil {
1520 return nil, err
1521 }
1522 return ret, nil
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555 }
1556
1557
1558
1559 type ColumnInsertCall struct {
1560 s *Service
1561 tableId string
1562 column *Column
1563 urlParams_ gensupport.URLParams
1564 ctx_ context.Context
1565 header_ http.Header
1566 }
1567
1568
1569 func (r *ColumnService) Insert(tableId string, column *Column) *ColumnInsertCall {
1570 c := &ColumnInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1571 c.tableId = tableId
1572 c.column = column
1573 return c
1574 }
1575
1576
1577
1578
1579 func (c *ColumnInsertCall) Fields(s ...googleapi.Field) *ColumnInsertCall {
1580 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1581 return c
1582 }
1583
1584
1585
1586
1587 func (c *ColumnInsertCall) Context(ctx context.Context) *ColumnInsertCall {
1588 c.ctx_ = ctx
1589 return c
1590 }
1591
1592
1593
1594 func (c *ColumnInsertCall) Header() http.Header {
1595 if c.header_ == nil {
1596 c.header_ = make(http.Header)
1597 }
1598 return c.header_
1599 }
1600
1601 func (c *ColumnInsertCall) doRequest(alt string) (*http.Response, error) {
1602 reqHeaders := make(http.Header)
1603 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1604 for k, v := range c.header_ {
1605 reqHeaders[k] = v
1606 }
1607 reqHeaders.Set("User-Agent", c.s.userAgent())
1608 var body io.Reader = nil
1609 body, err := googleapi.WithoutDataWrapper.JSONReader(c.column)
1610 if err != nil {
1611 return nil, err
1612 }
1613 reqHeaders.Set("Content-Type", "application/json")
1614 c.urlParams_.Set("alt", alt)
1615 c.urlParams_.Set("prettyPrint", "false")
1616 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns")
1617 urls += "?" + c.urlParams_.Encode()
1618 req, err := http.NewRequest("POST", urls, body)
1619 if err != nil {
1620 return nil, err
1621 }
1622 req.Header = reqHeaders
1623 googleapi.Expand(req.URL, map[string]string{
1624 "tableId": c.tableId,
1625 })
1626 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1627 }
1628
1629
1630
1631
1632
1633
1634
1635
1636 func (c *ColumnInsertCall) Do(opts ...googleapi.CallOption) (*Column, error) {
1637 gensupport.SetOptions(c.urlParams_, opts...)
1638 res, err := c.doRequest("json")
1639 if res != nil && res.StatusCode == http.StatusNotModified {
1640 if res.Body != nil {
1641 res.Body.Close()
1642 }
1643 return nil, &googleapi.Error{
1644 Code: res.StatusCode,
1645 Header: res.Header,
1646 }
1647 }
1648 if err != nil {
1649 return nil, err
1650 }
1651 defer googleapi.CloseBody(res)
1652 if err := googleapi.CheckResponse(res); err != nil {
1653 return nil, err
1654 }
1655 ret := &Column{
1656 ServerResponse: googleapi.ServerResponse{
1657 Header: res.Header,
1658 HTTPStatusCode: res.StatusCode,
1659 },
1660 }
1661 target := &ret
1662 if err := gensupport.DecodeResponse(target, res); err != nil {
1663 return nil, err
1664 }
1665 return ret, nil
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693 }
1694
1695
1696
1697 type ColumnListCall struct {
1698 s *Service
1699 tableId string
1700 urlParams_ gensupport.URLParams
1701 ifNoneMatch_ string
1702 ctx_ context.Context
1703 header_ http.Header
1704 }
1705
1706
1707 func (r *ColumnService) List(tableId string) *ColumnListCall {
1708 c := &ColumnListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1709 c.tableId = tableId
1710 return c
1711 }
1712
1713
1714
1715 func (c *ColumnListCall) MaxResults(maxResults int64) *ColumnListCall {
1716 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1717 return c
1718 }
1719
1720
1721
1722 func (c *ColumnListCall) PageToken(pageToken string) *ColumnListCall {
1723 c.urlParams_.Set("pageToken", pageToken)
1724 return c
1725 }
1726
1727
1728
1729
1730 func (c *ColumnListCall) Fields(s ...googleapi.Field) *ColumnListCall {
1731 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1732 return c
1733 }
1734
1735
1736
1737
1738
1739
1740 func (c *ColumnListCall) IfNoneMatch(entityTag string) *ColumnListCall {
1741 c.ifNoneMatch_ = entityTag
1742 return c
1743 }
1744
1745
1746
1747
1748 func (c *ColumnListCall) Context(ctx context.Context) *ColumnListCall {
1749 c.ctx_ = ctx
1750 return c
1751 }
1752
1753
1754
1755 func (c *ColumnListCall) Header() http.Header {
1756 if c.header_ == nil {
1757 c.header_ = make(http.Header)
1758 }
1759 return c.header_
1760 }
1761
1762 func (c *ColumnListCall) doRequest(alt string) (*http.Response, error) {
1763 reqHeaders := make(http.Header)
1764 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1765 for k, v := range c.header_ {
1766 reqHeaders[k] = v
1767 }
1768 reqHeaders.Set("User-Agent", c.s.userAgent())
1769 if c.ifNoneMatch_ != "" {
1770 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1771 }
1772 var body io.Reader = nil
1773 c.urlParams_.Set("alt", alt)
1774 c.urlParams_.Set("prettyPrint", "false")
1775 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns")
1776 urls += "?" + c.urlParams_.Encode()
1777 req, err := http.NewRequest("GET", urls, body)
1778 if err != nil {
1779 return nil, err
1780 }
1781 req.Header = reqHeaders
1782 googleapi.Expand(req.URL, map[string]string{
1783 "tableId": c.tableId,
1784 })
1785 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1786 }
1787
1788
1789
1790
1791
1792
1793
1794
1795 func (c *ColumnListCall) Do(opts ...googleapi.CallOption) (*ColumnList, error) {
1796 gensupport.SetOptions(c.urlParams_, opts...)
1797 res, err := c.doRequest("json")
1798 if res != nil && res.StatusCode == http.StatusNotModified {
1799 if res.Body != nil {
1800 res.Body.Close()
1801 }
1802 return nil, &googleapi.Error{
1803 Code: res.StatusCode,
1804 Header: res.Header,
1805 }
1806 }
1807 if err != nil {
1808 return nil, err
1809 }
1810 defer googleapi.CloseBody(res)
1811 if err := googleapi.CheckResponse(res); err != nil {
1812 return nil, err
1813 }
1814 ret := &ColumnList{
1815 ServerResponse: googleapi.ServerResponse{
1816 Header: res.Header,
1817 HTTPStatusCode: res.StatusCode,
1818 },
1819 }
1820 target := &ret
1821 if err := gensupport.DecodeResponse(target, res); err != nil {
1822 return nil, err
1823 }
1824 return ret, nil
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862 }
1863
1864
1865
1866
1867 func (c *ColumnListCall) Pages(ctx context.Context, f func(*ColumnList) error) error {
1868 c.ctx_ = ctx
1869 defer c.PageToken(c.urlParams_.Get("pageToken"))
1870 for {
1871 x, err := c.Do()
1872 if err != nil {
1873 return err
1874 }
1875 if err := f(x); err != nil {
1876 return err
1877 }
1878 if x.NextPageToken == "" {
1879 return nil
1880 }
1881 c.PageToken(x.NextPageToken)
1882 }
1883 }
1884
1885
1886
1887 type ColumnPatchCall struct {
1888 s *Service
1889 tableId string
1890 columnId string
1891 column *Column
1892 urlParams_ gensupport.URLParams
1893 ctx_ context.Context
1894 header_ http.Header
1895 }
1896
1897
1898
1899 func (r *ColumnService) Patch(tableId string, columnId string, column *Column) *ColumnPatchCall {
1900 c := &ColumnPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1901 c.tableId = tableId
1902 c.columnId = columnId
1903 c.column = column
1904 return c
1905 }
1906
1907
1908
1909
1910 func (c *ColumnPatchCall) Fields(s ...googleapi.Field) *ColumnPatchCall {
1911 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1912 return c
1913 }
1914
1915
1916
1917
1918 func (c *ColumnPatchCall) Context(ctx context.Context) *ColumnPatchCall {
1919 c.ctx_ = ctx
1920 return c
1921 }
1922
1923
1924
1925 func (c *ColumnPatchCall) Header() http.Header {
1926 if c.header_ == nil {
1927 c.header_ = make(http.Header)
1928 }
1929 return c.header_
1930 }
1931
1932 func (c *ColumnPatchCall) doRequest(alt string) (*http.Response, error) {
1933 reqHeaders := make(http.Header)
1934 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1935 for k, v := range c.header_ {
1936 reqHeaders[k] = v
1937 }
1938 reqHeaders.Set("User-Agent", c.s.userAgent())
1939 var body io.Reader = nil
1940 body, err := googleapi.WithoutDataWrapper.JSONReader(c.column)
1941 if err != nil {
1942 return nil, err
1943 }
1944 reqHeaders.Set("Content-Type", "application/json")
1945 c.urlParams_.Set("alt", alt)
1946 c.urlParams_.Set("prettyPrint", "false")
1947 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
1948 urls += "?" + c.urlParams_.Encode()
1949 req, err := http.NewRequest("PATCH", urls, body)
1950 if err != nil {
1951 return nil, err
1952 }
1953 req.Header = reqHeaders
1954 googleapi.Expand(req.URL, map[string]string{
1955 "tableId": c.tableId,
1956 "columnId": c.columnId,
1957 })
1958 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1959 }
1960
1961
1962
1963
1964
1965
1966
1967
1968 func (c *ColumnPatchCall) Do(opts ...googleapi.CallOption) (*Column, error) {
1969 gensupport.SetOptions(c.urlParams_, opts...)
1970 res, err := c.doRequest("json")
1971 if res != nil && res.StatusCode == http.StatusNotModified {
1972 if res.Body != nil {
1973 res.Body.Close()
1974 }
1975 return nil, &googleapi.Error{
1976 Code: res.StatusCode,
1977 Header: res.Header,
1978 }
1979 }
1980 if err != nil {
1981 return nil, err
1982 }
1983 defer googleapi.CloseBody(res)
1984 if err := googleapi.CheckResponse(res); err != nil {
1985 return nil, err
1986 }
1987 ret := &Column{
1988 ServerResponse: googleapi.ServerResponse{
1989 Header: res.Header,
1990 HTTPStatusCode: res.StatusCode,
1991 },
1992 }
1993 target := &ret
1994 if err := gensupport.DecodeResponse(target, res); err != nil {
1995 return nil, err
1996 }
1997 return ret, nil
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032 }
2033
2034
2035
2036 type ColumnUpdateCall struct {
2037 s *Service
2038 tableId string
2039 columnId string
2040 column *Column
2041 urlParams_ gensupport.URLParams
2042 ctx_ context.Context
2043 header_ http.Header
2044 }
2045
2046
2047 func (r *ColumnService) Update(tableId string, columnId string, column *Column) *ColumnUpdateCall {
2048 c := &ColumnUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2049 c.tableId = tableId
2050 c.columnId = columnId
2051 c.column = column
2052 return c
2053 }
2054
2055
2056
2057
2058 func (c *ColumnUpdateCall) Fields(s ...googleapi.Field) *ColumnUpdateCall {
2059 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2060 return c
2061 }
2062
2063
2064
2065
2066 func (c *ColumnUpdateCall) Context(ctx context.Context) *ColumnUpdateCall {
2067 c.ctx_ = ctx
2068 return c
2069 }
2070
2071
2072
2073 func (c *ColumnUpdateCall) Header() http.Header {
2074 if c.header_ == nil {
2075 c.header_ = make(http.Header)
2076 }
2077 return c.header_
2078 }
2079
2080 func (c *ColumnUpdateCall) doRequest(alt string) (*http.Response, error) {
2081 reqHeaders := make(http.Header)
2082 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2083 for k, v := range c.header_ {
2084 reqHeaders[k] = v
2085 }
2086 reqHeaders.Set("User-Agent", c.s.userAgent())
2087 var body io.Reader = nil
2088 body, err := googleapi.WithoutDataWrapper.JSONReader(c.column)
2089 if err != nil {
2090 return nil, err
2091 }
2092 reqHeaders.Set("Content-Type", "application/json")
2093 c.urlParams_.Set("alt", alt)
2094 c.urlParams_.Set("prettyPrint", "false")
2095 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
2096 urls += "?" + c.urlParams_.Encode()
2097 req, err := http.NewRequest("PUT", urls, body)
2098 if err != nil {
2099 return nil, err
2100 }
2101 req.Header = reqHeaders
2102 googleapi.Expand(req.URL, map[string]string{
2103 "tableId": c.tableId,
2104 "columnId": c.columnId,
2105 })
2106 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2107 }
2108
2109
2110
2111
2112
2113
2114
2115
2116 func (c *ColumnUpdateCall) Do(opts ...googleapi.CallOption) (*Column, error) {
2117 gensupport.SetOptions(c.urlParams_, opts...)
2118 res, err := c.doRequest("json")
2119 if res != nil && res.StatusCode == http.StatusNotModified {
2120 if res.Body != nil {
2121 res.Body.Close()
2122 }
2123 return nil, &googleapi.Error{
2124 Code: res.StatusCode,
2125 Header: res.Header,
2126 }
2127 }
2128 if err != nil {
2129 return nil, err
2130 }
2131 defer googleapi.CloseBody(res)
2132 if err := googleapi.CheckResponse(res); err != nil {
2133 return nil, err
2134 }
2135 ret := &Column{
2136 ServerResponse: googleapi.ServerResponse{
2137 Header: res.Header,
2138 HTTPStatusCode: res.StatusCode,
2139 },
2140 }
2141 target := &ret
2142 if err := gensupport.DecodeResponse(target, res); err != nil {
2143 return nil, err
2144 }
2145 return ret, nil
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180 }
2181
2182
2183
2184 type QuerySqlCall struct {
2185 s *Service
2186 urlParams_ gensupport.URLParams
2187 ctx_ context.Context
2188 header_ http.Header
2189 }
2190
2191
2192
2193 func (r *QueryService) Sql(sql string) *QuerySqlCall {
2194 c := &QuerySqlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2195 c.urlParams_.Set("sql", sql)
2196 return c
2197 }
2198
2199
2200
2201 func (c *QuerySqlCall) Hdrs(hdrs bool) *QuerySqlCall {
2202 c.urlParams_.Set("hdrs", fmt.Sprint(hdrs))
2203 return c
2204 }
2205
2206
2207
2208
2209 func (c *QuerySqlCall) Typed(typed bool) *QuerySqlCall {
2210 c.urlParams_.Set("typed", fmt.Sprint(typed))
2211 return c
2212 }
2213
2214
2215
2216
2217 func (c *QuerySqlCall) Fields(s ...googleapi.Field) *QuerySqlCall {
2218 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2219 return c
2220 }
2221
2222
2223
2224
2225 func (c *QuerySqlCall) Context(ctx context.Context) *QuerySqlCall {
2226 c.ctx_ = ctx
2227 return c
2228 }
2229
2230
2231
2232 func (c *QuerySqlCall) Header() http.Header {
2233 if c.header_ == nil {
2234 c.header_ = make(http.Header)
2235 }
2236 return c.header_
2237 }
2238
2239 func (c *QuerySqlCall) doRequest(alt string) (*http.Response, error) {
2240 reqHeaders := make(http.Header)
2241 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2242 for k, v := range c.header_ {
2243 reqHeaders[k] = v
2244 }
2245 reqHeaders.Set("User-Agent", c.s.userAgent())
2246 var body io.Reader = nil
2247 c.urlParams_.Set("alt", alt)
2248 c.urlParams_.Set("prettyPrint", "false")
2249 urls := googleapi.ResolveRelative(c.s.BasePath, "query")
2250 urls += "?" + c.urlParams_.Encode()
2251 req, err := http.NewRequest("POST", urls, body)
2252 if err != nil {
2253 return nil, err
2254 }
2255 req.Header = reqHeaders
2256 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2257 }
2258
2259
2260
2261
2262 func (c *QuerySqlCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
2263 gensupport.SetOptions(c.urlParams_, opts...)
2264 res, err := c.doRequest("media")
2265 if err != nil {
2266 return nil, err
2267 }
2268 if err := googleapi.CheckMediaResponse(res); err != nil {
2269 res.Body.Close()
2270 return nil, err
2271 }
2272 return res, nil
2273 }
2274
2275
2276
2277
2278
2279
2280
2281
2282 func (c *QuerySqlCall) Do(opts ...googleapi.CallOption) (*Sqlresponse, error) {
2283 gensupport.SetOptions(c.urlParams_, opts...)
2284 res, err := c.doRequest("json")
2285 if res != nil && res.StatusCode == http.StatusNotModified {
2286 if res.Body != nil {
2287 res.Body.Close()
2288 }
2289 return nil, &googleapi.Error{
2290 Code: res.StatusCode,
2291 Header: res.Header,
2292 }
2293 }
2294 if err != nil {
2295 return nil, err
2296 }
2297 defer googleapi.CloseBody(res)
2298 if err := googleapi.CheckResponse(res); err != nil {
2299 return nil, err
2300 }
2301 ret := &Sqlresponse{
2302 ServerResponse: googleapi.ServerResponse{
2303 Header: res.Header,
2304 HTTPStatusCode: res.StatusCode,
2305 },
2306 }
2307 target := &ret
2308 if err := gensupport.DecodeResponse(target, res); err != nil {
2309 return nil, err
2310 }
2311 return ret, nil
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349 }
2350
2351
2352
2353 type QuerySqlGetCall struct {
2354 s *Service
2355 urlParams_ gensupport.URLParams
2356 ifNoneMatch_ string
2357 ctx_ context.Context
2358 header_ http.Header
2359 }
2360
2361
2362 func (r *QueryService) SqlGet(sql string) *QuerySqlGetCall {
2363 c := &QuerySqlGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2364 c.urlParams_.Set("sql", sql)
2365 return c
2366 }
2367
2368
2369
2370 func (c *QuerySqlGetCall) Hdrs(hdrs bool) *QuerySqlGetCall {
2371 c.urlParams_.Set("hdrs", fmt.Sprint(hdrs))
2372 return c
2373 }
2374
2375
2376
2377
2378 func (c *QuerySqlGetCall) Typed(typed bool) *QuerySqlGetCall {
2379 c.urlParams_.Set("typed", fmt.Sprint(typed))
2380 return c
2381 }
2382
2383
2384
2385
2386 func (c *QuerySqlGetCall) Fields(s ...googleapi.Field) *QuerySqlGetCall {
2387 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2388 return c
2389 }
2390
2391
2392
2393
2394
2395
2396 func (c *QuerySqlGetCall) IfNoneMatch(entityTag string) *QuerySqlGetCall {
2397 c.ifNoneMatch_ = entityTag
2398 return c
2399 }
2400
2401
2402
2403
2404 func (c *QuerySqlGetCall) Context(ctx context.Context) *QuerySqlGetCall {
2405 c.ctx_ = ctx
2406 return c
2407 }
2408
2409
2410
2411 func (c *QuerySqlGetCall) Header() http.Header {
2412 if c.header_ == nil {
2413 c.header_ = make(http.Header)
2414 }
2415 return c.header_
2416 }
2417
2418 func (c *QuerySqlGetCall) doRequest(alt string) (*http.Response, error) {
2419 reqHeaders := make(http.Header)
2420 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2421 for k, v := range c.header_ {
2422 reqHeaders[k] = v
2423 }
2424 reqHeaders.Set("User-Agent", c.s.userAgent())
2425 if c.ifNoneMatch_ != "" {
2426 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2427 }
2428 var body io.Reader = nil
2429 c.urlParams_.Set("alt", alt)
2430 c.urlParams_.Set("prettyPrint", "false")
2431 urls := googleapi.ResolveRelative(c.s.BasePath, "query")
2432 urls += "?" + c.urlParams_.Encode()
2433 req, err := http.NewRequest("GET", urls, body)
2434 if err != nil {
2435 return nil, err
2436 }
2437 req.Header = reqHeaders
2438 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2439 }
2440
2441
2442
2443
2444 func (c *QuerySqlGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
2445 gensupport.SetOptions(c.urlParams_, opts...)
2446 res, err := c.doRequest("media")
2447 if err != nil {
2448 return nil, err
2449 }
2450 if err := googleapi.CheckMediaResponse(res); err != nil {
2451 res.Body.Close()
2452 return nil, err
2453 }
2454 return res, nil
2455 }
2456
2457
2458
2459
2460
2461
2462
2463
2464 func (c *QuerySqlGetCall) Do(opts ...googleapi.CallOption) (*Sqlresponse, error) {
2465 gensupport.SetOptions(c.urlParams_, opts...)
2466 res, err := c.doRequest("json")
2467 if res != nil && res.StatusCode == http.StatusNotModified {
2468 if res.Body != nil {
2469 res.Body.Close()
2470 }
2471 return nil, &googleapi.Error{
2472 Code: res.StatusCode,
2473 Header: res.Header,
2474 }
2475 }
2476 if err != nil {
2477 return nil, err
2478 }
2479 defer googleapi.CloseBody(res)
2480 if err := googleapi.CheckResponse(res); err != nil {
2481 return nil, err
2482 }
2483 ret := &Sqlresponse{
2484 ServerResponse: googleapi.ServerResponse{
2485 Header: res.Header,
2486 HTTPStatusCode: res.StatusCode,
2487 },
2488 }
2489 target := &ret
2490 if err := gensupport.DecodeResponse(target, res); err != nil {
2491 return nil, err
2492 }
2493 return ret, nil
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531 }
2532
2533
2534
2535 type StyleDeleteCall struct {
2536 s *Service
2537 tableId string
2538 styleId int64
2539 urlParams_ gensupport.URLParams
2540 ctx_ context.Context
2541 header_ http.Header
2542 }
2543
2544
2545 func (r *StyleService) Delete(tableId string, styleId int64) *StyleDeleteCall {
2546 c := &StyleDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2547 c.tableId = tableId
2548 c.styleId = styleId
2549 return c
2550 }
2551
2552
2553
2554
2555 func (c *StyleDeleteCall) Fields(s ...googleapi.Field) *StyleDeleteCall {
2556 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2557 return c
2558 }
2559
2560
2561
2562
2563 func (c *StyleDeleteCall) Context(ctx context.Context) *StyleDeleteCall {
2564 c.ctx_ = ctx
2565 return c
2566 }
2567
2568
2569
2570 func (c *StyleDeleteCall) Header() http.Header {
2571 if c.header_ == nil {
2572 c.header_ = make(http.Header)
2573 }
2574 return c.header_
2575 }
2576
2577 func (c *StyleDeleteCall) doRequest(alt string) (*http.Response, error) {
2578 reqHeaders := make(http.Header)
2579 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2580 for k, v := range c.header_ {
2581 reqHeaders[k] = v
2582 }
2583 reqHeaders.Set("User-Agent", c.s.userAgent())
2584 var body io.Reader = nil
2585 c.urlParams_.Set("alt", alt)
2586 c.urlParams_.Set("prettyPrint", "false")
2587 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
2588 urls += "?" + c.urlParams_.Encode()
2589 req, err := http.NewRequest("DELETE", urls, body)
2590 if err != nil {
2591 return nil, err
2592 }
2593 req.Header = reqHeaders
2594 googleapi.Expand(req.URL, map[string]string{
2595 "tableId": c.tableId,
2596 "styleId": strconv.FormatInt(c.styleId, 10),
2597 })
2598 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2599 }
2600
2601
2602 func (c *StyleDeleteCall) Do(opts ...googleapi.CallOption) error {
2603 gensupport.SetOptions(c.urlParams_, opts...)
2604 res, err := c.doRequest("json")
2605 if err != nil {
2606 return err
2607 }
2608 defer googleapi.CloseBody(res)
2609 if err := googleapi.CheckResponse(res); err != nil {
2610 return err
2611 }
2612 return nil
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642 }
2643
2644
2645
2646 type StyleGetCall struct {
2647 s *Service
2648 tableId string
2649 styleId int64
2650 urlParams_ gensupport.URLParams
2651 ifNoneMatch_ string
2652 ctx_ context.Context
2653 header_ http.Header
2654 }
2655
2656
2657 func (r *StyleService) Get(tableId string, styleId int64) *StyleGetCall {
2658 c := &StyleGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2659 c.tableId = tableId
2660 c.styleId = styleId
2661 return c
2662 }
2663
2664
2665
2666
2667 func (c *StyleGetCall) Fields(s ...googleapi.Field) *StyleGetCall {
2668 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2669 return c
2670 }
2671
2672
2673
2674
2675
2676
2677 func (c *StyleGetCall) IfNoneMatch(entityTag string) *StyleGetCall {
2678 c.ifNoneMatch_ = entityTag
2679 return c
2680 }
2681
2682
2683
2684
2685 func (c *StyleGetCall) Context(ctx context.Context) *StyleGetCall {
2686 c.ctx_ = ctx
2687 return c
2688 }
2689
2690
2691
2692 func (c *StyleGetCall) Header() http.Header {
2693 if c.header_ == nil {
2694 c.header_ = make(http.Header)
2695 }
2696 return c.header_
2697 }
2698
2699 func (c *StyleGetCall) doRequest(alt string) (*http.Response, error) {
2700 reqHeaders := make(http.Header)
2701 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2702 for k, v := range c.header_ {
2703 reqHeaders[k] = v
2704 }
2705 reqHeaders.Set("User-Agent", c.s.userAgent())
2706 if c.ifNoneMatch_ != "" {
2707 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2708 }
2709 var body io.Reader = nil
2710 c.urlParams_.Set("alt", alt)
2711 c.urlParams_.Set("prettyPrint", "false")
2712 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
2713 urls += "?" + c.urlParams_.Encode()
2714 req, err := http.NewRequest("GET", urls, body)
2715 if err != nil {
2716 return nil, err
2717 }
2718 req.Header = reqHeaders
2719 googleapi.Expand(req.URL, map[string]string{
2720 "tableId": c.tableId,
2721 "styleId": strconv.FormatInt(c.styleId, 10),
2722 })
2723 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2724 }
2725
2726
2727
2728
2729
2730
2731
2732
2733 func (c *StyleGetCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
2734 gensupport.SetOptions(c.urlParams_, opts...)
2735 res, err := c.doRequest("json")
2736 if res != nil && res.StatusCode == http.StatusNotModified {
2737 if res.Body != nil {
2738 res.Body.Close()
2739 }
2740 return nil, &googleapi.Error{
2741 Code: res.StatusCode,
2742 Header: res.Header,
2743 }
2744 }
2745 if err != nil {
2746 return nil, err
2747 }
2748 defer googleapi.CloseBody(res)
2749 if err := googleapi.CheckResponse(res); err != nil {
2750 return nil, err
2751 }
2752 ret := &StyleSetting{
2753 ServerResponse: googleapi.ServerResponse{
2754 Header: res.Header,
2755 HTTPStatusCode: res.StatusCode,
2756 },
2757 }
2758 target := &ret
2759 if err := gensupport.DecodeResponse(target, res); err != nil {
2760 return nil, err
2761 }
2762 return ret, nil
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796 }
2797
2798
2799
2800 type StyleInsertCall struct {
2801 s *Service
2802 tableId string
2803 stylesetting *StyleSetting
2804 urlParams_ gensupport.URLParams
2805 ctx_ context.Context
2806 header_ http.Header
2807 }
2808
2809
2810 func (r *StyleService) Insert(tableId string, stylesetting *StyleSetting) *StyleInsertCall {
2811 c := &StyleInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2812 c.tableId = tableId
2813 c.stylesetting = stylesetting
2814 return c
2815 }
2816
2817
2818
2819
2820 func (c *StyleInsertCall) Fields(s ...googleapi.Field) *StyleInsertCall {
2821 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2822 return c
2823 }
2824
2825
2826
2827
2828 func (c *StyleInsertCall) Context(ctx context.Context) *StyleInsertCall {
2829 c.ctx_ = ctx
2830 return c
2831 }
2832
2833
2834
2835 func (c *StyleInsertCall) Header() http.Header {
2836 if c.header_ == nil {
2837 c.header_ = make(http.Header)
2838 }
2839 return c.header_
2840 }
2841
2842 func (c *StyleInsertCall) doRequest(alt string) (*http.Response, error) {
2843 reqHeaders := make(http.Header)
2844 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2845 for k, v := range c.header_ {
2846 reqHeaders[k] = v
2847 }
2848 reqHeaders.Set("User-Agent", c.s.userAgent())
2849 var body io.Reader = nil
2850 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting)
2851 if err != nil {
2852 return nil, err
2853 }
2854 reqHeaders.Set("Content-Type", "application/json")
2855 c.urlParams_.Set("alt", alt)
2856 c.urlParams_.Set("prettyPrint", "false")
2857 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles")
2858 urls += "?" + c.urlParams_.Encode()
2859 req, err := http.NewRequest("POST", urls, body)
2860 if err != nil {
2861 return nil, err
2862 }
2863 req.Header = reqHeaders
2864 googleapi.Expand(req.URL, map[string]string{
2865 "tableId": c.tableId,
2866 })
2867 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2868 }
2869
2870
2871
2872
2873
2874
2875
2876
2877 func (c *StyleInsertCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
2878 gensupport.SetOptions(c.urlParams_, opts...)
2879 res, err := c.doRequest("json")
2880 if res != nil && res.StatusCode == http.StatusNotModified {
2881 if res.Body != nil {
2882 res.Body.Close()
2883 }
2884 return nil, &googleapi.Error{
2885 Code: res.StatusCode,
2886 Header: res.Header,
2887 }
2888 }
2889 if err != nil {
2890 return nil, err
2891 }
2892 defer googleapi.CloseBody(res)
2893 if err := googleapi.CheckResponse(res); err != nil {
2894 return nil, err
2895 }
2896 ret := &StyleSetting{
2897 ServerResponse: googleapi.ServerResponse{
2898 Header: res.Header,
2899 HTTPStatusCode: res.StatusCode,
2900 },
2901 }
2902 target := &ret
2903 if err := gensupport.DecodeResponse(target, res); err != nil {
2904 return nil, err
2905 }
2906 return ret, nil
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934 }
2935
2936
2937
2938 type StyleListCall struct {
2939 s *Service
2940 tableId string
2941 urlParams_ gensupport.URLParams
2942 ifNoneMatch_ string
2943 ctx_ context.Context
2944 header_ http.Header
2945 }
2946
2947
2948 func (r *StyleService) List(tableId string) *StyleListCall {
2949 c := &StyleListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2950 c.tableId = tableId
2951 return c
2952 }
2953
2954
2955
2956 func (c *StyleListCall) MaxResults(maxResults int64) *StyleListCall {
2957 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2958 return c
2959 }
2960
2961
2962
2963 func (c *StyleListCall) PageToken(pageToken string) *StyleListCall {
2964 c.urlParams_.Set("pageToken", pageToken)
2965 return c
2966 }
2967
2968
2969
2970
2971 func (c *StyleListCall) Fields(s ...googleapi.Field) *StyleListCall {
2972 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2973 return c
2974 }
2975
2976
2977
2978
2979
2980
2981 func (c *StyleListCall) IfNoneMatch(entityTag string) *StyleListCall {
2982 c.ifNoneMatch_ = entityTag
2983 return c
2984 }
2985
2986
2987
2988
2989 func (c *StyleListCall) Context(ctx context.Context) *StyleListCall {
2990 c.ctx_ = ctx
2991 return c
2992 }
2993
2994
2995
2996 func (c *StyleListCall) Header() http.Header {
2997 if c.header_ == nil {
2998 c.header_ = make(http.Header)
2999 }
3000 return c.header_
3001 }
3002
3003 func (c *StyleListCall) doRequest(alt string) (*http.Response, error) {
3004 reqHeaders := make(http.Header)
3005 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3006 for k, v := range c.header_ {
3007 reqHeaders[k] = v
3008 }
3009 reqHeaders.Set("User-Agent", c.s.userAgent())
3010 if c.ifNoneMatch_ != "" {
3011 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3012 }
3013 var body io.Reader = nil
3014 c.urlParams_.Set("alt", alt)
3015 c.urlParams_.Set("prettyPrint", "false")
3016 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles")
3017 urls += "?" + c.urlParams_.Encode()
3018 req, err := http.NewRequest("GET", urls, body)
3019 if err != nil {
3020 return nil, err
3021 }
3022 req.Header = reqHeaders
3023 googleapi.Expand(req.URL, map[string]string{
3024 "tableId": c.tableId,
3025 })
3026 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3027 }
3028
3029
3030
3031
3032
3033
3034
3035
3036 func (c *StyleListCall) Do(opts ...googleapi.CallOption) (*StyleSettingList, error) {
3037 gensupport.SetOptions(c.urlParams_, opts...)
3038 res, err := c.doRequest("json")
3039 if res != nil && res.StatusCode == http.StatusNotModified {
3040 if res.Body != nil {
3041 res.Body.Close()
3042 }
3043 return nil, &googleapi.Error{
3044 Code: res.StatusCode,
3045 Header: res.Header,
3046 }
3047 }
3048 if err != nil {
3049 return nil, err
3050 }
3051 defer googleapi.CloseBody(res)
3052 if err := googleapi.CheckResponse(res); err != nil {
3053 return nil, err
3054 }
3055 ret := &StyleSettingList{
3056 ServerResponse: googleapi.ServerResponse{
3057 Header: res.Header,
3058 HTTPStatusCode: res.StatusCode,
3059 },
3060 }
3061 target := &ret
3062 if err := gensupport.DecodeResponse(target, res); err != nil {
3063 return nil, err
3064 }
3065 return ret, nil
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103 }
3104
3105
3106
3107
3108 func (c *StyleListCall) Pages(ctx context.Context, f func(*StyleSettingList) error) error {
3109 c.ctx_ = ctx
3110 defer c.PageToken(c.urlParams_.Get("pageToken"))
3111 for {
3112 x, err := c.Do()
3113 if err != nil {
3114 return err
3115 }
3116 if err := f(x); err != nil {
3117 return err
3118 }
3119 if x.NextPageToken == "" {
3120 return nil
3121 }
3122 c.PageToken(x.NextPageToken)
3123 }
3124 }
3125
3126
3127
3128 type StylePatchCall struct {
3129 s *Service
3130 tableId string
3131 styleId int64
3132 stylesetting *StyleSetting
3133 urlParams_ gensupport.URLParams
3134 ctx_ context.Context
3135 header_ http.Header
3136 }
3137
3138
3139
3140 func (r *StyleService) Patch(tableId string, styleId int64, stylesetting *StyleSetting) *StylePatchCall {
3141 c := &StylePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3142 c.tableId = tableId
3143 c.styleId = styleId
3144 c.stylesetting = stylesetting
3145 return c
3146 }
3147
3148
3149
3150
3151 func (c *StylePatchCall) Fields(s ...googleapi.Field) *StylePatchCall {
3152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3153 return c
3154 }
3155
3156
3157
3158
3159 func (c *StylePatchCall) Context(ctx context.Context) *StylePatchCall {
3160 c.ctx_ = ctx
3161 return c
3162 }
3163
3164
3165
3166 func (c *StylePatchCall) Header() http.Header {
3167 if c.header_ == nil {
3168 c.header_ = make(http.Header)
3169 }
3170 return c.header_
3171 }
3172
3173 func (c *StylePatchCall) doRequest(alt string) (*http.Response, error) {
3174 reqHeaders := make(http.Header)
3175 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3176 for k, v := range c.header_ {
3177 reqHeaders[k] = v
3178 }
3179 reqHeaders.Set("User-Agent", c.s.userAgent())
3180 var body io.Reader = nil
3181 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting)
3182 if err != nil {
3183 return nil, err
3184 }
3185 reqHeaders.Set("Content-Type", "application/json")
3186 c.urlParams_.Set("alt", alt)
3187 c.urlParams_.Set("prettyPrint", "false")
3188 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
3189 urls += "?" + c.urlParams_.Encode()
3190 req, err := http.NewRequest("PATCH", urls, body)
3191 if err != nil {
3192 return nil, err
3193 }
3194 req.Header = reqHeaders
3195 googleapi.Expand(req.URL, map[string]string{
3196 "tableId": c.tableId,
3197 "styleId": strconv.FormatInt(c.styleId, 10),
3198 })
3199 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3200 }
3201
3202
3203
3204
3205
3206
3207
3208
3209 func (c *StylePatchCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
3210 gensupport.SetOptions(c.urlParams_, opts...)
3211 res, err := c.doRequest("json")
3212 if res != nil && res.StatusCode == http.StatusNotModified {
3213 if res.Body != nil {
3214 res.Body.Close()
3215 }
3216 return nil, &googleapi.Error{
3217 Code: res.StatusCode,
3218 Header: res.Header,
3219 }
3220 }
3221 if err != nil {
3222 return nil, err
3223 }
3224 defer googleapi.CloseBody(res)
3225 if err := googleapi.CheckResponse(res); err != nil {
3226 return nil, err
3227 }
3228 ret := &StyleSetting{
3229 ServerResponse: googleapi.ServerResponse{
3230 Header: res.Header,
3231 HTTPStatusCode: res.StatusCode,
3232 },
3233 }
3234 target := &ret
3235 if err := gensupport.DecodeResponse(target, res); err != nil {
3236 return nil, err
3237 }
3238 return ret, nil
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274 }
3275
3276
3277
3278 type StyleUpdateCall struct {
3279 s *Service
3280 tableId string
3281 styleId int64
3282 stylesetting *StyleSetting
3283 urlParams_ gensupport.URLParams
3284 ctx_ context.Context
3285 header_ http.Header
3286 }
3287
3288
3289 func (r *StyleService) Update(tableId string, styleId int64, stylesetting *StyleSetting) *StyleUpdateCall {
3290 c := &StyleUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3291 c.tableId = tableId
3292 c.styleId = styleId
3293 c.stylesetting = stylesetting
3294 return c
3295 }
3296
3297
3298
3299
3300 func (c *StyleUpdateCall) Fields(s ...googleapi.Field) *StyleUpdateCall {
3301 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3302 return c
3303 }
3304
3305
3306
3307
3308 func (c *StyleUpdateCall) Context(ctx context.Context) *StyleUpdateCall {
3309 c.ctx_ = ctx
3310 return c
3311 }
3312
3313
3314
3315 func (c *StyleUpdateCall) Header() http.Header {
3316 if c.header_ == nil {
3317 c.header_ = make(http.Header)
3318 }
3319 return c.header_
3320 }
3321
3322 func (c *StyleUpdateCall) doRequest(alt string) (*http.Response, error) {
3323 reqHeaders := make(http.Header)
3324 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3325 for k, v := range c.header_ {
3326 reqHeaders[k] = v
3327 }
3328 reqHeaders.Set("User-Agent", c.s.userAgent())
3329 var body io.Reader = nil
3330 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting)
3331 if err != nil {
3332 return nil, err
3333 }
3334 reqHeaders.Set("Content-Type", "application/json")
3335 c.urlParams_.Set("alt", alt)
3336 c.urlParams_.Set("prettyPrint", "false")
3337 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
3338 urls += "?" + c.urlParams_.Encode()
3339 req, err := http.NewRequest("PUT", urls, body)
3340 if err != nil {
3341 return nil, err
3342 }
3343 req.Header = reqHeaders
3344 googleapi.Expand(req.URL, map[string]string{
3345 "tableId": c.tableId,
3346 "styleId": strconv.FormatInt(c.styleId, 10),
3347 })
3348 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3349 }
3350
3351
3352
3353
3354
3355
3356
3357
3358 func (c *StyleUpdateCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
3359 gensupport.SetOptions(c.urlParams_, opts...)
3360 res, err := c.doRequest("json")
3361 if res != nil && res.StatusCode == http.StatusNotModified {
3362 if res.Body != nil {
3363 res.Body.Close()
3364 }
3365 return nil, &googleapi.Error{
3366 Code: res.StatusCode,
3367 Header: res.Header,
3368 }
3369 }
3370 if err != nil {
3371 return nil, err
3372 }
3373 defer googleapi.CloseBody(res)
3374 if err := googleapi.CheckResponse(res); err != nil {
3375 return nil, err
3376 }
3377 ret := &StyleSetting{
3378 ServerResponse: googleapi.ServerResponse{
3379 Header: res.Header,
3380 HTTPStatusCode: res.StatusCode,
3381 },
3382 }
3383 target := &ret
3384 if err := gensupport.DecodeResponse(target, res); err != nil {
3385 return nil, err
3386 }
3387 return ret, nil
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423 }
3424
3425
3426
3427 type TableCopyCall struct {
3428 s *Service
3429 tableId string
3430 urlParams_ gensupport.URLParams
3431 ctx_ context.Context
3432 header_ http.Header
3433 }
3434
3435
3436 func (r *TableService) Copy(tableId string) *TableCopyCall {
3437 c := &TableCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3438 c.tableId = tableId
3439 return c
3440 }
3441
3442
3443
3444 func (c *TableCopyCall) CopyPresentation(copyPresentation bool) *TableCopyCall {
3445 c.urlParams_.Set("copyPresentation", fmt.Sprint(copyPresentation))
3446 return c
3447 }
3448
3449
3450
3451
3452 func (c *TableCopyCall) Fields(s ...googleapi.Field) *TableCopyCall {
3453 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3454 return c
3455 }
3456
3457
3458
3459
3460 func (c *TableCopyCall) Context(ctx context.Context) *TableCopyCall {
3461 c.ctx_ = ctx
3462 return c
3463 }
3464
3465
3466
3467 func (c *TableCopyCall) Header() http.Header {
3468 if c.header_ == nil {
3469 c.header_ = make(http.Header)
3470 }
3471 return c.header_
3472 }
3473
3474 func (c *TableCopyCall) doRequest(alt string) (*http.Response, error) {
3475 reqHeaders := make(http.Header)
3476 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3477 for k, v := range c.header_ {
3478 reqHeaders[k] = v
3479 }
3480 reqHeaders.Set("User-Agent", c.s.userAgent())
3481 var body io.Reader = nil
3482 c.urlParams_.Set("alt", alt)
3483 c.urlParams_.Set("prettyPrint", "false")
3484 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/copy")
3485 urls += "?" + c.urlParams_.Encode()
3486 req, err := http.NewRequest("POST", urls, body)
3487 if err != nil {
3488 return nil, err
3489 }
3490 req.Header = reqHeaders
3491 googleapi.Expand(req.URL, map[string]string{
3492 "tableId": c.tableId,
3493 })
3494 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3495 }
3496
3497
3498
3499
3500
3501
3502
3503
3504 func (c *TableCopyCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3505 gensupport.SetOptions(c.urlParams_, opts...)
3506 res, err := c.doRequest("json")
3507 if res != nil && res.StatusCode == http.StatusNotModified {
3508 if res.Body != nil {
3509 res.Body.Close()
3510 }
3511 return nil, &googleapi.Error{
3512 Code: res.StatusCode,
3513 Header: res.Header,
3514 }
3515 }
3516 if err != nil {
3517 return nil, err
3518 }
3519 defer googleapi.CloseBody(res)
3520 if err := googleapi.CheckResponse(res); err != nil {
3521 return nil, err
3522 }
3523 ret := &Table{
3524 ServerResponse: googleapi.ServerResponse{
3525 Header: res.Header,
3526 HTTPStatusCode: res.StatusCode,
3527 },
3528 }
3529 target := &ret
3530 if err := gensupport.DecodeResponse(target, res); err != nil {
3531 return nil, err
3532 }
3533 return ret, nil
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564 }
3565
3566
3567
3568 type TableDeleteCall struct {
3569 s *Service
3570 tableId string
3571 urlParams_ gensupport.URLParams
3572 ctx_ context.Context
3573 header_ http.Header
3574 }
3575
3576
3577 func (r *TableService) Delete(tableId string) *TableDeleteCall {
3578 c := &TableDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3579 c.tableId = tableId
3580 return c
3581 }
3582
3583
3584
3585
3586 func (c *TableDeleteCall) Fields(s ...googleapi.Field) *TableDeleteCall {
3587 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3588 return c
3589 }
3590
3591
3592
3593
3594 func (c *TableDeleteCall) Context(ctx context.Context) *TableDeleteCall {
3595 c.ctx_ = ctx
3596 return c
3597 }
3598
3599
3600
3601 func (c *TableDeleteCall) Header() http.Header {
3602 if c.header_ == nil {
3603 c.header_ = make(http.Header)
3604 }
3605 return c.header_
3606 }
3607
3608 func (c *TableDeleteCall) doRequest(alt string) (*http.Response, error) {
3609 reqHeaders := make(http.Header)
3610 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3611 for k, v := range c.header_ {
3612 reqHeaders[k] = v
3613 }
3614 reqHeaders.Set("User-Agent", c.s.userAgent())
3615 var body io.Reader = nil
3616 c.urlParams_.Set("alt", alt)
3617 c.urlParams_.Set("prettyPrint", "false")
3618 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}")
3619 urls += "?" + c.urlParams_.Encode()
3620 req, err := http.NewRequest("DELETE", urls, body)
3621 if err != nil {
3622 return nil, err
3623 }
3624 req.Header = reqHeaders
3625 googleapi.Expand(req.URL, map[string]string{
3626 "tableId": c.tableId,
3627 })
3628 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3629 }
3630
3631
3632 func (c *TableDeleteCall) Do(opts ...googleapi.CallOption) error {
3633 gensupport.SetOptions(c.urlParams_, opts...)
3634 res, err := c.doRequest("json")
3635 if err != nil {
3636 return err
3637 }
3638 defer googleapi.CloseBody(res)
3639 if err := googleapi.CheckResponse(res); err != nil {
3640 return err
3641 }
3642 return nil
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664 }
3665
3666
3667
3668 type TableGetCall struct {
3669 s *Service
3670 tableId string
3671 urlParams_ gensupport.URLParams
3672 ifNoneMatch_ string
3673 ctx_ context.Context
3674 header_ http.Header
3675 }
3676
3677
3678 func (r *TableService) Get(tableId string) *TableGetCall {
3679 c := &TableGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3680 c.tableId = tableId
3681 return c
3682 }
3683
3684
3685
3686
3687 func (c *TableGetCall) Fields(s ...googleapi.Field) *TableGetCall {
3688 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3689 return c
3690 }
3691
3692
3693
3694
3695
3696
3697 func (c *TableGetCall) IfNoneMatch(entityTag string) *TableGetCall {
3698 c.ifNoneMatch_ = entityTag
3699 return c
3700 }
3701
3702
3703
3704
3705 func (c *TableGetCall) Context(ctx context.Context) *TableGetCall {
3706 c.ctx_ = ctx
3707 return c
3708 }
3709
3710
3711
3712 func (c *TableGetCall) Header() http.Header {
3713 if c.header_ == nil {
3714 c.header_ = make(http.Header)
3715 }
3716 return c.header_
3717 }
3718
3719 func (c *TableGetCall) doRequest(alt string) (*http.Response, error) {
3720 reqHeaders := make(http.Header)
3721 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3722 for k, v := range c.header_ {
3723 reqHeaders[k] = v
3724 }
3725 reqHeaders.Set("User-Agent", c.s.userAgent())
3726 if c.ifNoneMatch_ != "" {
3727 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3728 }
3729 var body io.Reader = nil
3730 c.urlParams_.Set("alt", alt)
3731 c.urlParams_.Set("prettyPrint", "false")
3732 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}")
3733 urls += "?" + c.urlParams_.Encode()
3734 req, err := http.NewRequest("GET", urls, body)
3735 if err != nil {
3736 return nil, err
3737 }
3738 req.Header = reqHeaders
3739 googleapi.Expand(req.URL, map[string]string{
3740 "tableId": c.tableId,
3741 })
3742 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3743 }
3744
3745
3746
3747
3748
3749
3750
3751
3752 func (c *TableGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3753 gensupport.SetOptions(c.urlParams_, opts...)
3754 res, err := c.doRequest("json")
3755 if res != nil && res.StatusCode == http.StatusNotModified {
3756 if res.Body != nil {
3757 res.Body.Close()
3758 }
3759 return nil, &googleapi.Error{
3760 Code: res.StatusCode,
3761 Header: res.Header,
3762 }
3763 }
3764 if err != nil {
3765 return nil, err
3766 }
3767 defer googleapi.CloseBody(res)
3768 if err := googleapi.CheckResponse(res); err != nil {
3769 return nil, err
3770 }
3771 ret := &Table{
3772 ServerResponse: googleapi.ServerResponse{
3773 Header: res.Header,
3774 HTTPStatusCode: res.StatusCode,
3775 },
3776 }
3777 target := &ret
3778 if err := gensupport.DecodeResponse(target, res); err != nil {
3779 return nil, err
3780 }
3781 return ret, nil
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 type TableImportRowsCall struct {
3812 s *Service
3813 tableId string
3814 urlParams_ gensupport.URLParams
3815 mediaInfo_ *gensupport.MediaInfo
3816 ctx_ context.Context
3817 header_ http.Header
3818 }
3819
3820
3821 func (r *TableService) ImportRows(tableId string) *TableImportRowsCall {
3822 c := &TableImportRowsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3823 c.tableId = tableId
3824 return c
3825 }
3826
3827
3828
3829
3830 func (c *TableImportRowsCall) Delimiter(delimiter string) *TableImportRowsCall {
3831 c.urlParams_.Set("delimiter", delimiter)
3832 return c
3833 }
3834
3835
3836
3837
3838 func (c *TableImportRowsCall) Encoding(encoding string) *TableImportRowsCall {
3839 c.urlParams_.Set("encoding", encoding)
3840 return c
3841 }
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852 func (c *TableImportRowsCall) EndLine(endLine int64) *TableImportRowsCall {
3853 c.urlParams_.Set("endLine", fmt.Sprint(endLine))
3854 return c
3855 }
3856
3857
3858
3859
3860 func (c *TableImportRowsCall) IsStrict(isStrict bool) *TableImportRowsCall {
3861 c.urlParams_.Set("isStrict", fmt.Sprint(isStrict))
3862 return c
3863 }
3864
3865
3866
3867 func (c *TableImportRowsCall) StartLine(startLine int64) *TableImportRowsCall {
3868 c.urlParams_.Set("startLine", fmt.Sprint(startLine))
3869 return c
3870 }
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880 func (c *TableImportRowsCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableImportRowsCall {
3881 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
3882 return c
3883 }
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894 func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportRowsCall {
3895 c.ctx_ = ctx
3896 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
3897 return c
3898 }
3899
3900
3901
3902
3903
3904 func (c *TableImportRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportRowsCall {
3905 c.mediaInfo_.SetProgressUpdater(pu)
3906 return c
3907 }
3908
3909
3910
3911
3912 func (c *TableImportRowsCall) Fields(s ...googleapi.Field) *TableImportRowsCall {
3913 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3914 return c
3915 }
3916
3917
3918
3919
3920
3921
3922 func (c *TableImportRowsCall) Context(ctx context.Context) *TableImportRowsCall {
3923 c.ctx_ = ctx
3924 return c
3925 }
3926
3927
3928
3929 func (c *TableImportRowsCall) Header() http.Header {
3930 if c.header_ == nil {
3931 c.header_ = make(http.Header)
3932 }
3933 return c.header_
3934 }
3935
3936 func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) {
3937 reqHeaders := make(http.Header)
3938 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3939 for k, v := range c.header_ {
3940 reqHeaders[k] = v
3941 }
3942 reqHeaders.Set("User-Agent", c.s.userAgent())
3943 var body io.Reader = nil
3944 c.urlParams_.Set("alt", alt)
3945 c.urlParams_.Set("prettyPrint", "false")
3946 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/import")
3947 if c.mediaInfo_ != nil {
3948 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/fusiontables/v1/tables/{tableId}/import")
3949 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
3950 }
3951 if body == nil {
3952 body = new(bytes.Buffer)
3953 reqHeaders.Set("Content-Type", "application/json")
3954 }
3955 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
3956 defer cleanup()
3957 urls += "?" + c.urlParams_.Encode()
3958 req, err := http.NewRequest("POST", urls, body)
3959 if err != nil {
3960 return nil, err
3961 }
3962 req.Header = reqHeaders
3963 req.GetBody = getBody
3964 googleapi.Expand(req.URL, map[string]string{
3965 "tableId": c.tableId,
3966 })
3967 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3968 }
3969
3970
3971
3972
3973
3974
3975
3976
3977 func (c *TableImportRowsCall) Do(opts ...googleapi.CallOption) (*Import, error) {
3978 gensupport.SetOptions(c.urlParams_, opts...)
3979 res, err := c.doRequest("json")
3980 if res != nil && res.StatusCode == http.StatusNotModified {
3981 if res.Body != nil {
3982 res.Body.Close()
3983 }
3984 return nil, &googleapi.Error{
3985 Code: res.StatusCode,
3986 Header: res.Header,
3987 }
3988 }
3989 if err != nil {
3990 return nil, err
3991 }
3992 defer googleapi.CloseBody(res)
3993 if err := googleapi.CheckResponse(res); err != nil {
3994 return nil, err
3995 }
3996 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
3997 if rx != nil {
3998 rx.Client = c.s.client
3999 rx.UserAgent = c.s.userAgent()
4000 ctx := c.ctx_
4001 if ctx == nil {
4002 ctx = context.TODO()
4003 }
4004 res, err = rx.Upload(ctx)
4005 if err != nil {
4006 return nil, err
4007 }
4008 defer res.Body.Close()
4009 if err := googleapi.CheckResponse(res); err != nil {
4010 return nil, err
4011 }
4012 }
4013 ret := &Import{
4014 ServerResponse: googleapi.ServerResponse{
4015 Header: res.Header,
4016 HTTPStatusCode: res.StatusCode,
4017 },
4018 }
4019 target := &ret
4020 if err := gensupport.DecodeResponse(target, res); err != nil {
4021 return nil, err
4022 }
4023 return ret, nil
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092 }
4093
4094
4095
4096 type TableImportTableCall struct {
4097 s *Service
4098 urlParams_ gensupport.URLParams
4099 mediaInfo_ *gensupport.MediaInfo
4100 ctx_ context.Context
4101 header_ http.Header
4102 }
4103
4104
4105 func (r *TableService) ImportTable(name string) *TableImportTableCall {
4106 c := &TableImportTableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4107 c.urlParams_.Set("name", name)
4108 return c
4109 }
4110
4111
4112
4113
4114 func (c *TableImportTableCall) Delimiter(delimiter string) *TableImportTableCall {
4115 c.urlParams_.Set("delimiter", delimiter)
4116 return c
4117 }
4118
4119
4120
4121
4122 func (c *TableImportTableCall) Encoding(encoding string) *TableImportTableCall {
4123 c.urlParams_.Set("encoding", encoding)
4124 return c
4125 }
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135 func (c *TableImportTableCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableImportTableCall {
4136 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
4137 return c
4138 }
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149 func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportTableCall {
4150 c.ctx_ = ctx
4151 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
4152 return c
4153 }
4154
4155
4156
4157
4158
4159 func (c *TableImportTableCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportTableCall {
4160 c.mediaInfo_.SetProgressUpdater(pu)
4161 return c
4162 }
4163
4164
4165
4166
4167 func (c *TableImportTableCall) Fields(s ...googleapi.Field) *TableImportTableCall {
4168 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4169 return c
4170 }
4171
4172
4173
4174
4175
4176
4177 func (c *TableImportTableCall) Context(ctx context.Context) *TableImportTableCall {
4178 c.ctx_ = ctx
4179 return c
4180 }
4181
4182
4183
4184 func (c *TableImportTableCall) Header() http.Header {
4185 if c.header_ == nil {
4186 c.header_ = make(http.Header)
4187 }
4188 return c.header_
4189 }
4190
4191 func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) {
4192 reqHeaders := make(http.Header)
4193 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4194 for k, v := range c.header_ {
4195 reqHeaders[k] = v
4196 }
4197 reqHeaders.Set("User-Agent", c.s.userAgent())
4198 var body io.Reader = nil
4199 c.urlParams_.Set("alt", alt)
4200 c.urlParams_.Set("prettyPrint", "false")
4201 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/import")
4202 if c.mediaInfo_ != nil {
4203 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/fusiontables/v1/tables/import")
4204 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
4205 }
4206 if body == nil {
4207 body = new(bytes.Buffer)
4208 reqHeaders.Set("Content-Type", "application/json")
4209 }
4210 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
4211 defer cleanup()
4212 urls += "?" + c.urlParams_.Encode()
4213 req, err := http.NewRequest("POST", urls, body)
4214 if err != nil {
4215 return nil, err
4216 }
4217 req.Header = reqHeaders
4218 req.GetBody = getBody
4219 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4220 }
4221
4222
4223
4224
4225
4226
4227
4228
4229 func (c *TableImportTableCall) Do(opts ...googleapi.CallOption) (*Table, error) {
4230 gensupport.SetOptions(c.urlParams_, opts...)
4231 res, err := c.doRequest("json")
4232 if res != nil && res.StatusCode == http.StatusNotModified {
4233 if res.Body != nil {
4234 res.Body.Close()
4235 }
4236 return nil, &googleapi.Error{
4237 Code: res.StatusCode,
4238 Header: res.Header,
4239 }
4240 }
4241 if err != nil {
4242 return nil, err
4243 }
4244 defer googleapi.CloseBody(res)
4245 if err := googleapi.CheckResponse(res); err != nil {
4246 return nil, err
4247 }
4248 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
4249 if rx != nil {
4250 rx.Client = c.s.client
4251 rx.UserAgent = c.s.userAgent()
4252 ctx := c.ctx_
4253 if ctx == nil {
4254 ctx = context.TODO()
4255 }
4256 res, err = rx.Upload(ctx)
4257 if err != nil {
4258 return nil, err
4259 }
4260 defer res.Body.Close()
4261 if err := googleapi.CheckResponse(res); err != nil {
4262 return nil, err
4263 }
4264 }
4265 ret := &Table{
4266 ServerResponse: googleapi.ServerResponse{
4267 Header: res.Header,
4268 HTTPStatusCode: res.StatusCode,
4269 },
4270 }
4271 target := &ret
4272 if err := gensupport.DecodeResponse(target, res); err != nil {
4273 return nil, err
4274 }
4275 return ret, nil
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
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
4324
4325
4326
4327 }
4328
4329
4330
4331 type TableInsertCall struct {
4332 s *Service
4333 table *Table
4334 urlParams_ gensupport.URLParams
4335 ctx_ context.Context
4336 header_ http.Header
4337 }
4338
4339
4340 func (r *TableService) Insert(table *Table) *TableInsertCall {
4341 c := &TableInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4342 c.table = table
4343 return c
4344 }
4345
4346
4347
4348
4349 func (c *TableInsertCall) Fields(s ...googleapi.Field) *TableInsertCall {
4350 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4351 return c
4352 }
4353
4354
4355
4356
4357 func (c *TableInsertCall) Context(ctx context.Context) *TableInsertCall {
4358 c.ctx_ = ctx
4359 return c
4360 }
4361
4362
4363
4364 func (c *TableInsertCall) Header() http.Header {
4365 if c.header_ == nil {
4366 c.header_ = make(http.Header)
4367 }
4368 return c.header_
4369 }
4370
4371 func (c *TableInsertCall) doRequest(alt string) (*http.Response, error) {
4372 reqHeaders := make(http.Header)
4373 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4374 for k, v := range c.header_ {
4375 reqHeaders[k] = v
4376 }
4377 reqHeaders.Set("User-Agent", c.s.userAgent())
4378 var body io.Reader = nil
4379 body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
4380 if err != nil {
4381 return nil, err
4382 }
4383 reqHeaders.Set("Content-Type", "application/json")
4384 c.urlParams_.Set("alt", alt)
4385 c.urlParams_.Set("prettyPrint", "false")
4386 urls := googleapi.ResolveRelative(c.s.BasePath, "tables")
4387 urls += "?" + c.urlParams_.Encode()
4388 req, err := http.NewRequest("POST", urls, body)
4389 if err != nil {
4390 return nil, err
4391 }
4392 req.Header = reqHeaders
4393 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4394 }
4395
4396
4397
4398
4399
4400
4401
4402
4403 func (c *TableInsertCall) Do(opts ...googleapi.CallOption) (*Table, error) {
4404 gensupport.SetOptions(c.urlParams_, opts...)
4405 res, err := c.doRequest("json")
4406 if res != nil && res.StatusCode == http.StatusNotModified {
4407 if res.Body != nil {
4408 res.Body.Close()
4409 }
4410 return nil, &googleapi.Error{
4411 Code: res.StatusCode,
4412 Header: res.Header,
4413 }
4414 }
4415 if err != nil {
4416 return nil, err
4417 }
4418 defer googleapi.CloseBody(res)
4419 if err := googleapi.CheckResponse(res); err != nil {
4420 return nil, err
4421 }
4422 ret := &Table{
4423 ServerResponse: googleapi.ServerResponse{
4424 Header: res.Header,
4425 HTTPStatusCode: res.StatusCode,
4426 },
4427 }
4428 target := &ret
4429 if err := gensupport.DecodeResponse(target, res); err != nil {
4430 return nil, err
4431 }
4432 return ret, nil
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449 }
4450
4451
4452
4453 type TableListCall struct {
4454 s *Service
4455 urlParams_ gensupport.URLParams
4456 ifNoneMatch_ string
4457 ctx_ context.Context
4458 header_ http.Header
4459 }
4460
4461
4462 func (r *TableService) List() *TableListCall {
4463 c := &TableListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4464 return c
4465 }
4466
4467
4468
4469 func (c *TableListCall) MaxResults(maxResults int64) *TableListCall {
4470 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4471 return c
4472 }
4473
4474
4475
4476 func (c *TableListCall) PageToken(pageToken string) *TableListCall {
4477 c.urlParams_.Set("pageToken", pageToken)
4478 return c
4479 }
4480
4481
4482
4483
4484 func (c *TableListCall) Fields(s ...googleapi.Field) *TableListCall {
4485 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4486 return c
4487 }
4488
4489
4490
4491
4492
4493
4494 func (c *TableListCall) IfNoneMatch(entityTag string) *TableListCall {
4495 c.ifNoneMatch_ = entityTag
4496 return c
4497 }
4498
4499
4500
4501
4502 func (c *TableListCall) Context(ctx context.Context) *TableListCall {
4503 c.ctx_ = ctx
4504 return c
4505 }
4506
4507
4508
4509 func (c *TableListCall) Header() http.Header {
4510 if c.header_ == nil {
4511 c.header_ = make(http.Header)
4512 }
4513 return c.header_
4514 }
4515
4516 func (c *TableListCall) doRequest(alt string) (*http.Response, error) {
4517 reqHeaders := make(http.Header)
4518 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4519 for k, v := range c.header_ {
4520 reqHeaders[k] = v
4521 }
4522 reqHeaders.Set("User-Agent", c.s.userAgent())
4523 if c.ifNoneMatch_ != "" {
4524 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4525 }
4526 var body io.Reader = nil
4527 c.urlParams_.Set("alt", alt)
4528 c.urlParams_.Set("prettyPrint", "false")
4529 urls := googleapi.ResolveRelative(c.s.BasePath, "tables")
4530 urls += "?" + c.urlParams_.Encode()
4531 req, err := http.NewRequest("GET", urls, body)
4532 if err != nil {
4533 return nil, err
4534 }
4535 req.Header = reqHeaders
4536 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4537 }
4538
4539
4540
4541
4542
4543
4544
4545
4546 func (c *TableListCall) Do(opts ...googleapi.CallOption) (*TableList, error) {
4547 gensupport.SetOptions(c.urlParams_, opts...)
4548 res, err := c.doRequest("json")
4549 if res != nil && res.StatusCode == http.StatusNotModified {
4550 if res.Body != nil {
4551 res.Body.Close()
4552 }
4553 return nil, &googleapi.Error{
4554 Code: res.StatusCode,
4555 Header: res.Header,
4556 }
4557 }
4558 if err != nil {
4559 return nil, err
4560 }
4561 defer googleapi.CloseBody(res)
4562 if err := googleapi.CheckResponse(res); err != nil {
4563 return nil, err
4564 }
4565 ret := &TableList{
4566 ServerResponse: googleapi.ServerResponse{
4567 Header: res.Header,
4568 HTTPStatusCode: res.StatusCode,
4569 },
4570 }
4571 target := &ret
4572 if err := gensupport.DecodeResponse(target, res); err != nil {
4573 return nil, err
4574 }
4575 return ret, nil
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604 }
4605
4606
4607
4608
4609 func (c *TableListCall) Pages(ctx context.Context, f func(*TableList) error) error {
4610 c.ctx_ = ctx
4611 defer c.PageToken(c.urlParams_.Get("pageToken"))
4612 for {
4613 x, err := c.Do()
4614 if err != nil {
4615 return err
4616 }
4617 if err := f(x); err != nil {
4618 return err
4619 }
4620 if x.NextPageToken == "" {
4621 return nil
4622 }
4623 c.PageToken(x.NextPageToken)
4624 }
4625 }
4626
4627
4628
4629 type TablePatchCall struct {
4630 s *Service
4631 tableId string
4632 table *Table
4633 urlParams_ gensupport.URLParams
4634 ctx_ context.Context
4635 header_ http.Header
4636 }
4637
4638
4639
4640
4641 func (r *TableService) Patch(tableId string, table *Table) *TablePatchCall {
4642 c := &TablePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4643 c.tableId = tableId
4644 c.table = table
4645 return c
4646 }
4647
4648
4649
4650
4651
4652 func (c *TablePatchCall) ReplaceViewDefinition(replaceViewDefinition bool) *TablePatchCall {
4653 c.urlParams_.Set("replaceViewDefinition", fmt.Sprint(replaceViewDefinition))
4654 return c
4655 }
4656
4657
4658
4659
4660 func (c *TablePatchCall) Fields(s ...googleapi.Field) *TablePatchCall {
4661 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4662 return c
4663 }
4664
4665
4666
4667
4668 func (c *TablePatchCall) Context(ctx context.Context) *TablePatchCall {
4669 c.ctx_ = ctx
4670 return c
4671 }
4672
4673
4674
4675 func (c *TablePatchCall) Header() http.Header {
4676 if c.header_ == nil {
4677 c.header_ = make(http.Header)
4678 }
4679 return c.header_
4680 }
4681
4682 func (c *TablePatchCall) doRequest(alt string) (*http.Response, error) {
4683 reqHeaders := make(http.Header)
4684 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4685 for k, v := range c.header_ {
4686 reqHeaders[k] = v
4687 }
4688 reqHeaders.Set("User-Agent", c.s.userAgent())
4689 var body io.Reader = nil
4690 body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
4691 if err != nil {
4692 return nil, err
4693 }
4694 reqHeaders.Set("Content-Type", "application/json")
4695 c.urlParams_.Set("alt", alt)
4696 c.urlParams_.Set("prettyPrint", "false")
4697 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}")
4698 urls += "?" + c.urlParams_.Encode()
4699 req, err := http.NewRequest("PATCH", urls, body)
4700 if err != nil {
4701 return nil, err
4702 }
4703 req.Header = reqHeaders
4704 googleapi.Expand(req.URL, map[string]string{
4705 "tableId": c.tableId,
4706 })
4707 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4708 }
4709
4710
4711
4712
4713
4714
4715
4716
4717 func (c *TablePatchCall) Do(opts ...googleapi.CallOption) (*Table, error) {
4718 gensupport.SetOptions(c.urlParams_, opts...)
4719 res, err := c.doRequest("json")
4720 if res != nil && res.StatusCode == http.StatusNotModified {
4721 if res.Body != nil {
4722 res.Body.Close()
4723 }
4724 return nil, &googleapi.Error{
4725 Code: res.StatusCode,
4726 Header: res.Header,
4727 }
4728 }
4729 if err != nil {
4730 return nil, err
4731 }
4732 defer googleapi.CloseBody(res)
4733 if err := googleapi.CheckResponse(res); err != nil {
4734 return nil, err
4735 }
4736 ret := &Table{
4737 ServerResponse: googleapi.ServerResponse{
4738 Header: res.Header,
4739 HTTPStatusCode: res.StatusCode,
4740 },
4741 }
4742 target := &ret
4743 if err := gensupport.DecodeResponse(target, res); err != nil {
4744 return nil, err
4745 }
4746 return ret, nil
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779 }
4780
4781
4782
4783 type TableUpdateCall struct {
4784 s *Service
4785 tableId string
4786 table *Table
4787 urlParams_ gensupport.URLParams
4788 ctx_ context.Context
4789 header_ http.Header
4790 }
4791
4792
4793
4794 func (r *TableService) Update(tableId string, table *Table) *TableUpdateCall {
4795 c := &TableUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4796 c.tableId = tableId
4797 c.table = table
4798 return c
4799 }
4800
4801
4802
4803
4804
4805 func (c *TableUpdateCall) ReplaceViewDefinition(replaceViewDefinition bool) *TableUpdateCall {
4806 c.urlParams_.Set("replaceViewDefinition", fmt.Sprint(replaceViewDefinition))
4807 return c
4808 }
4809
4810
4811
4812
4813 func (c *TableUpdateCall) Fields(s ...googleapi.Field) *TableUpdateCall {
4814 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4815 return c
4816 }
4817
4818
4819
4820
4821 func (c *TableUpdateCall) Context(ctx context.Context) *TableUpdateCall {
4822 c.ctx_ = ctx
4823 return c
4824 }
4825
4826
4827
4828 func (c *TableUpdateCall) Header() http.Header {
4829 if c.header_ == nil {
4830 c.header_ = make(http.Header)
4831 }
4832 return c.header_
4833 }
4834
4835 func (c *TableUpdateCall) doRequest(alt string) (*http.Response, error) {
4836 reqHeaders := make(http.Header)
4837 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4838 for k, v := range c.header_ {
4839 reqHeaders[k] = v
4840 }
4841 reqHeaders.Set("User-Agent", c.s.userAgent())
4842 var body io.Reader = nil
4843 body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
4844 if err != nil {
4845 return nil, err
4846 }
4847 reqHeaders.Set("Content-Type", "application/json")
4848 c.urlParams_.Set("alt", alt)
4849 c.urlParams_.Set("prettyPrint", "false")
4850 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}")
4851 urls += "?" + c.urlParams_.Encode()
4852 req, err := http.NewRequest("PUT", urls, body)
4853 if err != nil {
4854 return nil, err
4855 }
4856 req.Header = reqHeaders
4857 googleapi.Expand(req.URL, map[string]string{
4858 "tableId": c.tableId,
4859 })
4860 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4861 }
4862
4863
4864
4865
4866
4867
4868
4869
4870 func (c *TableUpdateCall) Do(opts ...googleapi.CallOption) (*Table, error) {
4871 gensupport.SetOptions(c.urlParams_, opts...)
4872 res, err := c.doRequest("json")
4873 if res != nil && res.StatusCode == http.StatusNotModified {
4874 if res.Body != nil {
4875 res.Body.Close()
4876 }
4877 return nil, &googleapi.Error{
4878 Code: res.StatusCode,
4879 Header: res.Header,
4880 }
4881 }
4882 if err != nil {
4883 return nil, err
4884 }
4885 defer googleapi.CloseBody(res)
4886 if err := googleapi.CheckResponse(res); err != nil {
4887 return nil, err
4888 }
4889 ret := &Table{
4890 ServerResponse: googleapi.ServerResponse{
4891 Header: res.Header,
4892 HTTPStatusCode: res.StatusCode,
4893 },
4894 }
4895 target := &ret
4896 if err := gensupport.DecodeResponse(target, res); err != nil {
4897 return nil, err
4898 }
4899 return ret, nil
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932 }
4933
4934
4935
4936 type TaskDeleteCall struct {
4937 s *Service
4938 tableId string
4939 taskId string
4940 urlParams_ gensupport.URLParams
4941 ctx_ context.Context
4942 header_ http.Header
4943 }
4944
4945
4946 func (r *TaskService) Delete(tableId string, taskId string) *TaskDeleteCall {
4947 c := &TaskDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4948 c.tableId = tableId
4949 c.taskId = taskId
4950 return c
4951 }
4952
4953
4954
4955
4956 func (c *TaskDeleteCall) Fields(s ...googleapi.Field) *TaskDeleteCall {
4957 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4958 return c
4959 }
4960
4961
4962
4963
4964 func (c *TaskDeleteCall) Context(ctx context.Context) *TaskDeleteCall {
4965 c.ctx_ = ctx
4966 return c
4967 }
4968
4969
4970
4971 func (c *TaskDeleteCall) Header() http.Header {
4972 if c.header_ == nil {
4973 c.header_ = make(http.Header)
4974 }
4975 return c.header_
4976 }
4977
4978 func (c *TaskDeleteCall) doRequest(alt string) (*http.Response, error) {
4979 reqHeaders := make(http.Header)
4980 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4981 for k, v := range c.header_ {
4982 reqHeaders[k] = v
4983 }
4984 reqHeaders.Set("User-Agent", c.s.userAgent())
4985 var body io.Reader = nil
4986 c.urlParams_.Set("alt", alt)
4987 c.urlParams_.Set("prettyPrint", "false")
4988 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks/{taskId}")
4989 urls += "?" + c.urlParams_.Encode()
4990 req, err := http.NewRequest("DELETE", urls, body)
4991 if err != nil {
4992 return nil, err
4993 }
4994 req.Header = reqHeaders
4995 googleapi.Expand(req.URL, map[string]string{
4996 "tableId": c.tableId,
4997 "taskId": c.taskId,
4998 })
4999 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5000 }
5001
5002
5003 func (c *TaskDeleteCall) Do(opts ...googleapi.CallOption) error {
5004 gensupport.SetOptions(c.urlParams_, opts...)
5005 res, err := c.doRequest("json")
5006 if err != nil {
5007 return err
5008 }
5009 defer googleapi.CloseBody(res)
5010 if err := googleapi.CheckResponse(res); err != nil {
5011 return err
5012 }
5013 return nil
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041 }
5042
5043
5044
5045 type TaskGetCall struct {
5046 s *Service
5047 tableId string
5048 taskId string
5049 urlParams_ gensupport.URLParams
5050 ifNoneMatch_ string
5051 ctx_ context.Context
5052 header_ http.Header
5053 }
5054
5055
5056 func (r *TaskService) Get(tableId string, taskId string) *TaskGetCall {
5057 c := &TaskGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5058 c.tableId = tableId
5059 c.taskId = taskId
5060 return c
5061 }
5062
5063
5064
5065
5066 func (c *TaskGetCall) Fields(s ...googleapi.Field) *TaskGetCall {
5067 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5068 return c
5069 }
5070
5071
5072
5073
5074
5075
5076 func (c *TaskGetCall) IfNoneMatch(entityTag string) *TaskGetCall {
5077 c.ifNoneMatch_ = entityTag
5078 return c
5079 }
5080
5081
5082
5083
5084 func (c *TaskGetCall) Context(ctx context.Context) *TaskGetCall {
5085 c.ctx_ = ctx
5086 return c
5087 }
5088
5089
5090
5091 func (c *TaskGetCall) Header() http.Header {
5092 if c.header_ == nil {
5093 c.header_ = make(http.Header)
5094 }
5095 return c.header_
5096 }
5097
5098 func (c *TaskGetCall) doRequest(alt string) (*http.Response, error) {
5099 reqHeaders := make(http.Header)
5100 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5101 for k, v := range c.header_ {
5102 reqHeaders[k] = v
5103 }
5104 reqHeaders.Set("User-Agent", c.s.userAgent())
5105 if c.ifNoneMatch_ != "" {
5106 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5107 }
5108 var body io.Reader = nil
5109 c.urlParams_.Set("alt", alt)
5110 c.urlParams_.Set("prettyPrint", "false")
5111 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks/{taskId}")
5112 urls += "?" + c.urlParams_.Encode()
5113 req, err := http.NewRequest("GET", urls, body)
5114 if err != nil {
5115 return nil, err
5116 }
5117 req.Header = reqHeaders
5118 googleapi.Expand(req.URL, map[string]string{
5119 "tableId": c.tableId,
5120 "taskId": c.taskId,
5121 })
5122 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5123 }
5124
5125
5126
5127
5128
5129
5130
5131
5132 func (c *TaskGetCall) Do(opts ...googleapi.CallOption) (*Task, error) {
5133 gensupport.SetOptions(c.urlParams_, opts...)
5134 res, err := c.doRequest("json")
5135 if res != nil && res.StatusCode == http.StatusNotModified {
5136 if res.Body != nil {
5137 res.Body.Close()
5138 }
5139 return nil, &googleapi.Error{
5140 Code: res.StatusCode,
5141 Header: res.Header,
5142 }
5143 }
5144 if err != nil {
5145 return nil, err
5146 }
5147 defer googleapi.CloseBody(res)
5148 if err := googleapi.CheckResponse(res); err != nil {
5149 return nil, err
5150 }
5151 ret := &Task{
5152 ServerResponse: googleapi.ServerResponse{
5153 Header: res.Header,
5154 HTTPStatusCode: res.StatusCode,
5155 },
5156 }
5157 target := &ret
5158 if err := gensupport.DecodeResponse(target, res); err != nil {
5159 return nil, err
5160 }
5161 return ret, nil
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193 }
5194
5195
5196
5197 type TaskListCall struct {
5198 s *Service
5199 tableId string
5200 urlParams_ gensupport.URLParams
5201 ifNoneMatch_ string
5202 ctx_ context.Context
5203 header_ http.Header
5204 }
5205
5206
5207 func (r *TaskService) List(tableId string) *TaskListCall {
5208 c := &TaskListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5209 c.tableId = tableId
5210 return c
5211 }
5212
5213
5214
5215 func (c *TaskListCall) MaxResults(maxResults int64) *TaskListCall {
5216 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
5217 return c
5218 }
5219
5220
5221 func (c *TaskListCall) PageToken(pageToken string) *TaskListCall {
5222 c.urlParams_.Set("pageToken", pageToken)
5223 return c
5224 }
5225
5226
5227 func (c *TaskListCall) StartIndex(startIndex int64) *TaskListCall {
5228 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
5229 return c
5230 }
5231
5232
5233
5234
5235 func (c *TaskListCall) Fields(s ...googleapi.Field) *TaskListCall {
5236 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5237 return c
5238 }
5239
5240
5241
5242
5243
5244
5245 func (c *TaskListCall) IfNoneMatch(entityTag string) *TaskListCall {
5246 c.ifNoneMatch_ = entityTag
5247 return c
5248 }
5249
5250
5251
5252
5253 func (c *TaskListCall) Context(ctx context.Context) *TaskListCall {
5254 c.ctx_ = ctx
5255 return c
5256 }
5257
5258
5259
5260 func (c *TaskListCall) Header() http.Header {
5261 if c.header_ == nil {
5262 c.header_ = make(http.Header)
5263 }
5264 return c.header_
5265 }
5266
5267 func (c *TaskListCall) doRequest(alt string) (*http.Response, error) {
5268 reqHeaders := make(http.Header)
5269 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5270 for k, v := range c.header_ {
5271 reqHeaders[k] = v
5272 }
5273 reqHeaders.Set("User-Agent", c.s.userAgent())
5274 if c.ifNoneMatch_ != "" {
5275 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5276 }
5277 var body io.Reader = nil
5278 c.urlParams_.Set("alt", alt)
5279 c.urlParams_.Set("prettyPrint", "false")
5280 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks")
5281 urls += "?" + c.urlParams_.Encode()
5282 req, err := http.NewRequest("GET", urls, body)
5283 if err != nil {
5284 return nil, err
5285 }
5286 req.Header = reqHeaders
5287 googleapi.Expand(req.URL, map[string]string{
5288 "tableId": c.tableId,
5289 })
5290 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5291 }
5292
5293
5294
5295
5296
5297
5298
5299
5300 func (c *TaskListCall) Do(opts ...googleapi.CallOption) (*TaskList, error) {
5301 gensupport.SetOptions(c.urlParams_, opts...)
5302 res, err := c.doRequest("json")
5303 if res != nil && res.StatusCode == http.StatusNotModified {
5304 if res.Body != nil {
5305 res.Body.Close()
5306 }
5307 return nil, &googleapi.Error{
5308 Code: res.StatusCode,
5309 Header: res.Header,
5310 }
5311 }
5312 if err != nil {
5313 return nil, err
5314 }
5315 defer googleapi.CloseBody(res)
5316 if err := googleapi.CheckResponse(res); err != nil {
5317 return nil, err
5318 }
5319 ret := &TaskList{
5320 ServerResponse: googleapi.ServerResponse{
5321 Header: res.Header,
5322 HTTPStatusCode: res.StatusCode,
5323 },
5324 }
5325 target := &ret
5326 if err := gensupport.DecodeResponse(target, res); err != nil {
5327 return nil, err
5328 }
5329 return ret, nil
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371 }
5372
5373
5374
5375
5376 func (c *TaskListCall) Pages(ctx context.Context, f func(*TaskList) error) error {
5377 c.ctx_ = ctx
5378 defer c.PageToken(c.urlParams_.Get("pageToken"))
5379 for {
5380 x, err := c.Do()
5381 if err != nil {
5382 return err
5383 }
5384 if err := f(x); err != nil {
5385 return err
5386 }
5387 if x.NextPageToken == "" {
5388 return nil
5389 }
5390 c.PageToken(x.NextPageToken)
5391 }
5392 }
5393
5394
5395
5396 type TemplateDeleteCall struct {
5397 s *Service
5398 tableId string
5399 templateId int64
5400 urlParams_ gensupport.URLParams
5401 ctx_ context.Context
5402 header_ http.Header
5403 }
5404
5405
5406 func (r *TemplateService) Delete(tableId string, templateId int64) *TemplateDeleteCall {
5407 c := &TemplateDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5408 c.tableId = tableId
5409 c.templateId = templateId
5410 return c
5411 }
5412
5413
5414
5415
5416 func (c *TemplateDeleteCall) Fields(s ...googleapi.Field) *TemplateDeleteCall {
5417 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5418 return c
5419 }
5420
5421
5422
5423
5424 func (c *TemplateDeleteCall) Context(ctx context.Context) *TemplateDeleteCall {
5425 c.ctx_ = ctx
5426 return c
5427 }
5428
5429
5430
5431 func (c *TemplateDeleteCall) Header() http.Header {
5432 if c.header_ == nil {
5433 c.header_ = make(http.Header)
5434 }
5435 return c.header_
5436 }
5437
5438 func (c *TemplateDeleteCall) doRequest(alt string) (*http.Response, error) {
5439 reqHeaders := make(http.Header)
5440 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5441 for k, v := range c.header_ {
5442 reqHeaders[k] = v
5443 }
5444 reqHeaders.Set("User-Agent", c.s.userAgent())
5445 var body io.Reader = nil
5446 c.urlParams_.Set("alt", alt)
5447 c.urlParams_.Set("prettyPrint", "false")
5448 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}")
5449 urls += "?" + c.urlParams_.Encode()
5450 req, err := http.NewRequest("DELETE", urls, body)
5451 if err != nil {
5452 return nil, err
5453 }
5454 req.Header = reqHeaders
5455 googleapi.Expand(req.URL, map[string]string{
5456 "tableId": c.tableId,
5457 "templateId": strconv.FormatInt(c.templateId, 10),
5458 })
5459 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5460 }
5461
5462
5463 func (c *TemplateDeleteCall) Do(opts ...googleapi.CallOption) error {
5464 gensupport.SetOptions(c.urlParams_, opts...)
5465 res, err := c.doRequest("json")
5466 if err != nil {
5467 return err
5468 }
5469 defer googleapi.CloseBody(res)
5470 if err := googleapi.CheckResponse(res); err != nil {
5471 return err
5472 }
5473 return nil
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503 }
5504
5505
5506
5507 type TemplateGetCall struct {
5508 s *Service
5509 tableId string
5510 templateId int64
5511 urlParams_ gensupport.URLParams
5512 ifNoneMatch_ string
5513 ctx_ context.Context
5514 header_ http.Header
5515 }
5516
5517
5518 func (r *TemplateService) Get(tableId string, templateId int64) *TemplateGetCall {
5519 c := &TemplateGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5520 c.tableId = tableId
5521 c.templateId = templateId
5522 return c
5523 }
5524
5525
5526
5527
5528 func (c *TemplateGetCall) Fields(s ...googleapi.Field) *TemplateGetCall {
5529 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5530 return c
5531 }
5532
5533
5534
5535
5536
5537
5538 func (c *TemplateGetCall) IfNoneMatch(entityTag string) *TemplateGetCall {
5539 c.ifNoneMatch_ = entityTag
5540 return c
5541 }
5542
5543
5544
5545
5546 func (c *TemplateGetCall) Context(ctx context.Context) *TemplateGetCall {
5547 c.ctx_ = ctx
5548 return c
5549 }
5550
5551
5552
5553 func (c *TemplateGetCall) Header() http.Header {
5554 if c.header_ == nil {
5555 c.header_ = make(http.Header)
5556 }
5557 return c.header_
5558 }
5559
5560 func (c *TemplateGetCall) doRequest(alt string) (*http.Response, error) {
5561 reqHeaders := make(http.Header)
5562 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5563 for k, v := range c.header_ {
5564 reqHeaders[k] = v
5565 }
5566 reqHeaders.Set("User-Agent", c.s.userAgent())
5567 if c.ifNoneMatch_ != "" {
5568 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5569 }
5570 var body io.Reader = nil
5571 c.urlParams_.Set("alt", alt)
5572 c.urlParams_.Set("prettyPrint", "false")
5573 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}")
5574 urls += "?" + c.urlParams_.Encode()
5575 req, err := http.NewRequest("GET", urls, body)
5576 if err != nil {
5577 return nil, err
5578 }
5579 req.Header = reqHeaders
5580 googleapi.Expand(req.URL, map[string]string{
5581 "tableId": c.tableId,
5582 "templateId": strconv.FormatInt(c.templateId, 10),
5583 })
5584 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5585 }
5586
5587
5588
5589
5590
5591
5592
5593
5594 func (c *TemplateGetCall) Do(opts ...googleapi.CallOption) (*Template, error) {
5595 gensupport.SetOptions(c.urlParams_, opts...)
5596 res, err := c.doRequest("json")
5597 if res != nil && res.StatusCode == http.StatusNotModified {
5598 if res.Body != nil {
5599 res.Body.Close()
5600 }
5601 return nil, &googleapi.Error{
5602 Code: res.StatusCode,
5603 Header: res.Header,
5604 }
5605 }
5606 if err != nil {
5607 return nil, err
5608 }
5609 defer googleapi.CloseBody(res)
5610 if err := googleapi.CheckResponse(res); err != nil {
5611 return nil, err
5612 }
5613 ret := &Template{
5614 ServerResponse: googleapi.ServerResponse{
5615 Header: res.Header,
5616 HTTPStatusCode: res.StatusCode,
5617 },
5618 }
5619 target := &ret
5620 if err := gensupport.DecodeResponse(target, res); err != nil {
5621 return nil, err
5622 }
5623 return ret, nil
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657 }
5658
5659
5660
5661 type TemplateInsertCall struct {
5662 s *Service
5663 tableId string
5664 template *Template
5665 urlParams_ gensupport.URLParams
5666 ctx_ context.Context
5667 header_ http.Header
5668 }
5669
5670
5671 func (r *TemplateService) Insert(tableId string, template *Template) *TemplateInsertCall {
5672 c := &TemplateInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5673 c.tableId = tableId
5674 c.template = template
5675 return c
5676 }
5677
5678
5679
5680
5681 func (c *TemplateInsertCall) Fields(s ...googleapi.Field) *TemplateInsertCall {
5682 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5683 return c
5684 }
5685
5686
5687
5688
5689 func (c *TemplateInsertCall) Context(ctx context.Context) *TemplateInsertCall {
5690 c.ctx_ = ctx
5691 return c
5692 }
5693
5694
5695
5696 func (c *TemplateInsertCall) Header() http.Header {
5697 if c.header_ == nil {
5698 c.header_ = make(http.Header)
5699 }
5700 return c.header_
5701 }
5702
5703 func (c *TemplateInsertCall) doRequest(alt string) (*http.Response, error) {
5704 reqHeaders := make(http.Header)
5705 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5706 for k, v := range c.header_ {
5707 reqHeaders[k] = v
5708 }
5709 reqHeaders.Set("User-Agent", c.s.userAgent())
5710 var body io.Reader = nil
5711 body, err := googleapi.WithoutDataWrapper.JSONReader(c.template)
5712 if err != nil {
5713 return nil, err
5714 }
5715 reqHeaders.Set("Content-Type", "application/json")
5716 c.urlParams_.Set("alt", alt)
5717 c.urlParams_.Set("prettyPrint", "false")
5718 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates")
5719 urls += "?" + c.urlParams_.Encode()
5720 req, err := http.NewRequest("POST", urls, body)
5721 if err != nil {
5722 return nil, err
5723 }
5724 req.Header = reqHeaders
5725 googleapi.Expand(req.URL, map[string]string{
5726 "tableId": c.tableId,
5727 })
5728 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5729 }
5730
5731
5732
5733
5734
5735
5736
5737
5738 func (c *TemplateInsertCall) Do(opts ...googleapi.CallOption) (*Template, error) {
5739 gensupport.SetOptions(c.urlParams_, opts...)
5740 res, err := c.doRequest("json")
5741 if res != nil && res.StatusCode == http.StatusNotModified {
5742 if res.Body != nil {
5743 res.Body.Close()
5744 }
5745 return nil, &googleapi.Error{
5746 Code: res.StatusCode,
5747 Header: res.Header,
5748 }
5749 }
5750 if err != nil {
5751 return nil, err
5752 }
5753 defer googleapi.CloseBody(res)
5754 if err := googleapi.CheckResponse(res); err != nil {
5755 return nil, err
5756 }
5757 ret := &Template{
5758 ServerResponse: googleapi.ServerResponse{
5759 Header: res.Header,
5760 HTTPStatusCode: res.StatusCode,
5761 },
5762 }
5763 target := &ret
5764 if err := gensupport.DecodeResponse(target, res); err != nil {
5765 return nil, err
5766 }
5767 return ret, nil
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795 }
5796
5797
5798
5799 type TemplateListCall struct {
5800 s *Service
5801 tableId string
5802 urlParams_ gensupport.URLParams
5803 ifNoneMatch_ string
5804 ctx_ context.Context
5805 header_ http.Header
5806 }
5807
5808
5809 func (r *TemplateService) List(tableId string) *TemplateListCall {
5810 c := &TemplateListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5811 c.tableId = tableId
5812 return c
5813 }
5814
5815
5816
5817 func (c *TemplateListCall) MaxResults(maxResults int64) *TemplateListCall {
5818 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
5819 return c
5820 }
5821
5822
5823
5824 func (c *TemplateListCall) PageToken(pageToken string) *TemplateListCall {
5825 c.urlParams_.Set("pageToken", pageToken)
5826 return c
5827 }
5828
5829
5830
5831
5832 func (c *TemplateListCall) Fields(s ...googleapi.Field) *TemplateListCall {
5833 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5834 return c
5835 }
5836
5837
5838
5839
5840
5841
5842 func (c *TemplateListCall) IfNoneMatch(entityTag string) *TemplateListCall {
5843 c.ifNoneMatch_ = entityTag
5844 return c
5845 }
5846
5847
5848
5849
5850 func (c *TemplateListCall) Context(ctx context.Context) *TemplateListCall {
5851 c.ctx_ = ctx
5852 return c
5853 }
5854
5855
5856
5857 func (c *TemplateListCall) Header() http.Header {
5858 if c.header_ == nil {
5859 c.header_ = make(http.Header)
5860 }
5861 return c.header_
5862 }
5863
5864 func (c *TemplateListCall) doRequest(alt string) (*http.Response, error) {
5865 reqHeaders := make(http.Header)
5866 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5867 for k, v := range c.header_ {
5868 reqHeaders[k] = v
5869 }
5870 reqHeaders.Set("User-Agent", c.s.userAgent())
5871 if c.ifNoneMatch_ != "" {
5872 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5873 }
5874 var body io.Reader = nil
5875 c.urlParams_.Set("alt", alt)
5876 c.urlParams_.Set("prettyPrint", "false")
5877 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates")
5878 urls += "?" + c.urlParams_.Encode()
5879 req, err := http.NewRequest("GET", urls, body)
5880 if err != nil {
5881 return nil, err
5882 }
5883 req.Header = reqHeaders
5884 googleapi.Expand(req.URL, map[string]string{
5885 "tableId": c.tableId,
5886 })
5887 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5888 }
5889
5890
5891
5892
5893
5894
5895
5896
5897 func (c *TemplateListCall) Do(opts ...googleapi.CallOption) (*TemplateList, error) {
5898 gensupport.SetOptions(c.urlParams_, opts...)
5899 res, err := c.doRequest("json")
5900 if res != nil && res.StatusCode == http.StatusNotModified {
5901 if res.Body != nil {
5902 res.Body.Close()
5903 }
5904 return nil, &googleapi.Error{
5905 Code: res.StatusCode,
5906 Header: res.Header,
5907 }
5908 }
5909 if err != nil {
5910 return nil, err
5911 }
5912 defer googleapi.CloseBody(res)
5913 if err := googleapi.CheckResponse(res); err != nil {
5914 return nil, err
5915 }
5916 ret := &TemplateList{
5917 ServerResponse: googleapi.ServerResponse{
5918 Header: res.Header,
5919 HTTPStatusCode: res.StatusCode,
5920 },
5921 }
5922 target := &ret
5923 if err := gensupport.DecodeResponse(target, res); err != nil {
5924 return nil, err
5925 }
5926 return ret, nil
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964 }
5965
5966
5967
5968
5969 func (c *TemplateListCall) Pages(ctx context.Context, f func(*TemplateList) error) error {
5970 c.ctx_ = ctx
5971 defer c.PageToken(c.urlParams_.Get("pageToken"))
5972 for {
5973 x, err := c.Do()
5974 if err != nil {
5975 return err
5976 }
5977 if err := f(x); err != nil {
5978 return err
5979 }
5980 if x.NextPageToken == "" {
5981 return nil
5982 }
5983 c.PageToken(x.NextPageToken)
5984 }
5985 }
5986
5987
5988
5989 type TemplatePatchCall struct {
5990 s *Service
5991 tableId string
5992 templateId int64
5993 template *Template
5994 urlParams_ gensupport.URLParams
5995 ctx_ context.Context
5996 header_ http.Header
5997 }
5998
5999
6000
6001 func (r *TemplateService) Patch(tableId string, templateId int64, template *Template) *TemplatePatchCall {
6002 c := &TemplatePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6003 c.tableId = tableId
6004 c.templateId = templateId
6005 c.template = template
6006 return c
6007 }
6008
6009
6010
6011
6012 func (c *TemplatePatchCall) Fields(s ...googleapi.Field) *TemplatePatchCall {
6013 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6014 return c
6015 }
6016
6017
6018
6019
6020 func (c *TemplatePatchCall) Context(ctx context.Context) *TemplatePatchCall {
6021 c.ctx_ = ctx
6022 return c
6023 }
6024
6025
6026
6027 func (c *TemplatePatchCall) Header() http.Header {
6028 if c.header_ == nil {
6029 c.header_ = make(http.Header)
6030 }
6031 return c.header_
6032 }
6033
6034 func (c *TemplatePatchCall) doRequest(alt string) (*http.Response, error) {
6035 reqHeaders := make(http.Header)
6036 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6037 for k, v := range c.header_ {
6038 reqHeaders[k] = v
6039 }
6040 reqHeaders.Set("User-Agent", c.s.userAgent())
6041 var body io.Reader = nil
6042 body, err := googleapi.WithoutDataWrapper.JSONReader(c.template)
6043 if err != nil {
6044 return nil, err
6045 }
6046 reqHeaders.Set("Content-Type", "application/json")
6047 c.urlParams_.Set("alt", alt)
6048 c.urlParams_.Set("prettyPrint", "false")
6049 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}")
6050 urls += "?" + c.urlParams_.Encode()
6051 req, err := http.NewRequest("PATCH", urls, body)
6052 if err != nil {
6053 return nil, err
6054 }
6055 req.Header = reqHeaders
6056 googleapi.Expand(req.URL, map[string]string{
6057 "tableId": c.tableId,
6058 "templateId": strconv.FormatInt(c.templateId, 10),
6059 })
6060 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6061 }
6062
6063
6064
6065
6066
6067
6068
6069
6070 func (c *TemplatePatchCall) Do(opts ...googleapi.CallOption) (*Template, error) {
6071 gensupport.SetOptions(c.urlParams_, opts...)
6072 res, err := c.doRequest("json")
6073 if res != nil && res.StatusCode == http.StatusNotModified {
6074 if res.Body != nil {
6075 res.Body.Close()
6076 }
6077 return nil, &googleapi.Error{
6078 Code: res.StatusCode,
6079 Header: res.Header,
6080 }
6081 }
6082 if err != nil {
6083 return nil, err
6084 }
6085 defer googleapi.CloseBody(res)
6086 if err := googleapi.CheckResponse(res); err != nil {
6087 return nil, err
6088 }
6089 ret := &Template{
6090 ServerResponse: googleapi.ServerResponse{
6091 Header: res.Header,
6092 HTTPStatusCode: res.StatusCode,
6093 },
6094 }
6095 target := &ret
6096 if err := gensupport.DecodeResponse(target, res); err != nil {
6097 return nil, err
6098 }
6099 return ret, nil
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135 }
6136
6137
6138
6139 type TemplateUpdateCall struct {
6140 s *Service
6141 tableId string
6142 templateId int64
6143 template *Template
6144 urlParams_ gensupport.URLParams
6145 ctx_ context.Context
6146 header_ http.Header
6147 }
6148
6149
6150 func (r *TemplateService) Update(tableId string, templateId int64, template *Template) *TemplateUpdateCall {
6151 c := &TemplateUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6152 c.tableId = tableId
6153 c.templateId = templateId
6154 c.template = template
6155 return c
6156 }
6157
6158
6159
6160
6161 func (c *TemplateUpdateCall) Fields(s ...googleapi.Field) *TemplateUpdateCall {
6162 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6163 return c
6164 }
6165
6166
6167
6168
6169 func (c *TemplateUpdateCall) Context(ctx context.Context) *TemplateUpdateCall {
6170 c.ctx_ = ctx
6171 return c
6172 }
6173
6174
6175
6176 func (c *TemplateUpdateCall) Header() http.Header {
6177 if c.header_ == nil {
6178 c.header_ = make(http.Header)
6179 }
6180 return c.header_
6181 }
6182
6183 func (c *TemplateUpdateCall) doRequest(alt string) (*http.Response, error) {
6184 reqHeaders := make(http.Header)
6185 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6186 for k, v := range c.header_ {
6187 reqHeaders[k] = v
6188 }
6189 reqHeaders.Set("User-Agent", c.s.userAgent())
6190 var body io.Reader = nil
6191 body, err := googleapi.WithoutDataWrapper.JSONReader(c.template)
6192 if err != nil {
6193 return nil, err
6194 }
6195 reqHeaders.Set("Content-Type", "application/json")
6196 c.urlParams_.Set("alt", alt)
6197 c.urlParams_.Set("prettyPrint", "false")
6198 urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}")
6199 urls += "?" + c.urlParams_.Encode()
6200 req, err := http.NewRequest("PUT", urls, body)
6201 if err != nil {
6202 return nil, err
6203 }
6204 req.Header = reqHeaders
6205 googleapi.Expand(req.URL, map[string]string{
6206 "tableId": c.tableId,
6207 "templateId": strconv.FormatInt(c.templateId, 10),
6208 })
6209 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6210 }
6211
6212
6213
6214
6215
6216
6217
6218
6219 func (c *TemplateUpdateCall) Do(opts ...googleapi.CallOption) (*Template, error) {
6220 gensupport.SetOptions(c.urlParams_, opts...)
6221 res, err := c.doRequest("json")
6222 if res != nil && res.StatusCode == http.StatusNotModified {
6223 if res.Body != nil {
6224 res.Body.Close()
6225 }
6226 return nil, &googleapi.Error{
6227 Code: res.StatusCode,
6228 Header: res.Header,
6229 }
6230 }
6231 if err != nil {
6232 return nil, err
6233 }
6234 defer googleapi.CloseBody(res)
6235 if err := googleapi.CheckResponse(res); err != nil {
6236 return nil, err
6237 }
6238 ret := &Template{
6239 ServerResponse: googleapi.ServerResponse{
6240 Header: res.Header,
6241 HTTPStatusCode: res.StatusCode,
6242 },
6243 }
6244 target := &ret
6245 if err := gensupport.DecodeResponse(target, res); err != nil {
6246 return nil, err
6247 }
6248 return ret, nil
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284 }
6285
View as plain text