1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package area120tables
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "area120tables:v1alpha1"
95 const apiName = "area120tables"
96 const apiVersion = "v1alpha1"
97 const basePath = "https://area120tables.googleapis.com/"
98 const basePathTemplate = "https://area120tables.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://area120tables.mtls.googleapis.com/"
100
101
102 const (
103
104 DriveScope = "https://www.googleapis.com/auth/drive"
105
106
107
108 DriveFileScope = "https://www.googleapis.com/auth/drive.file"
109
110
111 DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
112
113
114 SpreadsheetsScope = "https://www.googleapis.com/auth/spreadsheets"
115
116
117 SpreadsheetsReadonlyScope = "https://www.googleapis.com/auth/spreadsheets.readonly"
118
119
120 TablesScope = "https://www.googleapis.com/auth/tables"
121 )
122
123
124 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
125 scopesOption := internaloption.WithDefaultScopes(
126 "https://www.googleapis.com/auth/drive",
127 "https://www.googleapis.com/auth/drive.file",
128 "https://www.googleapis.com/auth/drive.readonly",
129 "https://www.googleapis.com/auth/spreadsheets",
130 "https://www.googleapis.com/auth/spreadsheets.readonly",
131 "https://www.googleapis.com/auth/tables",
132 )
133
134 opts = append([]option.ClientOption{scopesOption}, opts...)
135 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
136 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
137 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
138 opts = append(opts, internaloption.EnableNewAuthLibrary())
139 client, endpoint, err := htransport.NewClient(ctx, opts...)
140 if err != nil {
141 return nil, err
142 }
143 s, err := New(client)
144 if err != nil {
145 return nil, err
146 }
147 if endpoint != "" {
148 s.BasePath = endpoint
149 }
150 return s, nil
151 }
152
153
154
155
156
157
158 func New(client *http.Client) (*Service, error) {
159 if client == nil {
160 return nil, errors.New("client is nil")
161 }
162 s := &Service{client: client, BasePath: basePath}
163 s.Tables = NewTablesService(s)
164 s.Workspaces = NewWorkspacesService(s)
165 return s, nil
166 }
167
168 type Service struct {
169 client *http.Client
170 BasePath string
171 UserAgent string
172
173 Tables *TablesService
174
175 Workspaces *WorkspacesService
176 }
177
178 func (s *Service) userAgent() string {
179 if s.UserAgent == "" {
180 return googleapi.UserAgent
181 }
182 return googleapi.UserAgent + " " + s.UserAgent
183 }
184
185 func NewTablesService(s *Service) *TablesService {
186 rs := &TablesService{s: s}
187 rs.Rows = NewTablesRowsService(s)
188 return rs
189 }
190
191 type TablesService struct {
192 s *Service
193
194 Rows *TablesRowsService
195 }
196
197 func NewTablesRowsService(s *Service) *TablesRowsService {
198 rs := &TablesRowsService{s: s}
199 return rs
200 }
201
202 type TablesRowsService struct {
203 s *Service
204 }
205
206 func NewWorkspacesService(s *Service) *WorkspacesService {
207 rs := &WorkspacesService{s: s}
208 return rs
209 }
210
211 type WorkspacesService struct {
212 s *Service
213 }
214
215
216 type BatchCreateRowsRequest struct {
217
218
219 Requests []*CreateRowRequest `json:"requests,omitempty"`
220
221
222
223
224
225 ForceSendFields []string `json:"-"`
226
227
228
229
230 NullFields []string `json:"-"`
231 }
232
233 func (s *BatchCreateRowsRequest) MarshalJSON() ([]byte, error) {
234 type NoMethod BatchCreateRowsRequest
235 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
236 }
237
238
239 type BatchCreateRowsResponse struct {
240
241 Rows []*Row `json:"rows,omitempty"`
242
243
244 googleapi.ServerResponse `json:"-"`
245
246
247
248
249
250 ForceSendFields []string `json:"-"`
251
252
253
254
255 NullFields []string `json:"-"`
256 }
257
258 func (s *BatchCreateRowsResponse) MarshalJSON() ([]byte, error) {
259 type NoMethod BatchCreateRowsResponse
260 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
261 }
262
263
264 type BatchDeleteRowsRequest struct {
265
266
267
268 Names []string `json:"names,omitempty"`
269
270
271
272
273
274 ForceSendFields []string `json:"-"`
275
276
277
278
279 NullFields []string `json:"-"`
280 }
281
282 func (s *BatchDeleteRowsRequest) MarshalJSON() ([]byte, error) {
283 type NoMethod BatchDeleteRowsRequest
284 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
285 }
286
287
288 type BatchUpdateRowsRequest struct {
289
290
291 Requests []*UpdateRowRequest `json:"requests,omitempty"`
292
293
294
295
296
297 ForceSendFields []string `json:"-"`
298
299
300
301
302 NullFields []string `json:"-"`
303 }
304
305 func (s *BatchUpdateRowsRequest) MarshalJSON() ([]byte, error) {
306 type NoMethod BatchUpdateRowsRequest
307 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
308 }
309
310
311 type BatchUpdateRowsResponse struct {
312
313 Rows []*Row `json:"rows,omitempty"`
314
315
316 googleapi.ServerResponse `json:"-"`
317
318
319
320
321
322 ForceSendFields []string `json:"-"`
323
324
325
326
327 NullFields []string `json:"-"`
328 }
329
330 func (s *BatchUpdateRowsResponse) MarshalJSON() ([]byte, error) {
331 type NoMethod BatchUpdateRowsResponse
332 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
333 }
334
335
336 type ColumnDescription struct {
337
338
339
340
341
342
343 DataType string `json:"dataType,omitempty"`
344
345 DateDetails *DateDetails `json:"dateDetails,omitempty"`
346
347 Id string `json:"id,omitempty"`
348
349
350
351
352 Labels []*LabeledItem `json:"labels,omitempty"`
353
354
355
356
357 LookupDetails *LookupDetails `json:"lookupDetails,omitempty"`
358
359
360 MultipleValuesDisallowed bool `json:"multipleValuesDisallowed,omitempty"`
361
362 Name string `json:"name,omitempty"`
363
364
365 Readonly bool `json:"readonly,omitempty"`
366
367
368 RelationshipDetails *RelationshipDetails `json:"relationshipDetails,omitempty"`
369
370
371
372
373
374 ForceSendFields []string `json:"-"`
375
376
377
378
379 NullFields []string `json:"-"`
380 }
381
382 func (s *ColumnDescription) MarshalJSON() ([]byte, error) {
383 type NoMethod ColumnDescription
384 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
385 }
386
387
388 type CreateRowRequest struct {
389
390
391 Parent string `json:"parent,omitempty"`
392
393 Row *Row `json:"row,omitempty"`
394
395
396
397
398
399
400 View string `json:"view,omitempty"`
401
402
403
404
405
406 ForceSendFields []string `json:"-"`
407
408
409
410
411 NullFields []string `json:"-"`
412 }
413
414 func (s *CreateRowRequest) MarshalJSON() ([]byte, error) {
415 type NoMethod CreateRowRequest
416 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
417 }
418
419
420 type DateDetails struct {
421
422 HasTime bool `json:"hasTime,omitempty"`
423
424
425
426
427
428 ForceSendFields []string `json:"-"`
429
430
431
432
433 NullFields []string `json:"-"`
434 }
435
436 func (s *DateDetails) MarshalJSON() ([]byte, error) {
437 type NoMethod DateDetails
438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
439 }
440
441
442
443
444
445 type Empty struct {
446
447 googleapi.ServerResponse `json:"-"`
448 }
449
450
451 type LabeledItem struct {
452
453 Id string `json:"id,omitempty"`
454
455 Name string `json:"name,omitempty"`
456
457
458
459
460
461 ForceSendFields []string `json:"-"`
462
463
464
465
466 NullFields []string `json:"-"`
467 }
468
469 func (s *LabeledItem) MarshalJSON() ([]byte, error) {
470 type NoMethod LabeledItem
471 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
472 }
473
474
475 type ListRowsResponse struct {
476
477
478 NextPageToken string `json:"nextPageToken,omitempty"`
479
480 Rows []*Row `json:"rows,omitempty"`
481
482
483 googleapi.ServerResponse `json:"-"`
484
485
486
487
488
489 ForceSendFields []string `json:"-"`
490
491
492
493
494 NullFields []string `json:"-"`
495 }
496
497 func (s *ListRowsResponse) MarshalJSON() ([]byte, error) {
498 type NoMethod ListRowsResponse
499 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
500 }
501
502
503 type ListTablesResponse struct {
504
505
506 NextPageToken string `json:"nextPageToken,omitempty"`
507
508 Tables []*Table `json:"tables,omitempty"`
509
510
511 googleapi.ServerResponse `json:"-"`
512
513
514
515
516
517 ForceSendFields []string `json:"-"`
518
519
520
521
522 NullFields []string `json:"-"`
523 }
524
525 func (s *ListTablesResponse) MarshalJSON() ([]byte, error) {
526 type NoMethod ListTablesResponse
527 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
528 }
529
530
531 type ListWorkspacesResponse struct {
532
533
534 NextPageToken string `json:"nextPageToken,omitempty"`
535
536 Workspaces []*Workspace `json:"workspaces,omitempty"`
537
538
539 googleapi.ServerResponse `json:"-"`
540
541
542
543
544
545 ForceSendFields []string `json:"-"`
546
547
548
549
550 NullFields []string `json:"-"`
551 }
552
553 func (s *ListWorkspacesResponse) MarshalJSON() ([]byte, error) {
554 type NoMethod ListWorkspacesResponse
555 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
556 }
557
558
559
560 type LookupDetails struct {
561
562
563 RelationshipColumn string `json:"relationshipColumn,omitempty"`
564
565 RelationshipColumnId string `json:"relationshipColumnId,omitempty"`
566
567
568
569
570
571 ForceSendFields []string `json:"-"`
572
573
574
575
576 NullFields []string `json:"-"`
577 }
578
579 func (s *LookupDetails) MarshalJSON() ([]byte, error) {
580 type NoMethod LookupDetails
581 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
582 }
583
584
585 type RelationshipDetails struct {
586
587 LinkedTable string `json:"linkedTable,omitempty"`
588
589
590
591
592
593 ForceSendFields []string `json:"-"`
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *RelationshipDetails) MarshalJSON() ([]byte, error) {
602 type NoMethod RelationshipDetails
603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
604 }
605
606
607 type Row struct {
608
609 CreateTime string `json:"createTime,omitempty"`
610
611
612 Name string `json:"name,omitempty"`
613
614 UpdateTime string `json:"updateTime,omitempty"`
615
616
617
618 Values googleapi.RawMessage `json:"values,omitempty"`
619
620
621 googleapi.ServerResponse `json:"-"`
622
623
624
625
626
627 ForceSendFields []string `json:"-"`
628
629
630
631
632 NullFields []string `json:"-"`
633 }
634
635 func (s *Row) MarshalJSON() ([]byte, error) {
636 type NoMethod Row
637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
638 }
639
640
641 type SavedView struct {
642
643 Id string `json:"id,omitempty"`
644
645 Name string `json:"name,omitempty"`
646
647
648
649
650
651 ForceSendFields []string `json:"-"`
652
653
654
655
656 NullFields []string `json:"-"`
657 }
658
659 func (s *SavedView) MarshalJSON() ([]byte, error) {
660 type NoMethod SavedView
661 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
662 }
663
664
665 type Table struct {
666
667
668 Columns []*ColumnDescription `json:"columns,omitempty"`
669
670 CreateTime string `json:"createTime,omitempty"`
671
672 DisplayName string `json:"displayName,omitempty"`
673
674
675 Name string `json:"name,omitempty"`
676
677 SavedViews []*SavedView `json:"savedViews,omitempty"`
678
679
680 TimeZone string `json:"timeZone,omitempty"`
681
682
683 UpdateTime string `json:"updateTime,omitempty"`
684
685
686 googleapi.ServerResponse `json:"-"`
687
688
689
690
691
692 ForceSendFields []string `json:"-"`
693
694
695
696
697 NullFields []string `json:"-"`
698 }
699
700 func (s *Table) MarshalJSON() ([]byte, error) {
701 type NoMethod Table
702 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
703 }
704
705
706 type UpdateRowRequest struct {
707
708 Row *Row `json:"row,omitempty"`
709
710 UpdateMask string `json:"updateMask,omitempty"`
711
712
713
714
715
716
717 View string `json:"view,omitempty"`
718
719
720
721
722
723 ForceSendFields []string `json:"-"`
724
725
726
727
728 NullFields []string `json:"-"`
729 }
730
731 func (s *UpdateRowRequest) MarshalJSON() ([]byte, error) {
732 type NoMethod UpdateRowRequest
733 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
734 }
735
736
737 type Workspace struct {
738
739 CreateTime string `json:"createTime,omitempty"`
740
741 DisplayName string `json:"displayName,omitempty"`
742
743
744 Name string `json:"name,omitempty"`
745
746 Tables []*Table `json:"tables,omitempty"`
747
748 UpdateTime string `json:"updateTime,omitempty"`
749
750
751 googleapi.ServerResponse `json:"-"`
752
753
754
755
756
757 ForceSendFields []string `json:"-"`
758
759
760
761
762 NullFields []string `json:"-"`
763 }
764
765 func (s *Workspace) MarshalJSON() ([]byte, error) {
766 type NoMethod Workspace
767 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
768 }
769
770 type TablesGetCall struct {
771 s *Service
772 name string
773 urlParams_ gensupport.URLParams
774 ifNoneMatch_ string
775 ctx_ context.Context
776 header_ http.Header
777 }
778
779
780
781
782 func (r *TablesService) Get(name string) *TablesGetCall {
783 c := &TablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
784 c.name = name
785 return c
786 }
787
788
789
790
791 func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall {
792 c.urlParams_.Set("fields", googleapi.CombineFields(s))
793 return c
794 }
795
796
797
798
799 func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall {
800 c.ifNoneMatch_ = entityTag
801 return c
802 }
803
804
805 func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall {
806 c.ctx_ = ctx
807 return c
808 }
809
810
811
812 func (c *TablesGetCall) Header() http.Header {
813 if c.header_ == nil {
814 c.header_ = make(http.Header)
815 }
816 return c.header_
817 }
818
819 func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) {
820 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
821 if c.ifNoneMatch_ != "" {
822 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
823 }
824 var body io.Reader = nil
825 c.urlParams_.Set("alt", alt)
826 c.urlParams_.Set("prettyPrint", "false")
827 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
828 urls += "?" + c.urlParams_.Encode()
829 req, err := http.NewRequest("GET", urls, body)
830 if err != nil {
831 return nil, err
832 }
833 req.Header = reqHeaders
834 googleapi.Expand(req.URL, map[string]string{
835 "name": c.name,
836 })
837 return gensupport.SendRequest(c.ctx_, c.s.client, req)
838 }
839
840
841
842
843
844
845 func (c *TablesGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
846 gensupport.SetOptions(c.urlParams_, opts...)
847 res, err := c.doRequest("json")
848 if res != nil && res.StatusCode == http.StatusNotModified {
849 if res.Body != nil {
850 res.Body.Close()
851 }
852 return nil, gensupport.WrapError(&googleapi.Error{
853 Code: res.StatusCode,
854 Header: res.Header,
855 })
856 }
857 if err != nil {
858 return nil, err
859 }
860 defer googleapi.CloseBody(res)
861 if err := googleapi.CheckResponse(res); err != nil {
862 return nil, gensupport.WrapError(err)
863 }
864 ret := &Table{
865 ServerResponse: googleapi.ServerResponse{
866 Header: res.Header,
867 HTTPStatusCode: res.StatusCode,
868 },
869 }
870 target := &ret
871 if err := gensupport.DecodeResponse(target, res); err != nil {
872 return nil, err
873 }
874 return ret, nil
875 }
876
877 type TablesListCall struct {
878 s *Service
879 urlParams_ gensupport.URLParams
880 ifNoneMatch_ string
881 ctx_ context.Context
882 header_ http.Header
883 }
884
885
886 func (r *TablesService) List() *TablesListCall {
887 c := &TablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
888 return c
889 }
890
891
892
893 func (c *TablesListCall) OrderBy(orderBy string) *TablesListCall {
894 c.urlParams_.Set("orderBy", orderBy)
895 return c
896 }
897
898
899
900
901
902 func (c *TablesListCall) PageSize(pageSize int64) *TablesListCall {
903 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
904 return c
905 }
906
907
908
909
910
911 func (c *TablesListCall) PageToken(pageToken string) *TablesListCall {
912 c.urlParams_.Set("pageToken", pageToken)
913 return c
914 }
915
916
917
918
919 func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall {
920 c.urlParams_.Set("fields", googleapi.CombineFields(s))
921 return c
922 }
923
924
925
926
927 func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall {
928 c.ifNoneMatch_ = entityTag
929 return c
930 }
931
932
933 func (c *TablesListCall) Context(ctx context.Context) *TablesListCall {
934 c.ctx_ = ctx
935 return c
936 }
937
938
939
940 func (c *TablesListCall) Header() http.Header {
941 if c.header_ == nil {
942 c.header_ = make(http.Header)
943 }
944 return c.header_
945 }
946
947 func (c *TablesListCall) doRequest(alt string) (*http.Response, error) {
948 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
949 if c.ifNoneMatch_ != "" {
950 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
951 }
952 var body io.Reader = nil
953 c.urlParams_.Set("alt", alt)
954 c.urlParams_.Set("prettyPrint", "false")
955 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/tables")
956 urls += "?" + c.urlParams_.Encode()
957 req, err := http.NewRequest("GET", urls, body)
958 if err != nil {
959 return nil, err
960 }
961 req.Header = reqHeaders
962 return gensupport.SendRequest(c.ctx_, c.s.client, req)
963 }
964
965
966
967
968
969
970
971 func (c *TablesListCall) Do(opts ...googleapi.CallOption) (*ListTablesResponse, error) {
972 gensupport.SetOptions(c.urlParams_, opts...)
973 res, err := c.doRequest("json")
974 if res != nil && res.StatusCode == http.StatusNotModified {
975 if res.Body != nil {
976 res.Body.Close()
977 }
978 return nil, gensupport.WrapError(&googleapi.Error{
979 Code: res.StatusCode,
980 Header: res.Header,
981 })
982 }
983 if err != nil {
984 return nil, err
985 }
986 defer googleapi.CloseBody(res)
987 if err := googleapi.CheckResponse(res); err != nil {
988 return nil, gensupport.WrapError(err)
989 }
990 ret := &ListTablesResponse{
991 ServerResponse: googleapi.ServerResponse{
992 Header: res.Header,
993 HTTPStatusCode: res.StatusCode,
994 },
995 }
996 target := &ret
997 if err := gensupport.DecodeResponse(target, res); err != nil {
998 return nil, err
999 }
1000 return ret, nil
1001 }
1002
1003
1004
1005
1006 func (c *TablesListCall) Pages(ctx context.Context, f func(*ListTablesResponse) error) error {
1007 c.ctx_ = ctx
1008 defer c.PageToken(c.urlParams_.Get("pageToken"))
1009 for {
1010 x, err := c.Do()
1011 if err != nil {
1012 return err
1013 }
1014 if err := f(x); err != nil {
1015 return err
1016 }
1017 if x.NextPageToken == "" {
1018 return nil
1019 }
1020 c.PageToken(x.NextPageToken)
1021 }
1022 }
1023
1024 type TablesRowsBatchCreateCall struct {
1025 s *Service
1026 parent string
1027 batchcreaterowsrequest *BatchCreateRowsRequest
1028 urlParams_ gensupport.URLParams
1029 ctx_ context.Context
1030 header_ http.Header
1031 }
1032
1033
1034
1035
1036
1037 func (r *TablesRowsService) BatchCreate(parent string, batchcreaterowsrequest *BatchCreateRowsRequest) *TablesRowsBatchCreateCall {
1038 c := &TablesRowsBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1039 c.parent = parent
1040 c.batchcreaterowsrequest = batchcreaterowsrequest
1041 return c
1042 }
1043
1044
1045
1046
1047 func (c *TablesRowsBatchCreateCall) Fields(s ...googleapi.Field) *TablesRowsBatchCreateCall {
1048 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1049 return c
1050 }
1051
1052
1053 func (c *TablesRowsBatchCreateCall) Context(ctx context.Context) *TablesRowsBatchCreateCall {
1054 c.ctx_ = ctx
1055 return c
1056 }
1057
1058
1059
1060 func (c *TablesRowsBatchCreateCall) Header() http.Header {
1061 if c.header_ == nil {
1062 c.header_ = make(http.Header)
1063 }
1064 return c.header_
1065 }
1066
1067 func (c *TablesRowsBatchCreateCall) doRequest(alt string) (*http.Response, error) {
1068 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1069 var body io.Reader = nil
1070 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreaterowsrequest)
1071 if err != nil {
1072 return nil, err
1073 }
1074 c.urlParams_.Set("alt", alt)
1075 c.urlParams_.Set("prettyPrint", "false")
1076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/rows:batchCreate")
1077 urls += "?" + c.urlParams_.Encode()
1078 req, err := http.NewRequest("POST", urls, body)
1079 if err != nil {
1080 return nil, err
1081 }
1082 req.Header = reqHeaders
1083 googleapi.Expand(req.URL, map[string]string{
1084 "parent": c.parent,
1085 })
1086 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1087 }
1088
1089
1090
1091
1092
1093
1094
1095 func (c *TablesRowsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateRowsResponse, error) {
1096 gensupport.SetOptions(c.urlParams_, opts...)
1097 res, err := c.doRequest("json")
1098 if res != nil && res.StatusCode == http.StatusNotModified {
1099 if res.Body != nil {
1100 res.Body.Close()
1101 }
1102 return nil, gensupport.WrapError(&googleapi.Error{
1103 Code: res.StatusCode,
1104 Header: res.Header,
1105 })
1106 }
1107 if err != nil {
1108 return nil, err
1109 }
1110 defer googleapi.CloseBody(res)
1111 if err := googleapi.CheckResponse(res); err != nil {
1112 return nil, gensupport.WrapError(err)
1113 }
1114 ret := &BatchCreateRowsResponse{
1115 ServerResponse: googleapi.ServerResponse{
1116 Header: res.Header,
1117 HTTPStatusCode: res.StatusCode,
1118 },
1119 }
1120 target := &ret
1121 if err := gensupport.DecodeResponse(target, res); err != nil {
1122 return nil, err
1123 }
1124 return ret, nil
1125 }
1126
1127 type TablesRowsBatchDeleteCall struct {
1128 s *Service
1129 parent string
1130 batchdeleterowsrequest *BatchDeleteRowsRequest
1131 urlParams_ gensupport.URLParams
1132 ctx_ context.Context
1133 header_ http.Header
1134 }
1135
1136
1137
1138
1139
1140 func (r *TablesRowsService) BatchDelete(parent string, batchdeleterowsrequest *BatchDeleteRowsRequest) *TablesRowsBatchDeleteCall {
1141 c := &TablesRowsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1142 c.parent = parent
1143 c.batchdeleterowsrequest = batchdeleterowsrequest
1144 return c
1145 }
1146
1147
1148
1149
1150 func (c *TablesRowsBatchDeleteCall) Fields(s ...googleapi.Field) *TablesRowsBatchDeleteCall {
1151 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1152 return c
1153 }
1154
1155
1156 func (c *TablesRowsBatchDeleteCall) Context(ctx context.Context) *TablesRowsBatchDeleteCall {
1157 c.ctx_ = ctx
1158 return c
1159 }
1160
1161
1162
1163 func (c *TablesRowsBatchDeleteCall) Header() http.Header {
1164 if c.header_ == nil {
1165 c.header_ = make(http.Header)
1166 }
1167 return c.header_
1168 }
1169
1170 func (c *TablesRowsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
1171 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1172 var body io.Reader = nil
1173 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleterowsrequest)
1174 if err != nil {
1175 return nil, err
1176 }
1177 c.urlParams_.Set("alt", alt)
1178 c.urlParams_.Set("prettyPrint", "false")
1179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/rows:batchDelete")
1180 urls += "?" + c.urlParams_.Encode()
1181 req, err := http.NewRequest("POST", urls, body)
1182 if err != nil {
1183 return nil, err
1184 }
1185 req.Header = reqHeaders
1186 googleapi.Expand(req.URL, map[string]string{
1187 "parent": c.parent,
1188 })
1189 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1190 }
1191
1192
1193
1194
1195
1196
1197 func (c *TablesRowsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1198 gensupport.SetOptions(c.urlParams_, opts...)
1199 res, err := c.doRequest("json")
1200 if res != nil && res.StatusCode == http.StatusNotModified {
1201 if res.Body != nil {
1202 res.Body.Close()
1203 }
1204 return nil, gensupport.WrapError(&googleapi.Error{
1205 Code: res.StatusCode,
1206 Header: res.Header,
1207 })
1208 }
1209 if err != nil {
1210 return nil, err
1211 }
1212 defer googleapi.CloseBody(res)
1213 if err := googleapi.CheckResponse(res); err != nil {
1214 return nil, gensupport.WrapError(err)
1215 }
1216 ret := &Empty{
1217 ServerResponse: googleapi.ServerResponse{
1218 Header: res.Header,
1219 HTTPStatusCode: res.StatusCode,
1220 },
1221 }
1222 target := &ret
1223 if err := gensupport.DecodeResponse(target, res); err != nil {
1224 return nil, err
1225 }
1226 return ret, nil
1227 }
1228
1229 type TablesRowsBatchUpdateCall struct {
1230 s *Service
1231 parent string
1232 batchupdaterowsrequest *BatchUpdateRowsRequest
1233 urlParams_ gensupport.URLParams
1234 ctx_ context.Context
1235 header_ http.Header
1236 }
1237
1238
1239
1240
1241
1242 func (r *TablesRowsService) BatchUpdate(parent string, batchupdaterowsrequest *BatchUpdateRowsRequest) *TablesRowsBatchUpdateCall {
1243 c := &TablesRowsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1244 c.parent = parent
1245 c.batchupdaterowsrequest = batchupdaterowsrequest
1246 return c
1247 }
1248
1249
1250
1251
1252 func (c *TablesRowsBatchUpdateCall) Fields(s ...googleapi.Field) *TablesRowsBatchUpdateCall {
1253 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1254 return c
1255 }
1256
1257
1258 func (c *TablesRowsBatchUpdateCall) Context(ctx context.Context) *TablesRowsBatchUpdateCall {
1259 c.ctx_ = ctx
1260 return c
1261 }
1262
1263
1264
1265 func (c *TablesRowsBatchUpdateCall) Header() http.Header {
1266 if c.header_ == nil {
1267 c.header_ = make(http.Header)
1268 }
1269 return c.header_
1270 }
1271
1272 func (c *TablesRowsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
1273 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1274 var body io.Reader = nil
1275 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdaterowsrequest)
1276 if err != nil {
1277 return nil, err
1278 }
1279 c.urlParams_.Set("alt", alt)
1280 c.urlParams_.Set("prettyPrint", "false")
1281 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/rows:batchUpdate")
1282 urls += "?" + c.urlParams_.Encode()
1283 req, err := http.NewRequest("POST", urls, body)
1284 if err != nil {
1285 return nil, err
1286 }
1287 req.Header = reqHeaders
1288 googleapi.Expand(req.URL, map[string]string{
1289 "parent": c.parent,
1290 })
1291 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1292 }
1293
1294
1295
1296
1297
1298
1299
1300 func (c *TablesRowsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateRowsResponse, error) {
1301 gensupport.SetOptions(c.urlParams_, opts...)
1302 res, err := c.doRequest("json")
1303 if res != nil && res.StatusCode == http.StatusNotModified {
1304 if res.Body != nil {
1305 res.Body.Close()
1306 }
1307 return nil, gensupport.WrapError(&googleapi.Error{
1308 Code: res.StatusCode,
1309 Header: res.Header,
1310 })
1311 }
1312 if err != nil {
1313 return nil, err
1314 }
1315 defer googleapi.CloseBody(res)
1316 if err := googleapi.CheckResponse(res); err != nil {
1317 return nil, gensupport.WrapError(err)
1318 }
1319 ret := &BatchUpdateRowsResponse{
1320 ServerResponse: googleapi.ServerResponse{
1321 Header: res.Header,
1322 HTTPStatusCode: res.StatusCode,
1323 },
1324 }
1325 target := &ret
1326 if err := gensupport.DecodeResponse(target, res); err != nil {
1327 return nil, err
1328 }
1329 return ret, nil
1330 }
1331
1332 type TablesRowsCreateCall struct {
1333 s *Service
1334 parent string
1335 row *Row
1336 urlParams_ gensupport.URLParams
1337 ctx_ context.Context
1338 header_ http.Header
1339 }
1340
1341
1342
1343
1344
1345 func (r *TablesRowsService) Create(parent string, row *Row) *TablesRowsCreateCall {
1346 c := &TablesRowsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1347 c.parent = parent
1348 c.row = row
1349 return c
1350 }
1351
1352
1353
1354
1355
1356
1357
1358
1359 func (c *TablesRowsCreateCall) View(view string) *TablesRowsCreateCall {
1360 c.urlParams_.Set("view", view)
1361 return c
1362 }
1363
1364
1365
1366
1367 func (c *TablesRowsCreateCall) Fields(s ...googleapi.Field) *TablesRowsCreateCall {
1368 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1369 return c
1370 }
1371
1372
1373 func (c *TablesRowsCreateCall) Context(ctx context.Context) *TablesRowsCreateCall {
1374 c.ctx_ = ctx
1375 return c
1376 }
1377
1378
1379
1380 func (c *TablesRowsCreateCall) Header() http.Header {
1381 if c.header_ == nil {
1382 c.header_ = make(http.Header)
1383 }
1384 return c.header_
1385 }
1386
1387 func (c *TablesRowsCreateCall) doRequest(alt string) (*http.Response, error) {
1388 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1389 var body io.Reader = nil
1390 body, err := googleapi.WithoutDataWrapper.JSONReader(c.row)
1391 if err != nil {
1392 return nil, err
1393 }
1394 c.urlParams_.Set("alt", alt)
1395 c.urlParams_.Set("prettyPrint", "false")
1396 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/rows")
1397 urls += "?" + c.urlParams_.Encode()
1398 req, err := http.NewRequest("POST", urls, body)
1399 if err != nil {
1400 return nil, err
1401 }
1402 req.Header = reqHeaders
1403 googleapi.Expand(req.URL, map[string]string{
1404 "parent": c.parent,
1405 })
1406 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1407 }
1408
1409
1410
1411
1412
1413
1414 func (c *TablesRowsCreateCall) Do(opts ...googleapi.CallOption) (*Row, error) {
1415 gensupport.SetOptions(c.urlParams_, opts...)
1416 res, err := c.doRequest("json")
1417 if res != nil && res.StatusCode == http.StatusNotModified {
1418 if res.Body != nil {
1419 res.Body.Close()
1420 }
1421 return nil, gensupport.WrapError(&googleapi.Error{
1422 Code: res.StatusCode,
1423 Header: res.Header,
1424 })
1425 }
1426 if err != nil {
1427 return nil, err
1428 }
1429 defer googleapi.CloseBody(res)
1430 if err := googleapi.CheckResponse(res); err != nil {
1431 return nil, gensupport.WrapError(err)
1432 }
1433 ret := &Row{
1434 ServerResponse: googleapi.ServerResponse{
1435 Header: res.Header,
1436 HTTPStatusCode: res.StatusCode,
1437 },
1438 }
1439 target := &ret
1440 if err := gensupport.DecodeResponse(target, res); err != nil {
1441 return nil, err
1442 }
1443 return ret, nil
1444 }
1445
1446 type TablesRowsDeleteCall struct {
1447 s *Service
1448 name string
1449 urlParams_ gensupport.URLParams
1450 ctx_ context.Context
1451 header_ http.Header
1452 }
1453
1454
1455
1456
1457 func (r *TablesRowsService) Delete(name string) *TablesRowsDeleteCall {
1458 c := &TablesRowsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1459 c.name = name
1460 return c
1461 }
1462
1463
1464
1465
1466 func (c *TablesRowsDeleteCall) Fields(s ...googleapi.Field) *TablesRowsDeleteCall {
1467 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1468 return c
1469 }
1470
1471
1472 func (c *TablesRowsDeleteCall) Context(ctx context.Context) *TablesRowsDeleteCall {
1473 c.ctx_ = ctx
1474 return c
1475 }
1476
1477
1478
1479 func (c *TablesRowsDeleteCall) Header() http.Header {
1480 if c.header_ == nil {
1481 c.header_ = make(http.Header)
1482 }
1483 return c.header_
1484 }
1485
1486 func (c *TablesRowsDeleteCall) doRequest(alt string) (*http.Response, error) {
1487 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1488 var body io.Reader = nil
1489 c.urlParams_.Set("alt", alt)
1490 c.urlParams_.Set("prettyPrint", "false")
1491 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1492 urls += "?" + c.urlParams_.Encode()
1493 req, err := http.NewRequest("DELETE", urls, body)
1494 if err != nil {
1495 return nil, err
1496 }
1497 req.Header = reqHeaders
1498 googleapi.Expand(req.URL, map[string]string{
1499 "name": c.name,
1500 })
1501 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1502 }
1503
1504
1505
1506
1507
1508
1509 func (c *TablesRowsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1510 gensupport.SetOptions(c.urlParams_, opts...)
1511 res, err := c.doRequest("json")
1512 if res != nil && res.StatusCode == http.StatusNotModified {
1513 if res.Body != nil {
1514 res.Body.Close()
1515 }
1516 return nil, gensupport.WrapError(&googleapi.Error{
1517 Code: res.StatusCode,
1518 Header: res.Header,
1519 })
1520 }
1521 if err != nil {
1522 return nil, err
1523 }
1524 defer googleapi.CloseBody(res)
1525 if err := googleapi.CheckResponse(res); err != nil {
1526 return nil, gensupport.WrapError(err)
1527 }
1528 ret := &Empty{
1529 ServerResponse: googleapi.ServerResponse{
1530 Header: res.Header,
1531 HTTPStatusCode: res.StatusCode,
1532 },
1533 }
1534 target := &ret
1535 if err := gensupport.DecodeResponse(target, res); err != nil {
1536 return nil, err
1537 }
1538 return ret, nil
1539 }
1540
1541 type TablesRowsGetCall struct {
1542 s *Service
1543 name string
1544 urlParams_ gensupport.URLParams
1545 ifNoneMatch_ string
1546 ctx_ context.Context
1547 header_ http.Header
1548 }
1549
1550
1551
1552
1553 func (r *TablesRowsService) Get(name string) *TablesRowsGetCall {
1554 c := &TablesRowsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1555 c.name = name
1556 return c
1557 }
1558
1559
1560
1561
1562
1563
1564
1565
1566 func (c *TablesRowsGetCall) View(view string) *TablesRowsGetCall {
1567 c.urlParams_.Set("view", view)
1568 return c
1569 }
1570
1571
1572
1573
1574 func (c *TablesRowsGetCall) Fields(s ...googleapi.Field) *TablesRowsGetCall {
1575 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1576 return c
1577 }
1578
1579
1580
1581
1582 func (c *TablesRowsGetCall) IfNoneMatch(entityTag string) *TablesRowsGetCall {
1583 c.ifNoneMatch_ = entityTag
1584 return c
1585 }
1586
1587
1588 func (c *TablesRowsGetCall) Context(ctx context.Context) *TablesRowsGetCall {
1589 c.ctx_ = ctx
1590 return c
1591 }
1592
1593
1594
1595 func (c *TablesRowsGetCall) Header() http.Header {
1596 if c.header_ == nil {
1597 c.header_ = make(http.Header)
1598 }
1599 return c.header_
1600 }
1601
1602 func (c *TablesRowsGetCall) doRequest(alt string) (*http.Response, error) {
1603 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1604 if c.ifNoneMatch_ != "" {
1605 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1606 }
1607 var body io.Reader = nil
1608 c.urlParams_.Set("alt", alt)
1609 c.urlParams_.Set("prettyPrint", "false")
1610 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1611 urls += "?" + c.urlParams_.Encode()
1612 req, err := http.NewRequest("GET", urls, body)
1613 if err != nil {
1614 return nil, err
1615 }
1616 req.Header = reqHeaders
1617 googleapi.Expand(req.URL, map[string]string{
1618 "name": c.name,
1619 })
1620 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1621 }
1622
1623
1624
1625
1626
1627
1628 func (c *TablesRowsGetCall) Do(opts ...googleapi.CallOption) (*Row, error) {
1629 gensupport.SetOptions(c.urlParams_, opts...)
1630 res, err := c.doRequest("json")
1631 if res != nil && res.StatusCode == http.StatusNotModified {
1632 if res.Body != nil {
1633 res.Body.Close()
1634 }
1635 return nil, gensupport.WrapError(&googleapi.Error{
1636 Code: res.StatusCode,
1637 Header: res.Header,
1638 })
1639 }
1640 if err != nil {
1641 return nil, err
1642 }
1643 defer googleapi.CloseBody(res)
1644 if err := googleapi.CheckResponse(res); err != nil {
1645 return nil, gensupport.WrapError(err)
1646 }
1647 ret := &Row{
1648 ServerResponse: googleapi.ServerResponse{
1649 Header: res.Header,
1650 HTTPStatusCode: res.StatusCode,
1651 },
1652 }
1653 target := &ret
1654 if err := gensupport.DecodeResponse(target, res); err != nil {
1655 return nil, err
1656 }
1657 return ret, nil
1658 }
1659
1660 type TablesRowsListCall struct {
1661 s *Service
1662 parent string
1663 urlParams_ gensupport.URLParams
1664 ifNoneMatch_ string
1665 ctx_ context.Context
1666 header_ http.Header
1667 }
1668
1669
1670
1671
1672 func (r *TablesRowsService) List(parent string) *TablesRowsListCall {
1673 c := &TablesRowsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1674 c.parent = parent
1675 return c
1676 }
1677
1678
1679
1680
1681 func (c *TablesRowsListCall) Filter(filter string) *TablesRowsListCall {
1682 c.urlParams_.Set("filter", filter)
1683 return c
1684 }
1685
1686
1687
1688 func (c *TablesRowsListCall) OrderBy(orderBy string) *TablesRowsListCall {
1689 c.urlParams_.Set("orderBy", orderBy)
1690 return c
1691 }
1692
1693
1694
1695
1696
1697 func (c *TablesRowsListCall) PageSize(pageSize int64) *TablesRowsListCall {
1698 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1699 return c
1700 }
1701
1702
1703
1704
1705
1706 func (c *TablesRowsListCall) PageToken(pageToken string) *TablesRowsListCall {
1707 c.urlParams_.Set("pageToken", pageToken)
1708 return c
1709 }
1710
1711
1712
1713
1714
1715
1716
1717
1718 func (c *TablesRowsListCall) View(view string) *TablesRowsListCall {
1719 c.urlParams_.Set("view", view)
1720 return c
1721 }
1722
1723
1724
1725
1726 func (c *TablesRowsListCall) Fields(s ...googleapi.Field) *TablesRowsListCall {
1727 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1728 return c
1729 }
1730
1731
1732
1733
1734 func (c *TablesRowsListCall) IfNoneMatch(entityTag string) *TablesRowsListCall {
1735 c.ifNoneMatch_ = entityTag
1736 return c
1737 }
1738
1739
1740 func (c *TablesRowsListCall) Context(ctx context.Context) *TablesRowsListCall {
1741 c.ctx_ = ctx
1742 return c
1743 }
1744
1745
1746
1747 func (c *TablesRowsListCall) Header() http.Header {
1748 if c.header_ == nil {
1749 c.header_ = make(http.Header)
1750 }
1751 return c.header_
1752 }
1753
1754 func (c *TablesRowsListCall) doRequest(alt string) (*http.Response, error) {
1755 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1756 if c.ifNoneMatch_ != "" {
1757 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1758 }
1759 var body io.Reader = nil
1760 c.urlParams_.Set("alt", alt)
1761 c.urlParams_.Set("prettyPrint", "false")
1762 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/rows")
1763 urls += "?" + c.urlParams_.Encode()
1764 req, err := http.NewRequest("GET", urls, body)
1765 if err != nil {
1766 return nil, err
1767 }
1768 req.Header = reqHeaders
1769 googleapi.Expand(req.URL, map[string]string{
1770 "parent": c.parent,
1771 })
1772 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1773 }
1774
1775
1776
1777
1778
1779
1780
1781 func (c *TablesRowsListCall) Do(opts ...googleapi.CallOption) (*ListRowsResponse, error) {
1782 gensupport.SetOptions(c.urlParams_, opts...)
1783 res, err := c.doRequest("json")
1784 if res != nil && res.StatusCode == http.StatusNotModified {
1785 if res.Body != nil {
1786 res.Body.Close()
1787 }
1788 return nil, gensupport.WrapError(&googleapi.Error{
1789 Code: res.StatusCode,
1790 Header: res.Header,
1791 })
1792 }
1793 if err != nil {
1794 return nil, err
1795 }
1796 defer googleapi.CloseBody(res)
1797 if err := googleapi.CheckResponse(res); err != nil {
1798 return nil, gensupport.WrapError(err)
1799 }
1800 ret := &ListRowsResponse{
1801 ServerResponse: googleapi.ServerResponse{
1802 Header: res.Header,
1803 HTTPStatusCode: res.StatusCode,
1804 },
1805 }
1806 target := &ret
1807 if err := gensupport.DecodeResponse(target, res); err != nil {
1808 return nil, err
1809 }
1810 return ret, nil
1811 }
1812
1813
1814
1815
1816 func (c *TablesRowsListCall) Pages(ctx context.Context, f func(*ListRowsResponse) error) error {
1817 c.ctx_ = ctx
1818 defer c.PageToken(c.urlParams_.Get("pageToken"))
1819 for {
1820 x, err := c.Do()
1821 if err != nil {
1822 return err
1823 }
1824 if err := f(x); err != nil {
1825 return err
1826 }
1827 if x.NextPageToken == "" {
1828 return nil
1829 }
1830 c.PageToken(x.NextPageToken)
1831 }
1832 }
1833
1834 type TablesRowsPatchCall struct {
1835 s *Service
1836 name string
1837 row *Row
1838 urlParams_ gensupport.URLParams
1839 ctx_ context.Context
1840 header_ http.Header
1841 }
1842
1843
1844
1845
1846
1847 func (r *TablesRowsService) Patch(name string, row *Row) *TablesRowsPatchCall {
1848 c := &TablesRowsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1849 c.name = name
1850 c.row = row
1851 return c
1852 }
1853
1854
1855
1856 func (c *TablesRowsPatchCall) UpdateMask(updateMask string) *TablesRowsPatchCall {
1857 c.urlParams_.Set("updateMask", updateMask)
1858 return c
1859 }
1860
1861
1862
1863
1864
1865
1866
1867
1868 func (c *TablesRowsPatchCall) View(view string) *TablesRowsPatchCall {
1869 c.urlParams_.Set("view", view)
1870 return c
1871 }
1872
1873
1874
1875
1876 func (c *TablesRowsPatchCall) Fields(s ...googleapi.Field) *TablesRowsPatchCall {
1877 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1878 return c
1879 }
1880
1881
1882 func (c *TablesRowsPatchCall) Context(ctx context.Context) *TablesRowsPatchCall {
1883 c.ctx_ = ctx
1884 return c
1885 }
1886
1887
1888
1889 func (c *TablesRowsPatchCall) Header() http.Header {
1890 if c.header_ == nil {
1891 c.header_ = make(http.Header)
1892 }
1893 return c.header_
1894 }
1895
1896 func (c *TablesRowsPatchCall) doRequest(alt string) (*http.Response, error) {
1897 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1898 var body io.Reader = nil
1899 body, err := googleapi.WithoutDataWrapper.JSONReader(c.row)
1900 if err != nil {
1901 return nil, err
1902 }
1903 c.urlParams_.Set("alt", alt)
1904 c.urlParams_.Set("prettyPrint", "false")
1905 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1906 urls += "?" + c.urlParams_.Encode()
1907 req, err := http.NewRequest("PATCH", urls, body)
1908 if err != nil {
1909 return nil, err
1910 }
1911 req.Header = reqHeaders
1912 googleapi.Expand(req.URL, map[string]string{
1913 "name": c.name,
1914 })
1915 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1916 }
1917
1918
1919
1920
1921
1922
1923 func (c *TablesRowsPatchCall) Do(opts ...googleapi.CallOption) (*Row, error) {
1924 gensupport.SetOptions(c.urlParams_, opts...)
1925 res, err := c.doRequest("json")
1926 if res != nil && res.StatusCode == http.StatusNotModified {
1927 if res.Body != nil {
1928 res.Body.Close()
1929 }
1930 return nil, gensupport.WrapError(&googleapi.Error{
1931 Code: res.StatusCode,
1932 Header: res.Header,
1933 })
1934 }
1935 if err != nil {
1936 return nil, err
1937 }
1938 defer googleapi.CloseBody(res)
1939 if err := googleapi.CheckResponse(res); err != nil {
1940 return nil, gensupport.WrapError(err)
1941 }
1942 ret := &Row{
1943 ServerResponse: googleapi.ServerResponse{
1944 Header: res.Header,
1945 HTTPStatusCode: res.StatusCode,
1946 },
1947 }
1948 target := &ret
1949 if err := gensupport.DecodeResponse(target, res); err != nil {
1950 return nil, err
1951 }
1952 return ret, nil
1953 }
1954
1955 type WorkspacesGetCall struct {
1956 s *Service
1957 name string
1958 urlParams_ gensupport.URLParams
1959 ifNoneMatch_ string
1960 ctx_ context.Context
1961 header_ http.Header
1962 }
1963
1964
1965
1966
1967
1968 func (r *WorkspacesService) Get(name string) *WorkspacesGetCall {
1969 c := &WorkspacesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1970 c.name = name
1971 return c
1972 }
1973
1974
1975
1976
1977 func (c *WorkspacesGetCall) Fields(s ...googleapi.Field) *WorkspacesGetCall {
1978 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1979 return c
1980 }
1981
1982
1983
1984
1985 func (c *WorkspacesGetCall) IfNoneMatch(entityTag string) *WorkspacesGetCall {
1986 c.ifNoneMatch_ = entityTag
1987 return c
1988 }
1989
1990
1991 func (c *WorkspacesGetCall) Context(ctx context.Context) *WorkspacesGetCall {
1992 c.ctx_ = ctx
1993 return c
1994 }
1995
1996
1997
1998 func (c *WorkspacesGetCall) Header() http.Header {
1999 if c.header_ == nil {
2000 c.header_ = make(http.Header)
2001 }
2002 return c.header_
2003 }
2004
2005 func (c *WorkspacesGetCall) doRequest(alt string) (*http.Response, error) {
2006 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2007 if c.ifNoneMatch_ != "" {
2008 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2009 }
2010 var body io.Reader = nil
2011 c.urlParams_.Set("alt", alt)
2012 c.urlParams_.Set("prettyPrint", "false")
2013 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
2014 urls += "?" + c.urlParams_.Encode()
2015 req, err := http.NewRequest("GET", urls, body)
2016 if err != nil {
2017 return nil, err
2018 }
2019 req.Header = reqHeaders
2020 googleapi.Expand(req.URL, map[string]string{
2021 "name": c.name,
2022 })
2023 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2024 }
2025
2026
2027
2028
2029
2030
2031 func (c *WorkspacesGetCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
2032 gensupport.SetOptions(c.urlParams_, opts...)
2033 res, err := c.doRequest("json")
2034 if res != nil && res.StatusCode == http.StatusNotModified {
2035 if res.Body != nil {
2036 res.Body.Close()
2037 }
2038 return nil, gensupport.WrapError(&googleapi.Error{
2039 Code: res.StatusCode,
2040 Header: res.Header,
2041 })
2042 }
2043 if err != nil {
2044 return nil, err
2045 }
2046 defer googleapi.CloseBody(res)
2047 if err := googleapi.CheckResponse(res); err != nil {
2048 return nil, gensupport.WrapError(err)
2049 }
2050 ret := &Workspace{
2051 ServerResponse: googleapi.ServerResponse{
2052 Header: res.Header,
2053 HTTPStatusCode: res.StatusCode,
2054 },
2055 }
2056 target := &ret
2057 if err := gensupport.DecodeResponse(target, res); err != nil {
2058 return nil, err
2059 }
2060 return ret, nil
2061 }
2062
2063 type WorkspacesListCall struct {
2064 s *Service
2065 urlParams_ gensupport.URLParams
2066 ifNoneMatch_ string
2067 ctx_ context.Context
2068 header_ http.Header
2069 }
2070
2071
2072 func (r *WorkspacesService) List() *WorkspacesListCall {
2073 c := &WorkspacesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2074 return c
2075 }
2076
2077
2078
2079
2080
2081 func (c *WorkspacesListCall) PageSize(pageSize int64) *WorkspacesListCall {
2082 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2083 return c
2084 }
2085
2086
2087
2088
2089
2090 func (c *WorkspacesListCall) PageToken(pageToken string) *WorkspacesListCall {
2091 c.urlParams_.Set("pageToken", pageToken)
2092 return c
2093 }
2094
2095
2096
2097
2098 func (c *WorkspacesListCall) Fields(s ...googleapi.Field) *WorkspacesListCall {
2099 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2100 return c
2101 }
2102
2103
2104
2105
2106 func (c *WorkspacesListCall) IfNoneMatch(entityTag string) *WorkspacesListCall {
2107 c.ifNoneMatch_ = entityTag
2108 return c
2109 }
2110
2111
2112 func (c *WorkspacesListCall) Context(ctx context.Context) *WorkspacesListCall {
2113 c.ctx_ = ctx
2114 return c
2115 }
2116
2117
2118
2119 func (c *WorkspacesListCall) Header() http.Header {
2120 if c.header_ == nil {
2121 c.header_ = make(http.Header)
2122 }
2123 return c.header_
2124 }
2125
2126 func (c *WorkspacesListCall) doRequest(alt string) (*http.Response, error) {
2127 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2128 if c.ifNoneMatch_ != "" {
2129 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2130 }
2131 var body io.Reader = nil
2132 c.urlParams_.Set("alt", alt)
2133 c.urlParams_.Set("prettyPrint", "false")
2134 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/workspaces")
2135 urls += "?" + c.urlParams_.Encode()
2136 req, err := http.NewRequest("GET", urls, body)
2137 if err != nil {
2138 return nil, err
2139 }
2140 req.Header = reqHeaders
2141 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2142 }
2143
2144
2145
2146
2147
2148
2149
2150 func (c *WorkspacesListCall) Do(opts ...googleapi.CallOption) (*ListWorkspacesResponse, error) {
2151 gensupport.SetOptions(c.urlParams_, opts...)
2152 res, err := c.doRequest("json")
2153 if res != nil && res.StatusCode == http.StatusNotModified {
2154 if res.Body != nil {
2155 res.Body.Close()
2156 }
2157 return nil, gensupport.WrapError(&googleapi.Error{
2158 Code: res.StatusCode,
2159 Header: res.Header,
2160 })
2161 }
2162 if err != nil {
2163 return nil, err
2164 }
2165 defer googleapi.CloseBody(res)
2166 if err := googleapi.CheckResponse(res); err != nil {
2167 return nil, gensupport.WrapError(err)
2168 }
2169 ret := &ListWorkspacesResponse{
2170 ServerResponse: googleapi.ServerResponse{
2171 Header: res.Header,
2172 HTTPStatusCode: res.StatusCode,
2173 },
2174 }
2175 target := &ret
2176 if err := gensupport.DecodeResponse(target, res); err != nil {
2177 return nil, err
2178 }
2179 return ret, nil
2180 }
2181
2182
2183
2184
2185 func (c *WorkspacesListCall) Pages(ctx context.Context, f func(*ListWorkspacesResponse) error) error {
2186 c.ctx_ = ctx
2187 defer c.PageToken(c.urlParams_.Get("pageToken"))
2188 for {
2189 x, err := c.Do()
2190 if err != nil {
2191 return err
2192 }
2193 if err := f(x); err != nil {
2194 return err
2195 }
2196 if x.NextPageToken == "" {
2197 return nil
2198 }
2199 c.PageToken(x.NextPageToken)
2200 }
2201 }
2202
View as plain text