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