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