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