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