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 memcache
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 = "memcache:v1beta2"
90 const apiName = "memcache"
91 const apiVersion = "v1beta2"
92 const basePath = "https://memcache.googleapis.com/"
93 const basePathTemplate = "https://memcache.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://memcache.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.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Instances = NewProjectsLocationsInstancesService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 Instances *ProjectsLocationsInstancesService
180
181 Operations *ProjectsLocationsOperationsService
182 }
183
184 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
185 rs := &ProjectsLocationsInstancesService{s: s}
186 return rs
187 }
188
189 type ProjectsLocationsInstancesService struct {
190 s *Service
191 }
192
193 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
194 rs := &ProjectsLocationsOperationsService{s: s}
195 return rs
196 }
197
198 type ProjectsLocationsOperationsService struct {
199 s *Service
200 }
201
202
203 type ApplyParametersRequest struct {
204
205
206
207 ApplyAll bool `json:"applyAll,omitempty"`
208
209 NodeIds []string `json:"nodeIds,omitempty"`
210
211
212
213
214
215 ForceSendFields []string `json:"-"`
216
217
218
219
220 NullFields []string `json:"-"`
221 }
222
223 func (s *ApplyParametersRequest) MarshalJSON() ([]byte, error) {
224 type NoMethod ApplyParametersRequest
225 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
226 }
227
228
229 type ApplySoftwareUpdateRequest struct {
230
231
232
233 ApplyAll bool `json:"applyAll,omitempty"`
234
235
236 NodeIds []string `json:"nodeIds,omitempty"`
237
238
239
240
241
242 ForceSendFields []string `json:"-"`
243
244
245
246
247 NullFields []string `json:"-"`
248 }
249
250 func (s *ApplySoftwareUpdateRequest) MarshalJSON() ([]byte, error) {
251 type NoMethod ApplySoftwareUpdateRequest
252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
253 }
254
255
256 type CancelOperationRequest struct {
257 }
258
259
260 type DailyCycle struct {
261
262 Duration string `json:"duration,omitempty"`
263
264 StartTime *TimeOfDay `json:"startTime,omitempty"`
265
266
267
268
269
270 ForceSendFields []string `json:"-"`
271
272
273
274
275 NullFields []string `json:"-"`
276 }
277
278 func (s *DailyCycle) MarshalJSON() ([]byte, error) {
279 type NoMethod DailyCycle
280 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
281 }
282
283
284
285
286
287
288
289
290
291
292 type Date struct {
293
294
295
296 Day int64 `json:"day,omitempty"`
297
298
299 Month int64 `json:"month,omitempty"`
300
301
302 Year int64 `json:"year,omitempty"`
303
304
305
306
307
308 ForceSendFields []string `json:"-"`
309
310
311
312
313 NullFields []string `json:"-"`
314 }
315
316 func (s *Date) MarshalJSON() ([]byte, error) {
317 type NoMethod Date
318 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
319 }
320
321
322
323
324 type DenyMaintenancePeriod struct {
325
326
327
328
329 EndDate *Date `json:"endDate,omitempty"`
330
331
332
333
334 StartDate *Date `json:"startDate,omitempty"`
335
336
337 Time *TimeOfDay `json:"time,omitempty"`
338
339
340
341
342
343 ForceSendFields []string `json:"-"`
344
345
346
347
348 NullFields []string `json:"-"`
349 }
350
351 func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) {
352 type NoMethod DenyMaintenancePeriod
353 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
354 }
355
356
357
358
359
360 type Empty struct {
361
362 googleapi.ServerResponse `json:"-"`
363 }
364
365
366
367 type GoogleCloudMemcacheV1beta2LocationMetadata struct {
368
369
370
371 AvailableZones map[string]GoogleCloudMemcacheV1beta2ZoneMetadata `json:"availableZones,omitempty"`
372
373
374
375
376
377 ForceSendFields []string `json:"-"`
378
379
380
381
382 NullFields []string `json:"-"`
383 }
384
385 func (s *GoogleCloudMemcacheV1beta2LocationMetadata) MarshalJSON() ([]byte, error) {
386 type NoMethod GoogleCloudMemcacheV1beta2LocationMetadata
387 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
388 }
389
390
391
392 type GoogleCloudMemcacheV1beta2MaintenancePolicy struct {
393
394 CreateTime string `json:"createTime,omitempty"`
395
396
397 Description string `json:"description,omitempty"`
398
399 UpdateTime string `json:"updateTime,omitempty"`
400
401
402
403 WeeklyMaintenanceWindow []*WeeklyMaintenanceWindow `json:"weeklyMaintenanceWindow,omitempty"`
404
405
406
407
408
409 ForceSendFields []string `json:"-"`
410
411
412
413
414 NullFields []string `json:"-"`
415 }
416
417 func (s *GoogleCloudMemcacheV1beta2MaintenancePolicy) MarshalJSON() ([]byte, error) {
418 type NoMethod GoogleCloudMemcacheV1beta2MaintenancePolicy
419 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
420 }
421
422
423
424 type GoogleCloudMemcacheV1beta2OperationMetadata struct {
425
426 ApiVersion string `json:"apiVersion,omitempty"`
427
428
429
430
431 CancelRequested bool `json:"cancelRequested,omitempty"`
432
433 CreateTime string `json:"createTime,omitempty"`
434
435 EndTime string `json:"endTime,omitempty"`
436
437 StatusDetail string `json:"statusDetail,omitempty"`
438
439
440 Target string `json:"target,omitempty"`
441
442 Verb string `json:"verb,omitempty"`
443
444
445
446
447
448 ForceSendFields []string `json:"-"`
449
450
451
452
453 NullFields []string `json:"-"`
454 }
455
456 func (s *GoogleCloudMemcacheV1beta2OperationMetadata) MarshalJSON() ([]byte, error) {
457 type NoMethod GoogleCloudMemcacheV1beta2OperationMetadata
458 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
459 }
460
461
462
463 type GoogleCloudMemcacheV1beta2UpgradeInstanceRequest struct {
464
465
466
467
468
469
470
471
472 MemcacheVersion string `json:"memcacheVersion,omitempty"`
473
474
475
476
477
478 ForceSendFields []string `json:"-"`
479
480
481
482
483 NullFields []string `json:"-"`
484 }
485
486 func (s *GoogleCloudMemcacheV1beta2UpgradeInstanceRequest) MarshalJSON() ([]byte, error) {
487 type NoMethod GoogleCloudMemcacheV1beta2UpgradeInstanceRequest
488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
489 }
490
491 type GoogleCloudMemcacheV1beta2ZoneMetadata struct {
492 }
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513 type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct {
514
515
516
517
518
519
520 ConsumerDefinedName string `json:"consumerDefinedName,omitempty"`
521
522 CreateTime string `json:"createTime,omitempty"`
523
524
525
526
527
528
529 InstanceType string `json:"instanceType,omitempty"`
530
531
532
533 Labels map[string]string `json:"labels,omitempty"`
534
535
536
537
538
539 MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"`
540
541
542
543 MaintenanceSchedules map[string]GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule `json:"maintenanceSchedules,omitempty"`
544
545
546 MaintenanceSettings *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings `json:"maintenanceSettings,omitempty"`
547
548
549
550
551
552
553 Name string `json:"name,omitempty"`
554
555
556
557
558 NotificationParameters map[string]GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter `json:"notificationParameters,omitempty"`
559
560
561
562 ProducerMetadata map[string]string `json:"producerMetadata,omitempty"`
563
564
565
566 ProvisionedResources []*GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource `json:"provisionedResources,omitempty"`
567
568
569
570
571 SlmInstanceTemplate string `json:"slmInstanceTemplate,omitempty"`
572
573
574
575 SloMetadata *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata `json:"sloMetadata,omitempty"`
576
577
578 SoftwareVersions map[string]string `json:"softwareVersions,omitempty"`
579
580
581
582
583
584
585
586
587
588
589
590 State string `json:"state,omitempty"`
591
592
593 TenantProjectId string `json:"tenantProjectId,omitempty"`
594
595 UpdateTime string `json:"updateTime,omitempty"`
596
597
598
599
600
601 ForceSendFields []string `json:"-"`
602
603
604
605
606 NullFields []string `json:"-"`
607 }
608
609 func (s *GoogleCloudSaasacceleratorManagementProvidersV1Instance) MarshalJSON() ([]byte, error) {
610 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1Instance
611 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
612 }
613
614
615
616
617 type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule struct {
618
619
620
621 CanReschedule bool `json:"canReschedule,omitempty"`
622
623 EndTime string `json:"endTime,omitempty"`
624
625
626
627 RolloutManagementPolicy string `json:"rolloutManagementPolicy,omitempty"`
628
629
630
631
632 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"`
633
634 StartTime string `json:"startTime,omitempty"`
635
636
637
638
639
640 ForceSendFields []string `json:"-"`
641
642
643
644
645 NullFields []string `json:"-"`
646 }
647
648 func (s *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule) MarshalJSON() ([]byte, error) {
649 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule
650 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
651 }
652
653
654
655
656 type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings struct {
657
658
659
660 Exclude bool `json:"exclude,omitempty"`
661
662
663 IsRollback bool `json:"isRollback,omitempty"`
664
665
666
667
668
669
670 MaintenancePolicies map[string]MaintenancePolicy `json:"maintenancePolicies,omitempty"`
671
672
673
674
675
676 ForceSendFields []string `json:"-"`
677
678
679
680
681 NullFields []string `json:"-"`
682 }
683
684 func (s *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings) MarshalJSON() ([]byte, error) {
685 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings
686 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
687 }
688
689
690
691
692
693
694 type GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata struct {
695
696 Location string `json:"location,omitempty"`
697
698
699 NodeId string `json:"nodeId,omitempty"`
700
701
702 PerSliEligibility *GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility `json:"perSliEligibility,omitempty"`
703
704
705
706
707
708 ForceSendFields []string `json:"-"`
709
710
711
712
713 NullFields []string `json:"-"`
714 }
715
716 func (s *GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata) MarshalJSON() ([]byte, error) {
717 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata
718 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
719 }
720
721
722
723 type GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter struct {
724
725
726 Values []string `json:"values,omitempty"`
727
728
729
730
731
732 ForceSendFields []string `json:"-"`
733
734
735
736
737 NullFields []string `json:"-"`
738 }
739
740 func (s *GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter) MarshalJSON() ([]byte, error) {
741 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter
742 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
743 }
744
745
746
747 type GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility struct {
748
749
750
751
752
753
754
755
756
757
758
759
760 Eligibilities map[string]GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility `json:"eligibilities,omitempty"`
761
762
763
764
765
766 ForceSendFields []string `json:"-"`
767
768
769
770
771 NullFields []string `json:"-"`
772 }
773
774 func (s *GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility) MarshalJSON() ([]byte, error) {
775 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility
776 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
777 }
778
779
780
781 type GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource struct {
782
783
784
785
786
787
788 ResourceType string `json:"resourceType,omitempty"`
789
790
791 ResourceUrl string `json:"resourceUrl,omitempty"`
792
793
794
795
796
797 ForceSendFields []string `json:"-"`
798
799
800
801
802 NullFields []string `json:"-"`
803 }
804
805 func (s *GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource) MarshalJSON() ([]byte, error) {
806 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource
807 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
808 }
809
810
811
812
813
814 type GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility struct {
815
816 Eligible bool `json:"eligible,omitempty"`
817
818
819
820 Reason string `json:"reason,omitempty"`
821
822
823
824
825
826 ForceSendFields []string `json:"-"`
827
828
829
830
831 NullFields []string `json:"-"`
832 }
833
834 func (s *GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility) MarshalJSON() ([]byte, error) {
835 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility
836 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
837 }
838
839
840
841 type GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata struct {
842
843
844
845
846 Nodes []*GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata `json:"nodes,omitempty"`
847
848
849 PerSliEligibility *GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility `json:"perSliEligibility,omitempty"`
850
851
852
853 Tier string `json:"tier,omitempty"`
854
855
856
857
858
859 ForceSendFields []string `json:"-"`
860
861
862
863
864 NullFields []string `json:"-"`
865 }
866
867 func (s *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata) MarshalJSON() ([]byte, error) {
868 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata
869 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
870 }
871
872
873 type Instance struct {
874
875
876
877 AuthorizedNetwork string `json:"authorizedNetwork,omitempty"`
878
879 CreateTime string `json:"createTime,omitempty"`
880
881 DiscoveryEndpoint string `json:"discoveryEndpoint,omitempty"`
882
883
884 DisplayName string `json:"displayName,omitempty"`
885
886
887 InstanceMessages []*InstanceMessage `json:"instanceMessages,omitempty"`
888
889
890
891 Labels map[string]string `json:"labels,omitempty"`
892
893
894
895 MaintenancePolicy *GoogleCloudMemcacheV1beta2MaintenancePolicy `json:"maintenancePolicy,omitempty"`
896
897 MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"`
898
899
900
901
902 MemcacheFullVersion string `json:"memcacheFullVersion,omitempty"`
903
904
905 MemcacheNodes []*Node `json:"memcacheNodes,omitempty"`
906
907
908
909
910
911
912
913
914
915
916 MemcacheVersion string `json:"memcacheVersion,omitempty"`
917
918
919
920
921
922
923
924 Name string `json:"name,omitempty"`
925
926 NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
927
928 NodeCount int64 `json:"nodeCount,omitempty"`
929
930
931 Parameters *MemcacheParameters `json:"parameters,omitempty"`
932
933
934
935 ReservedIpRangeId []string `json:"reservedIpRangeId,omitempty"`
936
937
938
939
940
941
942
943
944
945
946
947
948
949 State string `json:"state,omitempty"`
950
951
952 UpdateAvailable bool `json:"updateAvailable,omitempty"`
953
954 UpdateTime string `json:"updateTime,omitempty"`
955
956
957
958 Zones []string `json:"zones,omitempty"`
959
960
961 googleapi.ServerResponse `json:"-"`
962
963
964
965
966
967 ForceSendFields []string `json:"-"`
968
969
970
971
972 NullFields []string `json:"-"`
973 }
974
975 func (s *Instance) MarshalJSON() ([]byte, error) {
976 type NoMethod Instance
977 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
978 }
979
980 type InstanceMessage struct {
981
982
983
984
985
986 Code string `json:"code,omitempty"`
987
988 Message string `json:"message,omitempty"`
989
990
991
992
993
994 ForceSendFields []string `json:"-"`
995
996
997
998
999 NullFields []string `json:"-"`
1000 }
1001
1002 func (s *InstanceMessage) MarshalJSON() ([]byte, error) {
1003 type NoMethod InstanceMessage
1004 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1005 }
1006
1007
1008 type ListInstancesResponse struct {
1009
1010
1011 NextPageToken string `json:"nextPageToken,omitempty"`
1012
1013
1014
1015
1016 Resources []*Instance `json:"resources,omitempty"`
1017
1018 Unreachable []string `json:"unreachable,omitempty"`
1019
1020
1021 googleapi.ServerResponse `json:"-"`
1022
1023
1024
1025
1026
1027 ForceSendFields []string `json:"-"`
1028
1029
1030
1031
1032 NullFields []string `json:"-"`
1033 }
1034
1035 func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
1036 type NoMethod ListInstancesResponse
1037 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1038 }
1039
1040
1041 type ListLocationsResponse struct {
1042
1043
1044 Locations []*Location `json:"locations,omitempty"`
1045
1046 NextPageToken string `json:"nextPageToken,omitempty"`
1047
1048
1049 googleapi.ServerResponse `json:"-"`
1050
1051
1052
1053
1054
1055 ForceSendFields []string `json:"-"`
1056
1057
1058
1059
1060 NullFields []string `json:"-"`
1061 }
1062
1063 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
1064 type NoMethod ListLocationsResponse
1065 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1066 }
1067
1068
1069 type ListOperationsResponse struct {
1070
1071 NextPageToken string `json:"nextPageToken,omitempty"`
1072
1073
1074 Operations []*Operation `json:"operations,omitempty"`
1075
1076
1077 googleapi.ServerResponse `json:"-"`
1078
1079
1080
1081
1082
1083 ForceSendFields []string `json:"-"`
1084
1085
1086
1087
1088 NullFields []string `json:"-"`
1089 }
1090
1091 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
1092 type NoMethod ListOperationsResponse
1093 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1094 }
1095
1096
1097 type Location struct {
1098
1099
1100 DisplayName string `json:"displayName,omitempty"`
1101
1102
1103 Labels map[string]string `json:"labels,omitempty"`
1104
1105 LocationId string `json:"locationId,omitempty"`
1106
1107
1108 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1109
1110
1111
1112 Name string `json:"name,omitempty"`
1113
1114
1115 googleapi.ServerResponse `json:"-"`
1116
1117
1118
1119
1120
1121 ForceSendFields []string `json:"-"`
1122
1123
1124
1125
1126 NullFields []string `json:"-"`
1127 }
1128
1129 func (s *Location) MarshalJSON() ([]byte, error) {
1130 type NoMethod Location
1131 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1132 }
1133
1134
1135 type LocationMetadata struct {
1136
1137
1138
1139 AvailableZones map[string]ZoneMetadata `json:"availableZones,omitempty"`
1140
1141
1142
1143
1144
1145 ForceSendFields []string `json:"-"`
1146
1147
1148
1149
1150 NullFields []string `json:"-"`
1151 }
1152
1153 func (s *LocationMetadata) MarshalJSON() ([]byte, error) {
1154 type NoMethod LocationMetadata
1155 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1156 }
1157
1158
1159 type MaintenancePolicy struct {
1160
1161 CreateTime string `json:"createTime,omitempty"`
1162
1163
1164 Description string `json:"description,omitempty"`
1165
1166
1167
1168 Labels map[string]string `json:"labels,omitempty"`
1169
1170
1171
1172
1173
1174
1175 Name string `json:"name,omitempty"`
1176
1177
1178
1179
1180
1181
1182
1183 State string `json:"state,omitempty"`
1184
1185 UpdatePolicy *UpdatePolicy `json:"updatePolicy,omitempty"`
1186
1187 UpdateTime string `json:"updateTime,omitempty"`
1188
1189
1190
1191
1192
1193 ForceSendFields []string `json:"-"`
1194
1195
1196
1197
1198 NullFields []string `json:"-"`
1199 }
1200
1201 func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
1202 type NoMethod MaintenancePolicy
1203 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1204 }
1205
1206
1207 type MaintenanceSchedule struct {
1208
1209
1210 EndTime string `json:"endTime,omitempty"`
1211
1212
1213 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"`
1214
1215
1216 StartTime string `json:"startTime,omitempty"`
1217
1218
1219
1220
1221
1222 ForceSendFields []string `json:"-"`
1223
1224
1225
1226
1227 NullFields []string `json:"-"`
1228 }
1229
1230 func (s *MaintenanceSchedule) MarshalJSON() ([]byte, error) {
1231 type NoMethod MaintenanceSchedule
1232 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1233 }
1234
1235
1236 type MaintenanceWindow struct {
1237
1238 DailyCycle *DailyCycle `json:"dailyCycle,omitempty"`
1239
1240 WeeklyCycle *WeeklyCycle `json:"weeklyCycle,omitempty"`
1241
1242
1243
1244
1245
1246 ForceSendFields []string `json:"-"`
1247
1248
1249
1250
1251 NullFields []string `json:"-"`
1252 }
1253
1254 func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
1255 type NoMethod MaintenanceWindow
1256 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1257 }
1258
1259 type MemcacheParameters struct {
1260
1261
1262
1263
1264
1265 Id string `json:"id,omitempty"`
1266
1267 Params map[string]string `json:"params,omitempty"`
1268
1269
1270
1271
1272
1273 ForceSendFields []string `json:"-"`
1274
1275
1276
1277
1278 NullFields []string `json:"-"`
1279 }
1280
1281 func (s *MemcacheParameters) MarshalJSON() ([]byte, error) {
1282 type NoMethod MemcacheParameters
1283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1284 }
1285
1286 type Node struct {
1287
1288
1289 Host string `json:"host,omitempty"`
1290
1291
1292 MemcacheFullVersion string `json:"memcacheFullVersion,omitempty"`
1293
1294
1295
1296
1297
1298
1299
1300
1301 MemcacheVersion string `json:"memcacheVersion,omitempty"`
1302
1303
1304 NodeId string `json:"nodeId,omitempty"`
1305
1306 Parameters *MemcacheParameters `json:"parameters,omitempty"`
1307
1308 Port int64 `json:"port,omitempty"`
1309
1310
1311
1312
1313
1314
1315
1316
1317 State string `json:"state,omitempty"`
1318
1319
1320 UpdateAvailable bool `json:"updateAvailable,omitempty"`
1321
1322 Zone string `json:"zone,omitempty"`
1323
1324
1325
1326
1327
1328 ForceSendFields []string `json:"-"`
1329
1330
1331
1332
1333 NullFields []string `json:"-"`
1334 }
1335
1336 func (s *Node) MarshalJSON() ([]byte, error) {
1337 type NoMethod Node
1338 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1339 }
1340
1341
1342 type NodeConfig struct {
1343
1344 CpuCount int64 `json:"cpuCount,omitempty"`
1345
1346 MemorySizeMb int64 `json:"memorySizeMb,omitempty"`
1347
1348
1349
1350
1351
1352 ForceSendFields []string `json:"-"`
1353
1354
1355
1356
1357 NullFields []string `json:"-"`
1358 }
1359
1360 func (s *NodeConfig) MarshalJSON() ([]byte, error) {
1361 type NoMethod NodeConfig
1362 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1363 }
1364
1365
1366
1367 type Operation struct {
1368
1369
1370
1371 Done bool `json:"done,omitempty"`
1372
1373 Error *Status `json:"error,omitempty"`
1374
1375
1376
1377
1378 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1379
1380
1381
1382 Name string `json:"name,omitempty"`
1383
1384
1385
1386
1387
1388
1389
1390 Response googleapi.RawMessage `json:"response,omitempty"`
1391
1392
1393 googleapi.ServerResponse `json:"-"`
1394
1395
1396
1397
1398
1399 ForceSendFields []string `json:"-"`
1400
1401
1402
1403
1404 NullFields []string `json:"-"`
1405 }
1406
1407 func (s *Operation) MarshalJSON() ([]byte, error) {
1408 type NoMethod Operation
1409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1410 }
1411
1412
1413 type OperationMetadata struct {
1414
1415 ApiVersion string `json:"apiVersion,omitempty"`
1416
1417
1418
1419
1420 CancelRequested bool `json:"cancelRequested,omitempty"`
1421
1422 CreateTime string `json:"createTime,omitempty"`
1423
1424 EndTime string `json:"endTime,omitempty"`
1425
1426 StatusDetail string `json:"statusDetail,omitempty"`
1427
1428
1429 Target string `json:"target,omitempty"`
1430
1431 Verb string `json:"verb,omitempty"`
1432
1433
1434
1435
1436
1437 ForceSendFields []string `json:"-"`
1438
1439
1440
1441
1442 NullFields []string `json:"-"`
1443 }
1444
1445 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1446 type NoMethod OperationMetadata
1447 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1448 }
1449
1450
1451 type RescheduleMaintenanceRequest struct {
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462 RescheduleType string `json:"rescheduleType,omitempty"`
1463
1464
1465
1466 ScheduleTime string `json:"scheduleTime,omitempty"`
1467
1468
1469
1470
1471
1472 ForceSendFields []string `json:"-"`
1473
1474
1475
1476
1477 NullFields []string `json:"-"`
1478 }
1479
1480 func (s *RescheduleMaintenanceRequest) MarshalJSON() ([]byte, error) {
1481 type NoMethod RescheduleMaintenanceRequest
1482 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1483 }
1484
1485
1486 type Schedule struct {
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498 Day string `json:"day,omitempty"`
1499
1500 Duration string `json:"duration,omitempty"`
1501
1502 StartTime *TimeOfDay `json:"startTime,omitempty"`
1503
1504
1505
1506
1507
1508 ForceSendFields []string `json:"-"`
1509
1510
1511
1512
1513 NullFields []string `json:"-"`
1514 }
1515
1516 func (s *Schedule) MarshalJSON() ([]byte, error) {
1517 type NoMethod Schedule
1518 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1519 }
1520
1521
1522
1523
1524
1525
1526
1527 type Status struct {
1528
1529 Code int64 `json:"code,omitempty"`
1530
1531
1532 Details []googleapi.RawMessage `json:"details,omitempty"`
1533
1534
1535
1536 Message string `json:"message,omitempty"`
1537
1538
1539
1540
1541
1542 ForceSendFields []string `json:"-"`
1543
1544
1545
1546
1547 NullFields []string `json:"-"`
1548 }
1549
1550 func (s *Status) MarshalJSON() ([]byte, error) {
1551 type NoMethod Status
1552 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1553 }
1554
1555
1556
1557
1558 type TimeOfDay struct {
1559
1560
1561
1562 Hours int64 `json:"hours,omitempty"`
1563
1564 Minutes int64 `json:"minutes,omitempty"`
1565
1566 Nanos int64 `json:"nanos,omitempty"`
1567
1568
1569 Seconds int64 `json:"seconds,omitempty"`
1570
1571
1572
1573
1574
1575 ForceSendFields []string `json:"-"`
1576
1577
1578
1579
1580 NullFields []string `json:"-"`
1581 }
1582
1583 func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
1584 type NoMethod TimeOfDay
1585 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1586 }
1587
1588
1589 type UpdateParametersRequest struct {
1590
1591 Parameters *MemcacheParameters `json:"parameters,omitempty"`
1592
1593 UpdateMask string `json:"updateMask,omitempty"`
1594
1595
1596
1597
1598
1599 ForceSendFields []string `json:"-"`
1600
1601
1602
1603
1604 NullFields []string `json:"-"`
1605 }
1606
1607 func (s *UpdateParametersRequest) MarshalJSON() ([]byte, error) {
1608 type NoMethod UpdateParametersRequest
1609 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1610 }
1611
1612
1613 type UpdatePolicy struct {
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633 Channel string `json:"channel,omitempty"`
1634
1635
1636
1637
1638 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"`
1639
1640
1641 Window *MaintenanceWindow `json:"window,omitempty"`
1642
1643
1644
1645
1646
1647 ForceSendFields []string `json:"-"`
1648
1649
1650
1651
1652 NullFields []string `json:"-"`
1653 }
1654
1655 func (s *UpdatePolicy) MarshalJSON() ([]byte, error) {
1656 type NoMethod UpdatePolicy
1657 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1658 }
1659
1660
1661 type WeeklyCycle struct {
1662
1663 Schedule []*Schedule `json:"schedule,omitempty"`
1664
1665
1666
1667
1668
1669 ForceSendFields []string `json:"-"`
1670
1671
1672
1673
1674 NullFields []string `json:"-"`
1675 }
1676
1677 func (s *WeeklyCycle) MarshalJSON() ([]byte, error) {
1678 type NoMethod WeeklyCycle
1679 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1680 }
1681
1682
1683 type WeeklyMaintenanceWindow struct {
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696 Day string `json:"day,omitempty"`
1697
1698 Duration string `json:"duration,omitempty"`
1699
1700 StartTime *TimeOfDay `json:"startTime,omitempty"`
1701
1702
1703
1704
1705
1706 ForceSendFields []string `json:"-"`
1707
1708
1709
1710
1711 NullFields []string `json:"-"`
1712 }
1713
1714 func (s *WeeklyMaintenanceWindow) MarshalJSON() ([]byte, error) {
1715 type NoMethod WeeklyMaintenanceWindow
1716 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1717 }
1718
1719 type ZoneMetadata struct {
1720 }
1721
1722 type ProjectsLocationsGetCall struct {
1723 s *Service
1724 name string
1725 urlParams_ gensupport.URLParams
1726 ifNoneMatch_ string
1727 ctx_ context.Context
1728 header_ http.Header
1729 }
1730
1731
1732
1733
1734 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1735 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1736 c.name = name
1737 return c
1738 }
1739
1740
1741
1742
1743 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1744 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1745 return c
1746 }
1747
1748
1749
1750
1751 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1752 c.ifNoneMatch_ = entityTag
1753 return c
1754 }
1755
1756
1757 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1758 c.ctx_ = ctx
1759 return c
1760 }
1761
1762
1763
1764 func (c *ProjectsLocationsGetCall) Header() http.Header {
1765 if c.header_ == nil {
1766 c.header_ = make(http.Header)
1767 }
1768 return c.header_
1769 }
1770
1771 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1772 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1773 if c.ifNoneMatch_ != "" {
1774 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1775 }
1776 var body io.Reader = nil
1777 c.urlParams_.Set("alt", alt)
1778 c.urlParams_.Set("prettyPrint", "false")
1779 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
1780 urls += "?" + c.urlParams_.Encode()
1781 req, err := http.NewRequest("GET", urls, body)
1782 if err != nil {
1783 return nil, err
1784 }
1785 req.Header = reqHeaders
1786 googleapi.Expand(req.URL, map[string]string{
1787 "name": c.name,
1788 })
1789 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1790 }
1791
1792
1793
1794
1795
1796
1797 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1798 gensupport.SetOptions(c.urlParams_, opts...)
1799 res, err := c.doRequest("json")
1800 if res != nil && res.StatusCode == http.StatusNotModified {
1801 if res.Body != nil {
1802 res.Body.Close()
1803 }
1804 return nil, gensupport.WrapError(&googleapi.Error{
1805 Code: res.StatusCode,
1806 Header: res.Header,
1807 })
1808 }
1809 if err != nil {
1810 return nil, err
1811 }
1812 defer googleapi.CloseBody(res)
1813 if err := googleapi.CheckResponse(res); err != nil {
1814 return nil, gensupport.WrapError(err)
1815 }
1816 ret := &Location{
1817 ServerResponse: googleapi.ServerResponse{
1818 Header: res.Header,
1819 HTTPStatusCode: res.StatusCode,
1820 },
1821 }
1822 target := &ret
1823 if err := gensupport.DecodeResponse(target, res); err != nil {
1824 return nil, err
1825 }
1826 return ret, nil
1827 }
1828
1829 type ProjectsLocationsListCall struct {
1830 s *Service
1831 name string
1832 urlParams_ gensupport.URLParams
1833 ifNoneMatch_ string
1834 ctx_ context.Context
1835 header_ http.Header
1836 }
1837
1838
1839
1840
1841 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1842 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1843 c.name = name
1844 return c
1845 }
1846
1847
1848
1849
1850
1851 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1852 c.urlParams_.Set("filter", filter)
1853 return c
1854 }
1855
1856
1857
1858 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1859 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1860 return c
1861 }
1862
1863
1864
1865
1866 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1867 c.urlParams_.Set("pageToken", pageToken)
1868 return c
1869 }
1870
1871
1872
1873
1874 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1875 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1876 return c
1877 }
1878
1879
1880
1881
1882 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1883 c.ifNoneMatch_ = entityTag
1884 return c
1885 }
1886
1887
1888 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1889 c.ctx_ = ctx
1890 return c
1891 }
1892
1893
1894
1895 func (c *ProjectsLocationsListCall) Header() http.Header {
1896 if c.header_ == nil {
1897 c.header_ = make(http.Header)
1898 }
1899 return c.header_
1900 }
1901
1902 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1903 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1904 if c.ifNoneMatch_ != "" {
1905 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1906 }
1907 var body io.Reader = nil
1908 c.urlParams_.Set("alt", alt)
1909 c.urlParams_.Set("prettyPrint", "false")
1910 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/locations")
1911 urls += "?" + c.urlParams_.Encode()
1912 req, err := http.NewRequest("GET", urls, body)
1913 if err != nil {
1914 return nil, err
1915 }
1916 req.Header = reqHeaders
1917 googleapi.Expand(req.URL, map[string]string{
1918 "name": c.name,
1919 })
1920 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1921 }
1922
1923
1924
1925
1926
1927
1928
1929 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1930 gensupport.SetOptions(c.urlParams_, opts...)
1931 res, err := c.doRequest("json")
1932 if res != nil && res.StatusCode == http.StatusNotModified {
1933 if res.Body != nil {
1934 res.Body.Close()
1935 }
1936 return nil, gensupport.WrapError(&googleapi.Error{
1937 Code: res.StatusCode,
1938 Header: res.Header,
1939 })
1940 }
1941 if err != nil {
1942 return nil, err
1943 }
1944 defer googleapi.CloseBody(res)
1945 if err := googleapi.CheckResponse(res); err != nil {
1946 return nil, gensupport.WrapError(err)
1947 }
1948 ret := &ListLocationsResponse{
1949 ServerResponse: googleapi.ServerResponse{
1950 Header: res.Header,
1951 HTTPStatusCode: res.StatusCode,
1952 },
1953 }
1954 target := &ret
1955 if err := gensupport.DecodeResponse(target, res); err != nil {
1956 return nil, err
1957 }
1958 return ret, nil
1959 }
1960
1961
1962
1963
1964 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1965 c.ctx_ = ctx
1966 defer c.PageToken(c.urlParams_.Get("pageToken"))
1967 for {
1968 x, err := c.Do()
1969 if err != nil {
1970 return err
1971 }
1972 if err := f(x); err != nil {
1973 return err
1974 }
1975 if x.NextPageToken == "" {
1976 return nil
1977 }
1978 c.PageToken(x.NextPageToken)
1979 }
1980 }
1981
1982 type ProjectsLocationsInstancesApplyParametersCall struct {
1983 s *Service
1984 name string
1985 applyparametersrequest *ApplyParametersRequest
1986 urlParams_ gensupport.URLParams
1987 ctx_ context.Context
1988 header_ http.Header
1989 }
1990
1991
1992
1993
1994
1995
1996
1997 func (r *ProjectsLocationsInstancesService) ApplyParameters(name string, applyparametersrequest *ApplyParametersRequest) *ProjectsLocationsInstancesApplyParametersCall {
1998 c := &ProjectsLocationsInstancesApplyParametersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1999 c.name = name
2000 c.applyparametersrequest = applyparametersrequest
2001 return c
2002 }
2003
2004
2005
2006
2007 func (c *ProjectsLocationsInstancesApplyParametersCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesApplyParametersCall {
2008 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2009 return c
2010 }
2011
2012
2013 func (c *ProjectsLocationsInstancesApplyParametersCall) Context(ctx context.Context) *ProjectsLocationsInstancesApplyParametersCall {
2014 c.ctx_ = ctx
2015 return c
2016 }
2017
2018
2019
2020 func (c *ProjectsLocationsInstancesApplyParametersCall) Header() http.Header {
2021 if c.header_ == nil {
2022 c.header_ = make(http.Header)
2023 }
2024 return c.header_
2025 }
2026
2027 func (c *ProjectsLocationsInstancesApplyParametersCall) doRequest(alt string) (*http.Response, error) {
2028 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2029 var body io.Reader = nil
2030 body, err := googleapi.WithoutDataWrapper.JSONReader(c.applyparametersrequest)
2031 if err != nil {
2032 return nil, err
2033 }
2034 c.urlParams_.Set("alt", alt)
2035 c.urlParams_.Set("prettyPrint", "false")
2036 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:applyParameters")
2037 urls += "?" + c.urlParams_.Encode()
2038 req, err := http.NewRequest("POST", urls, body)
2039 if err != nil {
2040 return nil, err
2041 }
2042 req.Header = reqHeaders
2043 googleapi.Expand(req.URL, map[string]string{
2044 "name": c.name,
2045 })
2046 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2047 }
2048
2049
2050
2051
2052
2053
2054 func (c *ProjectsLocationsInstancesApplyParametersCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2055 gensupport.SetOptions(c.urlParams_, opts...)
2056 res, err := c.doRequest("json")
2057 if res != nil && res.StatusCode == http.StatusNotModified {
2058 if res.Body != nil {
2059 res.Body.Close()
2060 }
2061 return nil, gensupport.WrapError(&googleapi.Error{
2062 Code: res.StatusCode,
2063 Header: res.Header,
2064 })
2065 }
2066 if err != nil {
2067 return nil, err
2068 }
2069 defer googleapi.CloseBody(res)
2070 if err := googleapi.CheckResponse(res); err != nil {
2071 return nil, gensupport.WrapError(err)
2072 }
2073 ret := &Operation{
2074 ServerResponse: googleapi.ServerResponse{
2075 Header: res.Header,
2076 HTTPStatusCode: res.StatusCode,
2077 },
2078 }
2079 target := &ret
2080 if err := gensupport.DecodeResponse(target, res); err != nil {
2081 return nil, err
2082 }
2083 return ret, nil
2084 }
2085
2086 type ProjectsLocationsInstancesApplySoftwareUpdateCall struct {
2087 s *Service
2088 instance string
2089 applysoftwareupdaterequest *ApplySoftwareUpdateRequest
2090 urlParams_ gensupport.URLParams
2091 ctx_ context.Context
2092 header_ http.Header
2093 }
2094
2095
2096
2097
2098
2099 func (r *ProjectsLocationsInstancesService) ApplySoftwareUpdate(instance string, applysoftwareupdaterequest *ApplySoftwareUpdateRequest) *ProjectsLocationsInstancesApplySoftwareUpdateCall {
2100 c := &ProjectsLocationsInstancesApplySoftwareUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2101 c.instance = instance
2102 c.applysoftwareupdaterequest = applysoftwareupdaterequest
2103 return c
2104 }
2105
2106
2107
2108
2109 func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesApplySoftwareUpdateCall {
2110 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2111 return c
2112 }
2113
2114
2115 func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) Context(ctx context.Context) *ProjectsLocationsInstancesApplySoftwareUpdateCall {
2116 c.ctx_ = ctx
2117 return c
2118 }
2119
2120
2121
2122 func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) Header() http.Header {
2123 if c.header_ == nil {
2124 c.header_ = make(http.Header)
2125 }
2126 return c.header_
2127 }
2128
2129 func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) doRequest(alt string) (*http.Response, error) {
2130 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2131 var body io.Reader = nil
2132 body, err := googleapi.WithoutDataWrapper.JSONReader(c.applysoftwareupdaterequest)
2133 if err != nil {
2134 return nil, err
2135 }
2136 c.urlParams_.Set("alt", alt)
2137 c.urlParams_.Set("prettyPrint", "false")
2138 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+instance}:applySoftwareUpdate")
2139 urls += "?" + c.urlParams_.Encode()
2140 req, err := http.NewRequest("POST", urls, body)
2141 if err != nil {
2142 return nil, err
2143 }
2144 req.Header = reqHeaders
2145 googleapi.Expand(req.URL, map[string]string{
2146 "instance": c.instance,
2147 })
2148 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2149 }
2150
2151
2152
2153
2154
2155
2156 func (c *ProjectsLocationsInstancesApplySoftwareUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2157 gensupport.SetOptions(c.urlParams_, opts...)
2158 res, err := c.doRequest("json")
2159 if res != nil && res.StatusCode == http.StatusNotModified {
2160 if res.Body != nil {
2161 res.Body.Close()
2162 }
2163 return nil, gensupport.WrapError(&googleapi.Error{
2164 Code: res.StatusCode,
2165 Header: res.Header,
2166 })
2167 }
2168 if err != nil {
2169 return nil, err
2170 }
2171 defer googleapi.CloseBody(res)
2172 if err := googleapi.CheckResponse(res); err != nil {
2173 return nil, gensupport.WrapError(err)
2174 }
2175 ret := &Operation{
2176 ServerResponse: googleapi.ServerResponse{
2177 Header: res.Header,
2178 HTTPStatusCode: res.StatusCode,
2179 },
2180 }
2181 target := &ret
2182 if err := gensupport.DecodeResponse(target, res); err != nil {
2183 return nil, err
2184 }
2185 return ret, nil
2186 }
2187
2188 type ProjectsLocationsInstancesCreateCall struct {
2189 s *Service
2190 parent string
2191 instance *Instance
2192 urlParams_ gensupport.URLParams
2193 ctx_ context.Context
2194 header_ http.Header
2195 }
2196
2197
2198
2199
2200
2201
2202 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
2203 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2204 c.parent = parent
2205 c.instance = instance
2206 return c
2207 }
2208
2209
2210
2211
2212
2213
2214
2215 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
2216 c.urlParams_.Set("instanceId", instanceId)
2217 return c
2218 }
2219
2220
2221
2222
2223 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
2224 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2225 return c
2226 }
2227
2228
2229 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
2230 c.ctx_ = ctx
2231 return c
2232 }
2233
2234
2235
2236 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
2237 if c.header_ == nil {
2238 c.header_ = make(http.Header)
2239 }
2240 return c.header_
2241 }
2242
2243 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
2244 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2245 var body io.Reader = nil
2246 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
2247 if err != nil {
2248 return nil, err
2249 }
2250 c.urlParams_.Set("alt", alt)
2251 c.urlParams_.Set("prettyPrint", "false")
2252 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/instances")
2253 urls += "?" + c.urlParams_.Encode()
2254 req, err := http.NewRequest("POST", urls, body)
2255 if err != nil {
2256 return nil, err
2257 }
2258 req.Header = reqHeaders
2259 googleapi.Expand(req.URL, map[string]string{
2260 "parent": c.parent,
2261 })
2262 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2263 }
2264
2265
2266
2267
2268
2269
2270 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2271 gensupport.SetOptions(c.urlParams_, opts...)
2272 res, err := c.doRequest("json")
2273 if res != nil && res.StatusCode == http.StatusNotModified {
2274 if res.Body != nil {
2275 res.Body.Close()
2276 }
2277 return nil, gensupport.WrapError(&googleapi.Error{
2278 Code: res.StatusCode,
2279 Header: res.Header,
2280 })
2281 }
2282 if err != nil {
2283 return nil, err
2284 }
2285 defer googleapi.CloseBody(res)
2286 if err := googleapi.CheckResponse(res); err != nil {
2287 return nil, gensupport.WrapError(err)
2288 }
2289 ret := &Operation{
2290 ServerResponse: googleapi.ServerResponse{
2291 Header: res.Header,
2292 HTTPStatusCode: res.StatusCode,
2293 },
2294 }
2295 target := &ret
2296 if err := gensupport.DecodeResponse(target, res); err != nil {
2297 return nil, err
2298 }
2299 return ret, nil
2300 }
2301
2302 type ProjectsLocationsInstancesDeleteCall struct {
2303 s *Service
2304 name string
2305 urlParams_ gensupport.URLParams
2306 ctx_ context.Context
2307 header_ http.Header
2308 }
2309
2310
2311
2312
2313
2314
2315 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
2316 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2317 c.name = name
2318 return c
2319 }
2320
2321
2322
2323
2324 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
2325 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2326 return c
2327 }
2328
2329
2330 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
2331 c.ctx_ = ctx
2332 return c
2333 }
2334
2335
2336
2337 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
2338 if c.header_ == nil {
2339 c.header_ = make(http.Header)
2340 }
2341 return c.header_
2342 }
2343
2344 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
2345 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2346 var body io.Reader = nil
2347 c.urlParams_.Set("alt", alt)
2348 c.urlParams_.Set("prettyPrint", "false")
2349 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
2350 urls += "?" + c.urlParams_.Encode()
2351 req, err := http.NewRequest("DELETE", urls, body)
2352 if err != nil {
2353 return nil, err
2354 }
2355 req.Header = reqHeaders
2356 googleapi.Expand(req.URL, map[string]string{
2357 "name": c.name,
2358 })
2359 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2360 }
2361
2362
2363
2364
2365
2366
2367 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2368 gensupport.SetOptions(c.urlParams_, opts...)
2369 res, err := c.doRequest("json")
2370 if res != nil && res.StatusCode == http.StatusNotModified {
2371 if res.Body != nil {
2372 res.Body.Close()
2373 }
2374 return nil, gensupport.WrapError(&googleapi.Error{
2375 Code: res.StatusCode,
2376 Header: res.Header,
2377 })
2378 }
2379 if err != nil {
2380 return nil, err
2381 }
2382 defer googleapi.CloseBody(res)
2383 if err := googleapi.CheckResponse(res); err != nil {
2384 return nil, gensupport.WrapError(err)
2385 }
2386 ret := &Operation{
2387 ServerResponse: googleapi.ServerResponse{
2388 Header: res.Header,
2389 HTTPStatusCode: res.StatusCode,
2390 },
2391 }
2392 target := &ret
2393 if err := gensupport.DecodeResponse(target, res); err != nil {
2394 return nil, err
2395 }
2396 return ret, nil
2397 }
2398
2399 type ProjectsLocationsInstancesGetCall struct {
2400 s *Service
2401 name string
2402 urlParams_ gensupport.URLParams
2403 ifNoneMatch_ string
2404 ctx_ context.Context
2405 header_ http.Header
2406 }
2407
2408
2409
2410
2411
2412
2413 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
2414 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2415 c.name = name
2416 return c
2417 }
2418
2419
2420
2421
2422 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
2423 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2424 return c
2425 }
2426
2427
2428
2429
2430 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
2431 c.ifNoneMatch_ = entityTag
2432 return c
2433 }
2434
2435
2436 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
2437 c.ctx_ = ctx
2438 return c
2439 }
2440
2441
2442
2443 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
2444 if c.header_ == nil {
2445 c.header_ = make(http.Header)
2446 }
2447 return c.header_
2448 }
2449
2450 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
2451 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2452 if c.ifNoneMatch_ != "" {
2453 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2454 }
2455 var body io.Reader = nil
2456 c.urlParams_.Set("alt", alt)
2457 c.urlParams_.Set("prettyPrint", "false")
2458 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
2459 urls += "?" + c.urlParams_.Encode()
2460 req, err := http.NewRequest("GET", urls, body)
2461 if err != nil {
2462 return nil, err
2463 }
2464 req.Header = reqHeaders
2465 googleapi.Expand(req.URL, map[string]string{
2466 "name": c.name,
2467 })
2468 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2469 }
2470
2471
2472
2473
2474
2475
2476 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
2477 gensupport.SetOptions(c.urlParams_, opts...)
2478 res, err := c.doRequest("json")
2479 if res != nil && res.StatusCode == http.StatusNotModified {
2480 if res.Body != nil {
2481 res.Body.Close()
2482 }
2483 return nil, gensupport.WrapError(&googleapi.Error{
2484 Code: res.StatusCode,
2485 Header: res.Header,
2486 })
2487 }
2488 if err != nil {
2489 return nil, err
2490 }
2491 defer googleapi.CloseBody(res)
2492 if err := googleapi.CheckResponse(res); err != nil {
2493 return nil, gensupport.WrapError(err)
2494 }
2495 ret := &Instance{
2496 ServerResponse: googleapi.ServerResponse{
2497 Header: res.Header,
2498 HTTPStatusCode: res.StatusCode,
2499 },
2500 }
2501 target := &ret
2502 if err := gensupport.DecodeResponse(target, res); err != nil {
2503 return nil, err
2504 }
2505 return ret, nil
2506 }
2507
2508 type ProjectsLocationsInstancesListCall struct {
2509 s *Service
2510 parent string
2511 urlParams_ gensupport.URLParams
2512 ifNoneMatch_ string
2513 ctx_ context.Context
2514 header_ http.Header
2515 }
2516
2517
2518
2519
2520
2521
2522 func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
2523 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2524 c.parent = parent
2525 return c
2526 }
2527
2528
2529
2530
2531 func (c *ProjectsLocationsInstancesListCall) Filter(filter string) *ProjectsLocationsInstancesListCall {
2532 c.urlParams_.Set("filter", filter)
2533 return c
2534 }
2535
2536
2537
2538 func (c *ProjectsLocationsInstancesListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesListCall {
2539 c.urlParams_.Set("orderBy", orderBy)
2540 return c
2541 }
2542
2543
2544
2545
2546
2547
2548 func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
2549 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2550 return c
2551 }
2552
2553
2554
2555 func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
2556 c.urlParams_.Set("pageToken", pageToken)
2557 return c
2558 }
2559
2560
2561
2562
2563 func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
2564 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2565 return c
2566 }
2567
2568
2569
2570
2571 func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
2572 c.ifNoneMatch_ = entityTag
2573 return c
2574 }
2575
2576
2577 func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
2578 c.ctx_ = ctx
2579 return c
2580 }
2581
2582
2583
2584 func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
2585 if c.header_ == nil {
2586 c.header_ = make(http.Header)
2587 }
2588 return c.header_
2589 }
2590
2591 func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
2592 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2593 if c.ifNoneMatch_ != "" {
2594 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2595 }
2596 var body io.Reader = nil
2597 c.urlParams_.Set("alt", alt)
2598 c.urlParams_.Set("prettyPrint", "false")
2599 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/instances")
2600 urls += "?" + c.urlParams_.Encode()
2601 req, err := http.NewRequest("GET", urls, body)
2602 if err != nil {
2603 return nil, err
2604 }
2605 req.Header = reqHeaders
2606 googleapi.Expand(req.URL, map[string]string{
2607 "parent": c.parent,
2608 })
2609 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2610 }
2611
2612
2613
2614
2615
2616
2617
2618 func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
2619 gensupport.SetOptions(c.urlParams_, opts...)
2620 res, err := c.doRequest("json")
2621 if res != nil && res.StatusCode == http.StatusNotModified {
2622 if res.Body != nil {
2623 res.Body.Close()
2624 }
2625 return nil, gensupport.WrapError(&googleapi.Error{
2626 Code: res.StatusCode,
2627 Header: res.Header,
2628 })
2629 }
2630 if err != nil {
2631 return nil, err
2632 }
2633 defer googleapi.CloseBody(res)
2634 if err := googleapi.CheckResponse(res); err != nil {
2635 return nil, gensupport.WrapError(err)
2636 }
2637 ret := &ListInstancesResponse{
2638 ServerResponse: googleapi.ServerResponse{
2639 Header: res.Header,
2640 HTTPStatusCode: res.StatusCode,
2641 },
2642 }
2643 target := &ret
2644 if err := gensupport.DecodeResponse(target, res); err != nil {
2645 return nil, err
2646 }
2647 return ret, nil
2648 }
2649
2650
2651
2652
2653 func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
2654 c.ctx_ = ctx
2655 defer c.PageToken(c.urlParams_.Get("pageToken"))
2656 for {
2657 x, err := c.Do()
2658 if err != nil {
2659 return err
2660 }
2661 if err := f(x); err != nil {
2662 return err
2663 }
2664 if x.NextPageToken == "" {
2665 return nil
2666 }
2667 c.PageToken(x.NextPageToken)
2668 }
2669 }
2670
2671 type ProjectsLocationsInstancesPatchCall struct {
2672 s *Service
2673 name string
2674 instance *Instance
2675 urlParams_ gensupport.URLParams
2676 ctx_ context.Context
2677 header_ http.Header
2678 }
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689 func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
2690 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2691 c.name = name
2692 c.instance = instance
2693 return c
2694 }
2695
2696
2697
2698 func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
2699 c.urlParams_.Set("updateMask", updateMask)
2700 return c
2701 }
2702
2703
2704
2705
2706 func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
2707 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2708 return c
2709 }
2710
2711
2712 func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
2713 c.ctx_ = ctx
2714 return c
2715 }
2716
2717
2718
2719 func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
2720 if c.header_ == nil {
2721 c.header_ = make(http.Header)
2722 }
2723 return c.header_
2724 }
2725
2726 func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
2727 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2728 var body io.Reader = nil
2729 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
2730 if err != nil {
2731 return nil, err
2732 }
2733 c.urlParams_.Set("alt", alt)
2734 c.urlParams_.Set("prettyPrint", "false")
2735 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
2736 urls += "?" + c.urlParams_.Encode()
2737 req, err := http.NewRequest("PATCH", urls, body)
2738 if err != nil {
2739 return nil, err
2740 }
2741 req.Header = reqHeaders
2742 googleapi.Expand(req.URL, map[string]string{
2743 "name": c.name,
2744 })
2745 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2746 }
2747
2748
2749
2750
2751
2752
2753 func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2754 gensupport.SetOptions(c.urlParams_, opts...)
2755 res, err := c.doRequest("json")
2756 if res != nil && res.StatusCode == http.StatusNotModified {
2757 if res.Body != nil {
2758 res.Body.Close()
2759 }
2760 return nil, gensupport.WrapError(&googleapi.Error{
2761 Code: res.StatusCode,
2762 Header: res.Header,
2763 })
2764 }
2765 if err != nil {
2766 return nil, err
2767 }
2768 defer googleapi.CloseBody(res)
2769 if err := googleapi.CheckResponse(res); err != nil {
2770 return nil, gensupport.WrapError(err)
2771 }
2772 ret := &Operation{
2773 ServerResponse: googleapi.ServerResponse{
2774 Header: res.Header,
2775 HTTPStatusCode: res.StatusCode,
2776 },
2777 }
2778 target := &ret
2779 if err := gensupport.DecodeResponse(target, res); err != nil {
2780 return nil, err
2781 }
2782 return ret, nil
2783 }
2784
2785 type ProjectsLocationsInstancesRescheduleMaintenanceCall struct {
2786 s *Service
2787 instance string
2788 reschedulemaintenancerequest *RescheduleMaintenanceRequest
2789 urlParams_ gensupport.URLParams
2790 ctx_ context.Context
2791 header_ http.Header
2792 }
2793
2794
2795
2796
2797
2798
2799
2800 func (r *ProjectsLocationsInstancesService) RescheduleMaintenance(instance string, reschedulemaintenancerequest *RescheduleMaintenanceRequest) *ProjectsLocationsInstancesRescheduleMaintenanceCall {
2801 c := &ProjectsLocationsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2802 c.instance = instance
2803 c.reschedulemaintenancerequest = reschedulemaintenancerequest
2804 return c
2805 }
2806
2807
2808
2809
2810 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRescheduleMaintenanceCall {
2811 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2812 return c
2813 }
2814
2815
2816 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsLocationsInstancesRescheduleMaintenanceCall {
2817 c.ctx_ = ctx
2818 return c
2819 }
2820
2821
2822
2823 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Header {
2824 if c.header_ == nil {
2825 c.header_ = make(http.Header)
2826 }
2827 return c.header_
2828 }
2829
2830 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) {
2831 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2832 var body io.Reader = nil
2833 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest)
2834 if err != nil {
2835 return nil, err
2836 }
2837 c.urlParams_.Set("alt", alt)
2838 c.urlParams_.Set("prettyPrint", "false")
2839 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+instance}:rescheduleMaintenance")
2840 urls += "?" + c.urlParams_.Encode()
2841 req, err := http.NewRequest("POST", urls, body)
2842 if err != nil {
2843 return nil, err
2844 }
2845 req.Header = reqHeaders
2846 googleapi.Expand(req.URL, map[string]string{
2847 "instance": c.instance,
2848 })
2849 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2850 }
2851
2852
2853
2854
2855
2856
2857 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2858 gensupport.SetOptions(c.urlParams_, opts...)
2859 res, err := c.doRequest("json")
2860 if res != nil && res.StatusCode == http.StatusNotModified {
2861 if res.Body != nil {
2862 res.Body.Close()
2863 }
2864 return nil, gensupport.WrapError(&googleapi.Error{
2865 Code: res.StatusCode,
2866 Header: res.Header,
2867 })
2868 }
2869 if err != nil {
2870 return nil, err
2871 }
2872 defer googleapi.CloseBody(res)
2873 if err := googleapi.CheckResponse(res); err != nil {
2874 return nil, gensupport.WrapError(err)
2875 }
2876 ret := &Operation{
2877 ServerResponse: googleapi.ServerResponse{
2878 Header: res.Header,
2879 HTTPStatusCode: res.StatusCode,
2880 },
2881 }
2882 target := &ret
2883 if err := gensupport.DecodeResponse(target, res); err != nil {
2884 return nil, err
2885 }
2886 return ret, nil
2887 }
2888
2889 type ProjectsLocationsInstancesUpdateParametersCall struct {
2890 s *Service
2891 name string
2892 updateparametersrequest *UpdateParametersRequest
2893 urlParams_ gensupport.URLParams
2894 ctx_ context.Context
2895 header_ http.Header
2896 }
2897
2898
2899
2900
2901
2902
2903
2904
2905 func (r *ProjectsLocationsInstancesService) UpdateParameters(name string, updateparametersrequest *UpdateParametersRequest) *ProjectsLocationsInstancesUpdateParametersCall {
2906 c := &ProjectsLocationsInstancesUpdateParametersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2907 c.name = name
2908 c.updateparametersrequest = updateparametersrequest
2909 return c
2910 }
2911
2912
2913
2914
2915 func (c *ProjectsLocationsInstancesUpdateParametersCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpdateParametersCall {
2916 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2917 return c
2918 }
2919
2920
2921 func (c *ProjectsLocationsInstancesUpdateParametersCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpdateParametersCall {
2922 c.ctx_ = ctx
2923 return c
2924 }
2925
2926
2927
2928 func (c *ProjectsLocationsInstancesUpdateParametersCall) Header() http.Header {
2929 if c.header_ == nil {
2930 c.header_ = make(http.Header)
2931 }
2932 return c.header_
2933 }
2934
2935 func (c *ProjectsLocationsInstancesUpdateParametersCall) doRequest(alt string) (*http.Response, error) {
2936 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2937 var body io.Reader = nil
2938 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateparametersrequest)
2939 if err != nil {
2940 return nil, err
2941 }
2942 c.urlParams_.Set("alt", alt)
2943 c.urlParams_.Set("prettyPrint", "false")
2944 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:updateParameters")
2945 urls += "?" + c.urlParams_.Encode()
2946 req, err := http.NewRequest("PATCH", urls, body)
2947 if err != nil {
2948 return nil, err
2949 }
2950 req.Header = reqHeaders
2951 googleapi.Expand(req.URL, map[string]string{
2952 "name": c.name,
2953 })
2954 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2955 }
2956
2957
2958
2959
2960
2961
2962 func (c *ProjectsLocationsInstancesUpdateParametersCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2963 gensupport.SetOptions(c.urlParams_, opts...)
2964 res, err := c.doRequest("json")
2965 if res != nil && res.StatusCode == http.StatusNotModified {
2966 if res.Body != nil {
2967 res.Body.Close()
2968 }
2969 return nil, gensupport.WrapError(&googleapi.Error{
2970 Code: res.StatusCode,
2971 Header: res.Header,
2972 })
2973 }
2974 if err != nil {
2975 return nil, err
2976 }
2977 defer googleapi.CloseBody(res)
2978 if err := googleapi.CheckResponse(res); err != nil {
2979 return nil, gensupport.WrapError(err)
2980 }
2981 ret := &Operation{
2982 ServerResponse: googleapi.ServerResponse{
2983 Header: res.Header,
2984 HTTPStatusCode: res.StatusCode,
2985 },
2986 }
2987 target := &ret
2988 if err := gensupport.DecodeResponse(target, res); err != nil {
2989 return nil, err
2990 }
2991 return ret, nil
2992 }
2993
2994 type ProjectsLocationsInstancesUpgradeCall struct {
2995 s *Service
2996 name string
2997 googlecloudmemcachev1beta2upgradeinstancerequest *GoogleCloudMemcacheV1beta2UpgradeInstanceRequest
2998 urlParams_ gensupport.URLParams
2999 ctx_ context.Context
3000 header_ http.Header
3001 }
3002
3003
3004
3005
3006
3007
3008
3009 func (r *ProjectsLocationsInstancesService) Upgrade(name string, googlecloudmemcachev1beta2upgradeinstancerequest *GoogleCloudMemcacheV1beta2UpgradeInstanceRequest) *ProjectsLocationsInstancesUpgradeCall {
3010 c := &ProjectsLocationsInstancesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3011 c.name = name
3012 c.googlecloudmemcachev1beta2upgradeinstancerequest = googlecloudmemcachev1beta2upgradeinstancerequest
3013 return c
3014 }
3015
3016
3017
3018
3019 func (c *ProjectsLocationsInstancesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeCall {
3020 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3021 return c
3022 }
3023
3024
3025 func (c *ProjectsLocationsInstancesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeCall {
3026 c.ctx_ = ctx
3027 return c
3028 }
3029
3030
3031
3032 func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header {
3033 if c.header_ == nil {
3034 c.header_ = make(http.Header)
3035 }
3036 return c.header_
3037 }
3038
3039 func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) {
3040 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3041 var body io.Reader = nil
3042 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmemcachev1beta2upgradeinstancerequest)
3043 if err != nil {
3044 return nil, err
3045 }
3046 c.urlParams_.Set("alt", alt)
3047 c.urlParams_.Set("prettyPrint", "false")
3048 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:upgrade")
3049 urls += "?" + c.urlParams_.Encode()
3050 req, err := http.NewRequest("POST", urls, body)
3051 if err != nil {
3052 return nil, err
3053 }
3054 req.Header = reqHeaders
3055 googleapi.Expand(req.URL, map[string]string{
3056 "name": c.name,
3057 })
3058 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3059 }
3060
3061
3062
3063
3064
3065
3066 func (c *ProjectsLocationsInstancesUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3067 gensupport.SetOptions(c.urlParams_, opts...)
3068 res, err := c.doRequest("json")
3069 if res != nil && res.StatusCode == http.StatusNotModified {
3070 if res.Body != nil {
3071 res.Body.Close()
3072 }
3073 return nil, gensupport.WrapError(&googleapi.Error{
3074 Code: res.StatusCode,
3075 Header: res.Header,
3076 })
3077 }
3078 if err != nil {
3079 return nil, err
3080 }
3081 defer googleapi.CloseBody(res)
3082 if err := googleapi.CheckResponse(res); err != nil {
3083 return nil, gensupport.WrapError(err)
3084 }
3085 ret := &Operation{
3086 ServerResponse: googleapi.ServerResponse{
3087 Header: res.Header,
3088 HTTPStatusCode: res.StatusCode,
3089 },
3090 }
3091 target := &ret
3092 if err := gensupport.DecodeResponse(target, res); err != nil {
3093 return nil, err
3094 }
3095 return ret, nil
3096 }
3097
3098 type ProjectsLocationsOperationsCancelCall struct {
3099 s *Service
3100 name string
3101 canceloperationrequest *CancelOperationRequest
3102 urlParams_ gensupport.URLParams
3103 ctx_ context.Context
3104 header_ http.Header
3105 }
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
3119 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3120 c.name = name
3121 c.canceloperationrequest = canceloperationrequest
3122 return c
3123 }
3124
3125
3126
3127
3128 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
3129 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3130 return c
3131 }
3132
3133
3134 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
3135 c.ctx_ = ctx
3136 return c
3137 }
3138
3139
3140
3141 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
3142 if c.header_ == nil {
3143 c.header_ = make(http.Header)
3144 }
3145 return c.header_
3146 }
3147
3148 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
3149 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3150 var body io.Reader = nil
3151 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
3152 if err != nil {
3153 return nil, err
3154 }
3155 c.urlParams_.Set("alt", alt)
3156 c.urlParams_.Set("prettyPrint", "false")
3157 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:cancel")
3158 urls += "?" + c.urlParams_.Encode()
3159 req, err := http.NewRequest("POST", urls, body)
3160 if err != nil {
3161 return nil, err
3162 }
3163 req.Header = reqHeaders
3164 googleapi.Expand(req.URL, map[string]string{
3165 "name": c.name,
3166 })
3167 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3168 }
3169
3170
3171
3172
3173
3174
3175 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3176 gensupport.SetOptions(c.urlParams_, opts...)
3177 res, err := c.doRequest("json")
3178 if res != nil && res.StatusCode == http.StatusNotModified {
3179 if res.Body != nil {
3180 res.Body.Close()
3181 }
3182 return nil, gensupport.WrapError(&googleapi.Error{
3183 Code: res.StatusCode,
3184 Header: res.Header,
3185 })
3186 }
3187 if err != nil {
3188 return nil, err
3189 }
3190 defer googleapi.CloseBody(res)
3191 if err := googleapi.CheckResponse(res); err != nil {
3192 return nil, gensupport.WrapError(err)
3193 }
3194 ret := &Empty{
3195 ServerResponse: googleapi.ServerResponse{
3196 Header: res.Header,
3197 HTTPStatusCode: res.StatusCode,
3198 },
3199 }
3200 target := &ret
3201 if err := gensupport.DecodeResponse(target, res); err != nil {
3202 return nil, err
3203 }
3204 return ret, nil
3205 }
3206
3207 type ProjectsLocationsOperationsDeleteCall struct {
3208 s *Service
3209 name string
3210 urlParams_ gensupport.URLParams
3211 ctx_ context.Context
3212 header_ http.Header
3213 }
3214
3215
3216
3217
3218
3219
3220
3221 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
3222 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3223 c.name = name
3224 return c
3225 }
3226
3227
3228
3229
3230 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
3231 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3232 return c
3233 }
3234
3235
3236 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
3237 c.ctx_ = ctx
3238 return c
3239 }
3240
3241
3242
3243 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
3244 if c.header_ == nil {
3245 c.header_ = make(http.Header)
3246 }
3247 return c.header_
3248 }
3249
3250 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
3251 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3252 var body io.Reader = nil
3253 c.urlParams_.Set("alt", alt)
3254 c.urlParams_.Set("prettyPrint", "false")
3255 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
3256 urls += "?" + c.urlParams_.Encode()
3257 req, err := http.NewRequest("DELETE", urls, body)
3258 if err != nil {
3259 return nil, err
3260 }
3261 req.Header = reqHeaders
3262 googleapi.Expand(req.URL, map[string]string{
3263 "name": c.name,
3264 })
3265 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3266 }
3267
3268
3269
3270
3271
3272
3273 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3274 gensupport.SetOptions(c.urlParams_, opts...)
3275 res, err := c.doRequest("json")
3276 if res != nil && res.StatusCode == http.StatusNotModified {
3277 if res.Body != nil {
3278 res.Body.Close()
3279 }
3280 return nil, gensupport.WrapError(&googleapi.Error{
3281 Code: res.StatusCode,
3282 Header: res.Header,
3283 })
3284 }
3285 if err != nil {
3286 return nil, err
3287 }
3288 defer googleapi.CloseBody(res)
3289 if err := googleapi.CheckResponse(res); err != nil {
3290 return nil, gensupport.WrapError(err)
3291 }
3292 ret := &Empty{
3293 ServerResponse: googleapi.ServerResponse{
3294 Header: res.Header,
3295 HTTPStatusCode: res.StatusCode,
3296 },
3297 }
3298 target := &ret
3299 if err := gensupport.DecodeResponse(target, res); err != nil {
3300 return nil, err
3301 }
3302 return ret, nil
3303 }
3304
3305 type ProjectsLocationsOperationsGetCall struct {
3306 s *Service
3307 name string
3308 urlParams_ gensupport.URLParams
3309 ifNoneMatch_ string
3310 ctx_ context.Context
3311 header_ http.Header
3312 }
3313
3314
3315
3316
3317
3318
3319 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
3320 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3321 c.name = name
3322 return c
3323 }
3324
3325
3326
3327
3328 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
3329 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3330 return c
3331 }
3332
3333
3334
3335
3336 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
3337 c.ifNoneMatch_ = entityTag
3338 return c
3339 }
3340
3341
3342 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
3343 c.ctx_ = ctx
3344 return c
3345 }
3346
3347
3348
3349 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
3350 if c.header_ == nil {
3351 c.header_ = make(http.Header)
3352 }
3353 return c.header_
3354 }
3355
3356 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3357 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3358 if c.ifNoneMatch_ != "" {
3359 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3360 }
3361 var body io.Reader = nil
3362 c.urlParams_.Set("alt", alt)
3363 c.urlParams_.Set("prettyPrint", "false")
3364 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
3365 urls += "?" + c.urlParams_.Encode()
3366 req, err := http.NewRequest("GET", urls, body)
3367 if err != nil {
3368 return nil, err
3369 }
3370 req.Header = reqHeaders
3371 googleapi.Expand(req.URL, map[string]string{
3372 "name": c.name,
3373 })
3374 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3375 }
3376
3377
3378
3379
3380
3381
3382 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3383 gensupport.SetOptions(c.urlParams_, opts...)
3384 res, err := c.doRequest("json")
3385 if res != nil && res.StatusCode == http.StatusNotModified {
3386 if res.Body != nil {
3387 res.Body.Close()
3388 }
3389 return nil, gensupport.WrapError(&googleapi.Error{
3390 Code: res.StatusCode,
3391 Header: res.Header,
3392 })
3393 }
3394 if err != nil {
3395 return nil, err
3396 }
3397 defer googleapi.CloseBody(res)
3398 if err := googleapi.CheckResponse(res); err != nil {
3399 return nil, gensupport.WrapError(err)
3400 }
3401 ret := &Operation{
3402 ServerResponse: googleapi.ServerResponse{
3403 Header: res.Header,
3404 HTTPStatusCode: res.StatusCode,
3405 },
3406 }
3407 target := &ret
3408 if err := gensupport.DecodeResponse(target, res); err != nil {
3409 return nil, err
3410 }
3411 return ret, nil
3412 }
3413
3414 type ProjectsLocationsOperationsListCall struct {
3415 s *Service
3416 name string
3417 urlParams_ gensupport.URLParams
3418 ifNoneMatch_ string
3419 ctx_ context.Context
3420 header_ http.Header
3421 }
3422
3423
3424
3425
3426
3427 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
3428 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3429 c.name = name
3430 return c
3431 }
3432
3433
3434 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
3435 c.urlParams_.Set("filter", filter)
3436 return c
3437 }
3438
3439
3440
3441 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
3442 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3443 return c
3444 }
3445
3446
3447
3448 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
3449 c.urlParams_.Set("pageToken", pageToken)
3450 return c
3451 }
3452
3453
3454
3455
3456 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
3457 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3458 return c
3459 }
3460
3461
3462
3463
3464 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
3465 c.ifNoneMatch_ = entityTag
3466 return c
3467 }
3468
3469
3470 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
3471 c.ctx_ = ctx
3472 return c
3473 }
3474
3475
3476
3477 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
3478 if c.header_ == nil {
3479 c.header_ = make(http.Header)
3480 }
3481 return c.header_
3482 }
3483
3484 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
3485 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3486 if c.ifNoneMatch_ != "" {
3487 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3488 }
3489 var body io.Reader = nil
3490 c.urlParams_.Set("alt", alt)
3491 c.urlParams_.Set("prettyPrint", "false")
3492 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/operations")
3493 urls += "?" + c.urlParams_.Encode()
3494 req, err := http.NewRequest("GET", urls, body)
3495 if err != nil {
3496 return nil, err
3497 }
3498 req.Header = reqHeaders
3499 googleapi.Expand(req.URL, map[string]string{
3500 "name": c.name,
3501 })
3502 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3503 }
3504
3505
3506
3507
3508
3509
3510
3511 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
3512 gensupport.SetOptions(c.urlParams_, opts...)
3513 res, err := c.doRequest("json")
3514 if res != nil && res.StatusCode == http.StatusNotModified {
3515 if res.Body != nil {
3516 res.Body.Close()
3517 }
3518 return nil, gensupport.WrapError(&googleapi.Error{
3519 Code: res.StatusCode,
3520 Header: res.Header,
3521 })
3522 }
3523 if err != nil {
3524 return nil, err
3525 }
3526 defer googleapi.CloseBody(res)
3527 if err := googleapi.CheckResponse(res); err != nil {
3528 return nil, gensupport.WrapError(err)
3529 }
3530 ret := &ListOperationsResponse{
3531 ServerResponse: googleapi.ServerResponse{
3532 Header: res.Header,
3533 HTTPStatusCode: res.StatusCode,
3534 },
3535 }
3536 target := &ret
3537 if err := gensupport.DecodeResponse(target, res); err != nil {
3538 return nil, err
3539 }
3540 return ret, nil
3541 }
3542
3543
3544
3545
3546 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
3547 c.ctx_ = ctx
3548 defer c.PageToken(c.urlParams_.Get("pageToken"))
3549 for {
3550 x, err := c.Do()
3551 if err != nil {
3552 return err
3553 }
3554 if err := f(x); err != nil {
3555 return err
3556 }
3557 if x.NextPageToken == "" {
3558 return nil
3559 }
3560 c.PageToken(x.NextPageToken)
3561 }
3562 }
3563
View as plain text