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