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