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