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
52
53
54
55
56 package cloudresourcemanager
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "cloudresourcemanager:v1"
95 const apiName = "cloudresourcemanager"
96 const apiVersion = "v1"
97 const basePath = "https://cloudresourcemanager.googleapis.com/"
98 const basePathTemplate = "https://cloudresourcemanager.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://cloudresourcemanager.mtls.googleapis.com/"
100
101
102 const (
103
104
105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
106
107
108
109 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
110 )
111
112
113 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
114 scopesOption := internaloption.WithDefaultScopes(
115 "https://www.googleapis.com/auth/cloud-platform",
116 "https://www.googleapis.com/auth/cloud-platform.read-only",
117 )
118
119 opts = append([]option.ClientOption{scopesOption}, opts...)
120 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
121 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
122 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
123 opts = append(opts, internaloption.EnableNewAuthLibrary())
124 client, endpoint, err := htransport.NewClient(ctx, opts...)
125 if err != nil {
126 return nil, err
127 }
128 s, err := New(client)
129 if err != nil {
130 return nil, err
131 }
132 if endpoint != "" {
133 s.BasePath = endpoint
134 }
135 return s, nil
136 }
137
138
139
140
141
142
143 func New(client *http.Client) (*Service, error) {
144 if client == nil {
145 return nil, errors.New("client is nil")
146 }
147 s := &Service{client: client, BasePath: basePath}
148 s.Folders = NewFoldersService(s)
149 s.Liens = NewLiensService(s)
150 s.Operations = NewOperationsService(s)
151 s.Organizations = NewOrganizationsService(s)
152 s.Projects = NewProjectsService(s)
153 return s, nil
154 }
155
156 type Service struct {
157 client *http.Client
158 BasePath string
159 UserAgent string
160
161 Folders *FoldersService
162
163 Liens *LiensService
164
165 Operations *OperationsService
166
167 Organizations *OrganizationsService
168
169 Projects *ProjectsService
170 }
171
172 func (s *Service) userAgent() string {
173 if s.UserAgent == "" {
174 return googleapi.UserAgent
175 }
176 return googleapi.UserAgent + " " + s.UserAgent
177 }
178
179 func NewFoldersService(s *Service) *FoldersService {
180 rs := &FoldersService{s: s}
181 return rs
182 }
183
184 type FoldersService struct {
185 s *Service
186 }
187
188 func NewLiensService(s *Service) *LiensService {
189 rs := &LiensService{s: s}
190 return rs
191 }
192
193 type LiensService struct {
194 s *Service
195 }
196
197 func NewOperationsService(s *Service) *OperationsService {
198 rs := &OperationsService{s: s}
199 return rs
200 }
201
202 type OperationsService struct {
203 s *Service
204 }
205
206 func NewOrganizationsService(s *Service) *OrganizationsService {
207 rs := &OrganizationsService{s: s}
208 return rs
209 }
210
211 type OrganizationsService struct {
212 s *Service
213 }
214
215 func NewProjectsService(s *Service) *ProjectsService {
216 rs := &ProjectsService{s: s}
217 return rs
218 }
219
220 type ProjectsService struct {
221 s *Service
222 }
223
224
225 type Ancestor struct {
226
227 ResourceId *ResourceId `json:"resourceId,omitempty"`
228
229
230
231
232
233 ForceSendFields []string `json:"-"`
234
235
236
237
238 NullFields []string `json:"-"`
239 }
240
241 func (s *Ancestor) MarshalJSON() ([]byte, error) {
242 type NoMethod Ancestor
243 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
244 }
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262 type AuditConfig struct {
263
264 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
265
266
267
268 Service string `json:"service,omitempty"`
269
270
271
272
273
274 ForceSendFields []string `json:"-"`
275
276
277
278
279 NullFields []string `json:"-"`
280 }
281
282 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
283 type NoMethod AuditConfig
284 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
285 }
286
287
288
289
290
291
292 type AuditLogConfig struct {
293
294
295 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
296
297
298
299
300
301
302
303 LogType string `json:"logType,omitempty"`
304
305
306
307
308
309 ForceSendFields []string `json:"-"`
310
311
312
313
314 NullFields []string `json:"-"`
315 }
316
317 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
318 type NoMethod AuditLogConfig
319 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
320 }
321
322
323 type Binding struct {
324
325
326
327
328
329
330
331
332 Condition *Expr `json:"condition,omitempty"`
333
334
335
336
337
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 Members []string `json:"members,omitempty"`
396
397
398
399
400
401
402 Role string `json:"role,omitempty"`
403
404
405
406
407
408 ForceSendFields []string `json:"-"`
409
410
411
412
413 NullFields []string `json:"-"`
414 }
415
416 func (s *Binding) MarshalJSON() ([]byte, error) {
417 type NoMethod Binding
418 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
419 }
420
421
422
423
424
425 type BooleanConstraint struct {
426 }
427
428
429
430 type BooleanPolicy struct {
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456 Enforced bool `json:"enforced,omitempty"`
457
458
459
460
461
462 ForceSendFields []string `json:"-"`
463
464
465
466
467 NullFields []string `json:"-"`
468 }
469
470 func (s *BooleanPolicy) MarshalJSON() ([]byte, error) {
471 type NoMethod BooleanPolicy
472 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
473 }
474
475
476 type ClearOrgPolicyRequest struct {
477
478 Constraint string `json:"constraint,omitempty"`
479
480
481 Etag string `json:"etag,omitempty"`
482
483
484
485
486
487 ForceSendFields []string `json:"-"`
488
489
490
491
492 NullFields []string `json:"-"`
493 }
494
495 func (s *ClearOrgPolicyRequest) MarshalJSON() ([]byte, error) {
496 type NoMethod ClearOrgPolicyRequest
497 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
498 }
499
500
501
502 type CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation struct {
503
504
505 DestinationParent string `json:"destinationParent,omitempty"`
506
507 DisplayName string `json:"displayName,omitempty"`
508
509
510
511
512
513
514 OperationType string `json:"operationType,omitempty"`
515
516
517 SourceParent string `json:"sourceParent,omitempty"`
518
519
520
521
522
523 ForceSendFields []string `json:"-"`
524
525
526
527
528 NullFields []string `json:"-"`
529 }
530
531 func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation) MarshalJSON() ([]byte, error) {
532 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation
533 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
534 }
535
536
537
538 type CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation struct {
539
540
541 DestinationParent string `json:"destinationParent,omitempty"`
542
543 DisplayName string `json:"displayName,omitempty"`
544
545
546
547
548
549
550 OperationType string `json:"operationType,omitempty"`
551
552
553 SourceParent string `json:"sourceParent,omitempty"`
554
555
556
557
558
559 ForceSendFields []string `json:"-"`
560
561
562
563
564 NullFields []string `json:"-"`
565 }
566
567 func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation) MarshalJSON() ([]byte, error) {
568 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation
569 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
570 }
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585 type Constraint struct {
586
587 BooleanConstraint *BooleanConstraint `json:"booleanConstraint,omitempty"`
588
589
590
591
592
593
594
595
596
597
598 ConstraintDefault string `json:"constraintDefault,omitempty"`
599
600
601 Description string `json:"description,omitempty"`
602
603 DisplayName string `json:"displayName,omitempty"`
604
605 ListConstraint *ListConstraint `json:"listConstraint,omitempty"`
606
607
608 Name string `json:"name,omitempty"`
609
610 Version int64 `json:"version,omitempty"`
611
612
613
614
615
616 ForceSendFields []string `json:"-"`
617
618
619
620
621 NullFields []string `json:"-"`
622 }
623
624 func (s *Constraint) MarshalJSON() ([]byte, error) {
625 type NoMethod Constraint
626 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
627 }
628
629
630 type CreateFolderMetadata struct {
631
632 DisplayName string `json:"displayName,omitempty"`
633
634
635 Parent string `json:"parent,omitempty"`
636
637
638
639
640
641 ForceSendFields []string `json:"-"`
642
643
644
645
646 NullFields []string `json:"-"`
647 }
648
649 func (s *CreateFolderMetadata) MarshalJSON() ([]byte, error) {
650 type NoMethod CreateFolderMetadata
651 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
652 }
653
654
655
656
657 type CreateProjectMetadata struct {
658
659 CreateTime string `json:"createTime,omitempty"`
660
661
662
663 Gettable bool `json:"gettable,omitempty"`
664
665 Ready bool `json:"ready,omitempty"`
666
667
668
669
670
671 ForceSendFields []string `json:"-"`
672
673
674
675
676 NullFields []string `json:"-"`
677 }
678
679 func (s *CreateProjectMetadata) MarshalJSON() ([]byte, error) {
680 type NoMethod CreateProjectMetadata
681 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
682 }
683
684
685
686 type CreateTagBindingMetadata struct {
687 }
688
689
690 type CreateTagKeyMetadata struct {
691 }
692
693
694
695 type CreateTagValueMetadata struct {
696 }
697
698
699
700 type DeleteFolderMetadata struct {
701 }
702
703
704
705 type DeleteOrganizationMetadata struct {
706 }
707
708
709
710 type DeleteProjectMetadata struct {
711 }
712
713
714
715 type DeleteTagBindingMetadata struct {
716 }
717
718
719 type DeleteTagKeyMetadata struct {
720 }
721
722
723
724 type DeleteTagValueMetadata struct {
725 }
726
727
728
729
730
731 type Empty struct {
732
733 googleapi.ServerResponse `json:"-"`
734 }
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752 type Expr struct {
753
754
755 Description string `json:"description,omitempty"`
756
757
758 Expression string `json:"expression,omitempty"`
759
760
761 Location string `json:"location,omitempty"`
762
763
764
765 Title string `json:"title,omitempty"`
766
767
768
769
770
771 ForceSendFields []string `json:"-"`
772
773
774
775
776 NullFields []string `json:"-"`
777 }
778
779 func (s *Expr) MarshalJSON() ([]byte, error) {
780 type NoMethod Expr
781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
782 }
783
784
785 type FolderOperation struct {
786
787
788 DestinationParent string `json:"destinationParent,omitempty"`
789
790 DisplayName string `json:"displayName,omitempty"`
791
792
793
794
795
796
797 OperationType string `json:"operationType,omitempty"`
798
799
800 SourceParent string `json:"sourceParent,omitempty"`
801
802
803
804
805
806 ForceSendFields []string `json:"-"`
807
808
809
810
811 NullFields []string `json:"-"`
812 }
813
814 func (s *FolderOperation) MarshalJSON() ([]byte, error) {
815 type NoMethod FolderOperation
816 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
817 }
818
819
820 type FolderOperationError struct {
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842 ErrorMessageId string `json:"errorMessageId,omitempty"`
843
844
845
846
847
848 ForceSendFields []string `json:"-"`
849
850
851
852
853 NullFields []string `json:"-"`
854 }
855
856 func (s *FolderOperationError) MarshalJSON() ([]byte, error) {
857 type NoMethod FolderOperationError
858 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
859 }
860
861
862 type GetAncestryRequest struct {
863 }
864
865
866 type GetAncestryResponse struct {
867
868
869
870 Ancestor []*Ancestor `json:"ancestor,omitempty"`
871
872
873 googleapi.ServerResponse `json:"-"`
874
875
876
877
878
879 ForceSendFields []string `json:"-"`
880
881
882
883
884 NullFields []string `json:"-"`
885 }
886
887 func (s *GetAncestryResponse) MarshalJSON() ([]byte, error) {
888 type NoMethod GetAncestryResponse
889 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
890 }
891
892
893
894 type GetEffectiveOrgPolicyRequest struct {
895
896 Constraint string `json:"constraint,omitempty"`
897
898
899
900
901
902 ForceSendFields []string `json:"-"`
903
904
905
906
907 NullFields []string `json:"-"`
908 }
909
910 func (s *GetEffectiveOrgPolicyRequest) MarshalJSON() ([]byte, error) {
911 type NoMethod GetEffectiveOrgPolicyRequest
912 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
913 }
914
915
916 type GetIamPolicyRequest struct {
917
918
919 Options *GetPolicyOptions `json:"options,omitempty"`
920
921
922
923
924
925 ForceSendFields []string `json:"-"`
926
927
928
929
930 NullFields []string `json:"-"`
931 }
932
933 func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
934 type NoMethod GetIamPolicyRequest
935 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
936 }
937
938
939 type GetOrgPolicyRequest struct {
940
941 Constraint string `json:"constraint,omitempty"`
942
943
944
945
946
947 ForceSendFields []string `json:"-"`
948
949
950
951
952 NullFields []string `json:"-"`
953 }
954
955 func (s *GetOrgPolicyRequest) MarshalJSON() ([]byte, error) {
956 type NoMethod GetOrgPolicyRequest
957 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
958 }
959
960
961 type GetPolicyOptions struct {
962
963
964
965
966
967
968
969
970
971
972
973 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
974
975
976
977
978
979 ForceSendFields []string `json:"-"`
980
981
982
983
984 NullFields []string `json:"-"`
985 }
986
987 func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
988 type NoMethod GetPolicyOptions
989 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
990 }
991
992
993
994 type Lien struct {
995
996 CreateTime string `json:"createTime,omitempty"`
997
998
999 Name string `json:"name,omitempty"`
1000
1001
1002
1003 Origin string `json:"origin,omitempty"`
1004
1005
1006
1007 Parent string `json:"parent,omitempty"`
1008
1009
1010
1011 Reason string `json:"reason,omitempty"`
1012
1013
1014
1015
1016
1017 Restrictions []string `json:"restrictions,omitempty"`
1018
1019
1020 googleapi.ServerResponse `json:"-"`
1021
1022
1023
1024
1025
1026 ForceSendFields []string `json:"-"`
1027
1028
1029
1030
1031 NullFields []string `json:"-"`
1032 }
1033
1034 func (s *Lien) MarshalJSON() ([]byte, error) {
1035 type NoMethod Lien
1036 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1037 }
1038
1039
1040
1041
1042 type ListAvailableOrgPolicyConstraintsRequest struct {
1043
1044
1045
1046 PageSize int64 `json:"pageSize,omitempty"`
1047
1048
1049
1050 PageToken string `json:"pageToken,omitempty"`
1051
1052
1053
1054
1055
1056 ForceSendFields []string `json:"-"`
1057
1058
1059
1060
1061 NullFields []string `json:"-"`
1062 }
1063
1064 func (s *ListAvailableOrgPolicyConstraintsRequest) MarshalJSON() ([]byte, error) {
1065 type NoMethod ListAvailableOrgPolicyConstraintsRequest
1066 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1067 }
1068
1069
1070
1071
1072
1073 type ListAvailableOrgPolicyConstraintsResponse struct {
1074
1075
1076 Constraints []*Constraint `json:"constraints,omitempty"`
1077
1078
1079 NextPageToken string `json:"nextPageToken,omitempty"`
1080
1081
1082 googleapi.ServerResponse `json:"-"`
1083
1084
1085
1086
1087
1088 ForceSendFields []string `json:"-"`
1089
1090
1091
1092
1093 NullFields []string `json:"-"`
1094 }
1095
1096 func (s *ListAvailableOrgPolicyConstraintsResponse) MarshalJSON() ([]byte, error) {
1097 type NoMethod ListAvailableOrgPolicyConstraintsResponse
1098 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1099 }
1100
1101
1102
1103
1104 type ListConstraint struct {
1105
1106
1107 SuggestedValue string `json:"suggestedValue,omitempty"`
1108
1109
1110
1111
1112 SupportsUnder bool `json:"supportsUnder,omitempty"`
1113
1114
1115
1116
1117
1118 ForceSendFields []string `json:"-"`
1119
1120
1121
1122
1123 NullFields []string `json:"-"`
1124 }
1125
1126 func (s *ListConstraint) MarshalJSON() ([]byte, error) {
1127 type NoMethod ListConstraint
1128 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1129 }
1130
1131
1132 type ListLiensResponse struct {
1133
1134 Liens []*Lien `json:"liens,omitempty"`
1135
1136
1137 NextPageToken string `json:"nextPageToken,omitempty"`
1138
1139
1140 googleapi.ServerResponse `json:"-"`
1141
1142
1143
1144
1145
1146 ForceSendFields []string `json:"-"`
1147
1148
1149
1150
1151 NullFields []string `json:"-"`
1152 }
1153
1154 func (s *ListLiensResponse) MarshalJSON() ([]byte, error) {
1155 type NoMethod ListLiensResponse
1156 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1157 }
1158
1159
1160 type ListOrgPoliciesRequest struct {
1161
1162
1163
1164 PageSize int64 `json:"pageSize,omitempty"`
1165
1166
1167
1168 PageToken string `json:"pageToken,omitempty"`
1169
1170
1171
1172
1173
1174 ForceSendFields []string `json:"-"`
1175
1176
1177
1178
1179 NullFields []string `json:"-"`
1180 }
1181
1182 func (s *ListOrgPoliciesRequest) MarshalJSON() ([]byte, error) {
1183 type NoMethod ListOrgPoliciesRequest
1184 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1185 }
1186
1187
1188
1189 type ListOrgPoliciesResponse struct {
1190
1191
1192 NextPageToken string `json:"nextPageToken,omitempty"`
1193
1194
1195 Policies []*OrgPolicy `json:"policies,omitempty"`
1196
1197
1198 googleapi.ServerResponse `json:"-"`
1199
1200
1201
1202
1203
1204 ForceSendFields []string `json:"-"`
1205
1206
1207
1208
1209 NullFields []string `json:"-"`
1210 }
1211
1212 func (s *ListOrgPoliciesResponse) MarshalJSON() ([]byte, error) {
1213 type NoMethod ListOrgPoliciesResponse
1214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1215 }
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234 type ListPolicy struct {
1235
1236
1237
1238
1239
1240
1241
1242 AllValues string `json:"allValues,omitempty"`
1243
1244
1245 AllowedValues []string `json:"allowedValues,omitempty"`
1246
1247
1248 DeniedValues []string `json:"deniedValues,omitempty"`
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
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
1303
1304
1305
1306
1307
1308 InheritFromParent bool `json:"inheritFromParent,omitempty"`
1309
1310
1311
1312
1313 SuggestedValue string `json:"suggestedValue,omitempty"`
1314
1315
1316
1317
1318
1319 ForceSendFields []string `json:"-"`
1320
1321
1322
1323
1324 NullFields []string `json:"-"`
1325 }
1326
1327 func (s *ListPolicy) MarshalJSON() ([]byte, error) {
1328 type NoMethod ListPolicy
1329 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1330 }
1331
1332
1333
1334
1335
1336 type ListProjectsResponse struct {
1337
1338
1339
1340
1341
1342
1343
1344 NextPageToken string `json:"nextPageToken,omitempty"`
1345
1346
1347 Projects []*Project `json:"projects,omitempty"`
1348
1349
1350 googleapi.ServerResponse `json:"-"`
1351
1352
1353
1354
1355
1356 ForceSendFields []string `json:"-"`
1357
1358
1359
1360
1361 NullFields []string `json:"-"`
1362 }
1363
1364 func (s *ListProjectsResponse) MarshalJSON() ([]byte, error) {
1365 type NoMethod ListProjectsResponse
1366 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1367 }
1368
1369
1370 type MoveFolderMetadata struct {
1371
1372
1373 DestinationParent string `json:"destinationParent,omitempty"`
1374
1375 DisplayName string `json:"displayName,omitempty"`
1376
1377 SourceParent string `json:"sourceParent,omitempty"`
1378
1379
1380
1381
1382
1383 ForceSendFields []string `json:"-"`
1384
1385
1386
1387
1388 NullFields []string `json:"-"`
1389 }
1390
1391 func (s *MoveFolderMetadata) MarshalJSON() ([]byte, error) {
1392 type NoMethod MoveFolderMetadata
1393 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1394 }
1395
1396
1397
1398 type MoveProjectMetadata struct {
1399 }
1400
1401
1402
1403 type Operation struct {
1404
1405
1406
1407 Done bool `json:"done,omitempty"`
1408
1409 Error *Status `json:"error,omitempty"`
1410
1411
1412
1413
1414 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1415
1416
1417
1418 Name string `json:"name,omitempty"`
1419
1420
1421
1422
1423
1424
1425
1426 Response googleapi.RawMessage `json:"response,omitempty"`
1427
1428
1429 googleapi.ServerResponse `json:"-"`
1430
1431
1432
1433
1434
1435 ForceSendFields []string `json:"-"`
1436
1437
1438
1439
1440 NullFields []string `json:"-"`
1441 }
1442
1443 func (s *Operation) MarshalJSON() ([]byte, error) {
1444 type NoMethod Operation
1445 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1446 }
1447
1448
1449
1450 type OrgPolicy struct {
1451
1452
1453 BooleanPolicy *BooleanPolicy `json:"booleanPolicy,omitempty"`
1454
1455
1456
1457
1458 Constraint string `json:"constraint,omitempty"`
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469 Etag string `json:"etag,omitempty"`
1470
1471 ListPolicy *ListPolicy `json:"listPolicy,omitempty"`
1472
1473
1474 RestoreDefault *RestoreDefault `json:"restoreDefault,omitempty"`
1475
1476
1477
1478
1479 UpdateTime string `json:"updateTime,omitempty"`
1480
1481 Version int64 `json:"version,omitempty"`
1482
1483
1484 googleapi.ServerResponse `json:"-"`
1485
1486
1487
1488
1489
1490 ForceSendFields []string `json:"-"`
1491
1492
1493
1494
1495 NullFields []string `json:"-"`
1496 }
1497
1498 func (s *OrgPolicy) MarshalJSON() ([]byte, error) {
1499 type NoMethod OrgPolicy
1500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1501 }
1502
1503
1504
1505 type Organization struct {
1506
1507
1508 CreationTime string `json:"creationTime,omitempty"`
1509
1510
1511
1512
1513 DisplayName string `json:"displayName,omitempty"`
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523 LifecycleState string `json:"lifecycleState,omitempty"`
1524
1525
1526
1527 Name string `json:"name,omitempty"`
1528
1529
1530 Owner *OrganizationOwner `json:"owner,omitempty"`
1531
1532
1533 googleapi.ServerResponse `json:"-"`
1534
1535
1536
1537
1538
1539 ForceSendFields []string `json:"-"`
1540
1541
1542
1543
1544 NullFields []string `json:"-"`
1545 }
1546
1547 func (s *Organization) MarshalJSON() ([]byte, error) {
1548 type NoMethod Organization
1549 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1550 }
1551
1552
1553
1554
1555
1556 type OrganizationOwner struct {
1557
1558 DirectoryCustomerId string `json:"directoryCustomerId,omitempty"`
1559
1560
1561
1562
1563
1564 ForceSendFields []string `json:"-"`
1565
1566
1567
1568
1569 NullFields []string `json:"-"`
1570 }
1571
1572 func (s *OrganizationOwner) MarshalJSON() ([]byte, error) {
1573 type NoMethod OrganizationOwner
1574 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1575 }
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607 type Policy struct {
1608
1609 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619 Bindings []*Binding `json:"bindings,omitempty"`
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631 Etag string `json:"etag,omitempty"`
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647 Version int64 `json:"version,omitempty"`
1648
1649
1650 googleapi.ServerResponse `json:"-"`
1651
1652
1653
1654
1655
1656 ForceSendFields []string `json:"-"`
1657
1658
1659
1660
1661 NullFields []string `json:"-"`
1662 }
1663
1664 func (s *Policy) MarshalJSON() ([]byte, error) {
1665 type NoMethod Policy
1666 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1667 }
1668
1669
1670
1671
1672 type Project struct {
1673
1674 CreateTime string `json:"createTime,omitempty"`
1675
1676
1677
1678
1679
1680
1681
1682
1683 Labels map[string]string `json:"labels,omitempty"`
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695 LifecycleState string `json:"lifecycleState,omitempty"`
1696
1697
1698
1699
1700 Name string `json:"name,omitempty"`
1701
1702
1703
1704
1705
1706 Parent *ResourceId `json:"parent,omitempty"`
1707
1708
1709
1710 ProjectId string `json:"projectId,omitempty"`
1711
1712
1713 ProjectNumber int64 `json:"projectNumber,omitempty,string"`
1714
1715
1716
1717
1718 Tags map[string]string `json:"tags,omitempty"`
1719
1720
1721 googleapi.ServerResponse `json:"-"`
1722
1723
1724
1725
1726
1727 ForceSendFields []string `json:"-"`
1728
1729
1730
1731
1732 NullFields []string `json:"-"`
1733 }
1734
1735 func (s *Project) MarshalJSON() ([]byte, error) {
1736 type NoMethod Project
1737 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1738 }
1739
1740
1741
1742
1743 type ProjectCreationStatus struct {
1744
1745 CreateTime string `json:"createTime,omitempty"`
1746
1747
1748
1749 Gettable bool `json:"gettable,omitempty"`
1750
1751 Ready bool `json:"ready,omitempty"`
1752
1753
1754
1755
1756
1757 ForceSendFields []string `json:"-"`
1758
1759
1760
1761
1762 NullFields []string `json:"-"`
1763 }
1764
1765 func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) {
1766 type NoMethod ProjectCreationStatus
1767 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1768 }
1769
1770
1771
1772
1773
1774
1775 type ResourceId struct {
1776
1777
1778 Id string `json:"id,omitempty"`
1779
1780
1781 Type string `json:"type,omitempty"`
1782
1783
1784
1785
1786
1787 ForceSendFields []string `json:"-"`
1788
1789
1790
1791
1792 NullFields []string `json:"-"`
1793 }
1794
1795 func (s *ResourceId) MarshalJSON() ([]byte, error) {
1796 type NoMethod ResourceId
1797 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1798 }
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810 type RestoreDefault struct {
1811 }
1812
1813
1814
1815 type SearchOrganizationsRequest struct {
1816
1817
1818
1819
1820
1821
1822
1823
1824 Filter string `json:"filter,omitempty"`
1825
1826
1827
1828 PageSize int64 `json:"pageSize,omitempty"`
1829
1830
1831
1832 PageToken string `json:"pageToken,omitempty"`
1833
1834
1835
1836
1837
1838 ForceSendFields []string `json:"-"`
1839
1840
1841
1842
1843 NullFields []string `json:"-"`
1844 }
1845
1846 func (s *SearchOrganizationsRequest) MarshalJSON() ([]byte, error) {
1847 type NoMethod SearchOrganizationsRequest
1848 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1849 }
1850
1851
1852
1853 type SearchOrganizationsResponse struct {
1854
1855
1856
1857
1858
1859 NextPageToken string `json:"nextPageToken,omitempty"`
1860
1861
1862 Organizations []*Organization `json:"organizations,omitempty"`
1863
1864
1865 googleapi.ServerResponse `json:"-"`
1866
1867
1868
1869
1870
1871 ForceSendFields []string `json:"-"`
1872
1873
1874
1875
1876 NullFields []string `json:"-"`
1877 }
1878
1879 func (s *SearchOrganizationsResponse) MarshalJSON() ([]byte, error) {
1880 type NoMethod SearchOrganizationsResponse
1881 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1882 }
1883
1884
1885 type SetIamPolicyRequest struct {
1886
1887
1888
1889
1890 Policy *Policy `json:"policy,omitempty"`
1891
1892
1893
1894 UpdateMask string `json:"updateMask,omitempty"`
1895
1896
1897
1898
1899
1900 ForceSendFields []string `json:"-"`
1901
1902
1903
1904
1905 NullFields []string `json:"-"`
1906 }
1907
1908 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1909 type NoMethod SetIamPolicyRequest
1910 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1911 }
1912
1913
1914 type SetOrgPolicyRequest struct {
1915
1916 Policy *OrgPolicy `json:"policy,omitempty"`
1917
1918
1919
1920
1921
1922 ForceSendFields []string `json:"-"`
1923
1924
1925
1926
1927 NullFields []string `json:"-"`
1928 }
1929
1930 func (s *SetOrgPolicyRequest) MarshalJSON() ([]byte, error) {
1931 type NoMethod SetOrgPolicyRequest
1932 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1933 }
1934
1935
1936
1937
1938
1939
1940
1941 type Status struct {
1942
1943 Code int64 `json:"code,omitempty"`
1944
1945
1946 Details []googleapi.RawMessage `json:"details,omitempty"`
1947
1948
1949
1950 Message string `json:"message,omitempty"`
1951
1952
1953
1954
1955
1956 ForceSendFields []string `json:"-"`
1957
1958
1959
1960
1961 NullFields []string `json:"-"`
1962 }
1963
1964 func (s *Status) MarshalJSON() ([]byte, error) {
1965 type NoMethod Status
1966 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1967 }
1968
1969
1970 type TestIamPermissionsRequest struct {
1971
1972
1973
1974
1975 Permissions []string `json:"permissions,omitempty"`
1976
1977
1978
1979
1980
1981 ForceSendFields []string `json:"-"`
1982
1983
1984
1985
1986 NullFields []string `json:"-"`
1987 }
1988
1989 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1990 type NoMethod TestIamPermissionsRequest
1991 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1992 }
1993
1994
1995
1996 type TestIamPermissionsResponse struct {
1997
1998
1999 Permissions []string `json:"permissions,omitempty"`
2000
2001
2002 googleapi.ServerResponse `json:"-"`
2003
2004
2005
2006
2007
2008 ForceSendFields []string `json:"-"`
2009
2010
2011
2012
2013 NullFields []string `json:"-"`
2014 }
2015
2016 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2017 type NoMethod TestIamPermissionsResponse
2018 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2019 }
2020
2021
2022
2023 type UndeleteFolderMetadata struct {
2024 }
2025
2026
2027
2028 type UndeleteOrganizationMetadata struct {
2029 }
2030
2031
2032
2033 type UndeleteProjectMetadata struct {
2034 }
2035
2036
2037 type UndeleteProjectRequest struct {
2038 }
2039
2040
2041
2042 type UpdateFolderMetadata struct {
2043 }
2044
2045
2046
2047 type UpdateProjectMetadata struct {
2048 }
2049
2050
2051 type UpdateTagKeyMetadata struct {
2052 }
2053
2054
2055
2056 type UpdateTagValueMetadata struct {
2057 }
2058
2059 type FoldersClearOrgPolicyCall struct {
2060 s *Service
2061 resource string
2062 clearorgpolicyrequest *ClearOrgPolicyRequest
2063 urlParams_ gensupport.URLParams
2064 ctx_ context.Context
2065 header_ http.Header
2066 }
2067
2068
2069
2070
2071 func (r *FoldersService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *FoldersClearOrgPolicyCall {
2072 c := &FoldersClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2073 c.resource = resource
2074 c.clearorgpolicyrequest = clearorgpolicyrequest
2075 return c
2076 }
2077
2078
2079
2080
2081 func (c *FoldersClearOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersClearOrgPolicyCall {
2082 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2083 return c
2084 }
2085
2086
2087 func (c *FoldersClearOrgPolicyCall) Context(ctx context.Context) *FoldersClearOrgPolicyCall {
2088 c.ctx_ = ctx
2089 return c
2090 }
2091
2092
2093
2094 func (c *FoldersClearOrgPolicyCall) Header() http.Header {
2095 if c.header_ == nil {
2096 c.header_ = make(http.Header)
2097 }
2098 return c.header_
2099 }
2100
2101 func (c *FoldersClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
2102 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2103 var body io.Reader = nil
2104 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest)
2105 if err != nil {
2106 return nil, err
2107 }
2108 c.urlParams_.Set("alt", alt)
2109 c.urlParams_.Set("prettyPrint", "false")
2110 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy")
2111 urls += "?" + c.urlParams_.Encode()
2112 req, err := http.NewRequest("POST", urls, body)
2113 if err != nil {
2114 return nil, err
2115 }
2116 req.Header = reqHeaders
2117 googleapi.Expand(req.URL, map[string]string{
2118 "resource": c.resource,
2119 })
2120 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2121 }
2122
2123
2124
2125
2126
2127
2128 func (c *FoldersClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2129 gensupport.SetOptions(c.urlParams_, opts...)
2130 res, err := c.doRequest("json")
2131 if res != nil && res.StatusCode == http.StatusNotModified {
2132 if res.Body != nil {
2133 res.Body.Close()
2134 }
2135 return nil, gensupport.WrapError(&googleapi.Error{
2136 Code: res.StatusCode,
2137 Header: res.Header,
2138 })
2139 }
2140 if err != nil {
2141 return nil, err
2142 }
2143 defer googleapi.CloseBody(res)
2144 if err := googleapi.CheckResponse(res); err != nil {
2145 return nil, gensupport.WrapError(err)
2146 }
2147 ret := &Empty{
2148 ServerResponse: googleapi.ServerResponse{
2149 Header: res.Header,
2150 HTTPStatusCode: res.StatusCode,
2151 },
2152 }
2153 target := &ret
2154 if err := gensupport.DecodeResponse(target, res); err != nil {
2155 return nil, err
2156 }
2157 return ret, nil
2158 }
2159
2160 type FoldersGetEffectiveOrgPolicyCall struct {
2161 s *Service
2162 resource string
2163 geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest
2164 urlParams_ gensupport.URLParams
2165 ctx_ context.Context
2166 header_ http.Header
2167 }
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177 func (r *FoldersService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *FoldersGetEffectiveOrgPolicyCall {
2178 c := &FoldersGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2179 c.resource = resource
2180 c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest
2181 return c
2182 }
2183
2184
2185
2186
2187 func (c *FoldersGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersGetEffectiveOrgPolicyCall {
2188 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2189 return c
2190 }
2191
2192
2193 func (c *FoldersGetEffectiveOrgPolicyCall) Context(ctx context.Context) *FoldersGetEffectiveOrgPolicyCall {
2194 c.ctx_ = ctx
2195 return c
2196 }
2197
2198
2199
2200 func (c *FoldersGetEffectiveOrgPolicyCall) Header() http.Header {
2201 if c.header_ == nil {
2202 c.header_ = make(http.Header)
2203 }
2204 return c.header_
2205 }
2206
2207 func (c *FoldersGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
2208 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2209 var body io.Reader = nil
2210 body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest)
2211 if err != nil {
2212 return nil, err
2213 }
2214 c.urlParams_.Set("alt", alt)
2215 c.urlParams_.Set("prettyPrint", "false")
2216 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy")
2217 urls += "?" + c.urlParams_.Encode()
2218 req, err := http.NewRequest("POST", urls, body)
2219 if err != nil {
2220 return nil, err
2221 }
2222 req.Header = reqHeaders
2223 googleapi.Expand(req.URL, map[string]string{
2224 "resource": c.resource,
2225 })
2226 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2227 }
2228
2229
2230
2231
2232
2233
2234 func (c *FoldersGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
2235 gensupport.SetOptions(c.urlParams_, opts...)
2236 res, err := c.doRequest("json")
2237 if res != nil && res.StatusCode == http.StatusNotModified {
2238 if res.Body != nil {
2239 res.Body.Close()
2240 }
2241 return nil, gensupport.WrapError(&googleapi.Error{
2242 Code: res.StatusCode,
2243 Header: res.Header,
2244 })
2245 }
2246 if err != nil {
2247 return nil, err
2248 }
2249 defer googleapi.CloseBody(res)
2250 if err := googleapi.CheckResponse(res); err != nil {
2251 return nil, gensupport.WrapError(err)
2252 }
2253 ret := &OrgPolicy{
2254 ServerResponse: googleapi.ServerResponse{
2255 Header: res.Header,
2256 HTTPStatusCode: res.StatusCode,
2257 },
2258 }
2259 target := &ret
2260 if err := gensupport.DecodeResponse(target, res); err != nil {
2261 return nil, err
2262 }
2263 return ret, nil
2264 }
2265
2266 type FoldersGetOrgPolicyCall struct {
2267 s *Service
2268 resource string
2269 getorgpolicyrequest *GetOrgPolicyRequest
2270 urlParams_ gensupport.URLParams
2271 ctx_ context.Context
2272 header_ http.Header
2273 }
2274
2275
2276
2277
2278
2279
2280
2281
2282 func (r *FoldersService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *FoldersGetOrgPolicyCall {
2283 c := &FoldersGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2284 c.resource = resource
2285 c.getorgpolicyrequest = getorgpolicyrequest
2286 return c
2287 }
2288
2289
2290
2291
2292 func (c *FoldersGetOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersGetOrgPolicyCall {
2293 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2294 return c
2295 }
2296
2297
2298 func (c *FoldersGetOrgPolicyCall) Context(ctx context.Context) *FoldersGetOrgPolicyCall {
2299 c.ctx_ = ctx
2300 return c
2301 }
2302
2303
2304
2305 func (c *FoldersGetOrgPolicyCall) Header() http.Header {
2306 if c.header_ == nil {
2307 c.header_ = make(http.Header)
2308 }
2309 return c.header_
2310 }
2311
2312 func (c *FoldersGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
2313 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2314 var body io.Reader = nil
2315 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest)
2316 if err != nil {
2317 return nil, err
2318 }
2319 c.urlParams_.Set("alt", alt)
2320 c.urlParams_.Set("prettyPrint", "false")
2321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy")
2322 urls += "?" + c.urlParams_.Encode()
2323 req, err := http.NewRequest("POST", urls, body)
2324 if err != nil {
2325 return nil, err
2326 }
2327 req.Header = reqHeaders
2328 googleapi.Expand(req.URL, map[string]string{
2329 "resource": c.resource,
2330 })
2331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2332 }
2333
2334
2335
2336
2337
2338
2339 func (c *FoldersGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
2340 gensupport.SetOptions(c.urlParams_, opts...)
2341 res, err := c.doRequest("json")
2342 if res != nil && res.StatusCode == http.StatusNotModified {
2343 if res.Body != nil {
2344 res.Body.Close()
2345 }
2346 return nil, gensupport.WrapError(&googleapi.Error{
2347 Code: res.StatusCode,
2348 Header: res.Header,
2349 })
2350 }
2351 if err != nil {
2352 return nil, err
2353 }
2354 defer googleapi.CloseBody(res)
2355 if err := googleapi.CheckResponse(res); err != nil {
2356 return nil, gensupport.WrapError(err)
2357 }
2358 ret := &OrgPolicy{
2359 ServerResponse: googleapi.ServerResponse{
2360 Header: res.Header,
2361 HTTPStatusCode: res.StatusCode,
2362 },
2363 }
2364 target := &ret
2365 if err := gensupport.DecodeResponse(target, res); err != nil {
2366 return nil, err
2367 }
2368 return ret, nil
2369 }
2370
2371 type FoldersListAvailableOrgPolicyConstraintsCall struct {
2372 s *Service
2373 resource string
2374 listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest
2375 urlParams_ gensupport.URLParams
2376 ctx_ context.Context
2377 header_ http.Header
2378 }
2379
2380
2381
2382
2383
2384 func (r *FoldersService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *FoldersListAvailableOrgPolicyConstraintsCall {
2385 c := &FoldersListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2386 c.resource = resource
2387 c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest
2388 return c
2389 }
2390
2391
2392
2393
2394 func (c *FoldersListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *FoldersListAvailableOrgPolicyConstraintsCall {
2395 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2396 return c
2397 }
2398
2399
2400 func (c *FoldersListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *FoldersListAvailableOrgPolicyConstraintsCall {
2401 c.ctx_ = ctx
2402 return c
2403 }
2404
2405
2406
2407 func (c *FoldersListAvailableOrgPolicyConstraintsCall) Header() http.Header {
2408 if c.header_ == nil {
2409 c.header_ = make(http.Header)
2410 }
2411 return c.header_
2412 }
2413
2414 func (c *FoldersListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) {
2415 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2416 var body io.Reader = nil
2417 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest)
2418 if err != nil {
2419 return nil, err
2420 }
2421 c.urlParams_.Set("alt", alt)
2422 c.urlParams_.Set("prettyPrint", "false")
2423 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints")
2424 urls += "?" + c.urlParams_.Encode()
2425 req, err := http.NewRequest("POST", urls, body)
2426 if err != nil {
2427 return nil, err
2428 }
2429 req.Header = reqHeaders
2430 googleapi.Expand(req.URL, map[string]string{
2431 "resource": c.resource,
2432 })
2433 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2434 }
2435
2436
2437
2438
2439
2440
2441
2442 func (c *FoldersListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, 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 := &ListAvailableOrgPolicyConstraintsResponse{
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
2475
2476
2477 func (c *FoldersListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error {
2478 c.ctx_ = ctx
2479 defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken)
2480 for {
2481 x, err := c.Do()
2482 if err != nil {
2483 return err
2484 }
2485 if err := f(x); err != nil {
2486 return err
2487 }
2488 if x.NextPageToken == "" {
2489 return nil
2490 }
2491 c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken
2492 }
2493 }
2494
2495 type FoldersListOrgPoliciesCall struct {
2496 s *Service
2497 resource string
2498 listorgpoliciesrequest *ListOrgPoliciesRequest
2499 urlParams_ gensupport.URLParams
2500 ctx_ context.Context
2501 header_ http.Header
2502 }
2503
2504
2505
2506
2507 func (r *FoldersService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *FoldersListOrgPoliciesCall {
2508 c := &FoldersListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2509 c.resource = resource
2510 c.listorgpoliciesrequest = listorgpoliciesrequest
2511 return c
2512 }
2513
2514
2515
2516
2517 func (c *FoldersListOrgPoliciesCall) Fields(s ...googleapi.Field) *FoldersListOrgPoliciesCall {
2518 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2519 return c
2520 }
2521
2522
2523 func (c *FoldersListOrgPoliciesCall) Context(ctx context.Context) *FoldersListOrgPoliciesCall {
2524 c.ctx_ = ctx
2525 return c
2526 }
2527
2528
2529
2530 func (c *FoldersListOrgPoliciesCall) Header() http.Header {
2531 if c.header_ == nil {
2532 c.header_ = make(http.Header)
2533 }
2534 return c.header_
2535 }
2536
2537 func (c *FoldersListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) {
2538 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2539 var body io.Reader = nil
2540 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest)
2541 if err != nil {
2542 return nil, err
2543 }
2544 c.urlParams_.Set("alt", alt)
2545 c.urlParams_.Set("prettyPrint", "false")
2546 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies")
2547 urls += "?" + c.urlParams_.Encode()
2548 req, err := http.NewRequest("POST", urls, body)
2549 if err != nil {
2550 return nil, err
2551 }
2552 req.Header = reqHeaders
2553 googleapi.Expand(req.URL, map[string]string{
2554 "resource": c.resource,
2555 })
2556 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2557 }
2558
2559
2560
2561
2562
2563
2564
2565 func (c *FoldersListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) {
2566 gensupport.SetOptions(c.urlParams_, opts...)
2567 res, err := c.doRequest("json")
2568 if res != nil && res.StatusCode == http.StatusNotModified {
2569 if res.Body != nil {
2570 res.Body.Close()
2571 }
2572 return nil, gensupport.WrapError(&googleapi.Error{
2573 Code: res.StatusCode,
2574 Header: res.Header,
2575 })
2576 }
2577 if err != nil {
2578 return nil, err
2579 }
2580 defer googleapi.CloseBody(res)
2581 if err := googleapi.CheckResponse(res); err != nil {
2582 return nil, gensupport.WrapError(err)
2583 }
2584 ret := &ListOrgPoliciesResponse{
2585 ServerResponse: googleapi.ServerResponse{
2586 Header: res.Header,
2587 HTTPStatusCode: res.StatusCode,
2588 },
2589 }
2590 target := &ret
2591 if err := gensupport.DecodeResponse(target, res); err != nil {
2592 return nil, err
2593 }
2594 return ret, nil
2595 }
2596
2597
2598
2599
2600 func (c *FoldersListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error {
2601 c.ctx_ = ctx
2602 defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken)
2603 for {
2604 x, err := c.Do()
2605 if err != nil {
2606 return err
2607 }
2608 if err := f(x); err != nil {
2609 return err
2610 }
2611 if x.NextPageToken == "" {
2612 return nil
2613 }
2614 c.listorgpoliciesrequest.PageToken = x.NextPageToken
2615 }
2616 }
2617
2618 type FoldersSetOrgPolicyCall struct {
2619 s *Service
2620 resource string
2621 setorgpolicyrequest *SetOrgPolicyRequest
2622 urlParams_ gensupport.URLParams
2623 ctx_ context.Context
2624 header_ http.Header
2625 }
2626
2627
2628
2629
2630
2631
2632
2633 func (r *FoldersService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *FoldersSetOrgPolicyCall {
2634 c := &FoldersSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2635 c.resource = resource
2636 c.setorgpolicyrequest = setorgpolicyrequest
2637 return c
2638 }
2639
2640
2641
2642
2643 func (c *FoldersSetOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersSetOrgPolicyCall {
2644 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2645 return c
2646 }
2647
2648
2649 func (c *FoldersSetOrgPolicyCall) Context(ctx context.Context) *FoldersSetOrgPolicyCall {
2650 c.ctx_ = ctx
2651 return c
2652 }
2653
2654
2655
2656 func (c *FoldersSetOrgPolicyCall) Header() http.Header {
2657 if c.header_ == nil {
2658 c.header_ = make(http.Header)
2659 }
2660 return c.header_
2661 }
2662
2663 func (c *FoldersSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
2664 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2665 var body io.Reader = nil
2666 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest)
2667 if err != nil {
2668 return nil, err
2669 }
2670 c.urlParams_.Set("alt", alt)
2671 c.urlParams_.Set("prettyPrint", "false")
2672 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy")
2673 urls += "?" + c.urlParams_.Encode()
2674 req, err := http.NewRequest("POST", urls, body)
2675 if err != nil {
2676 return nil, err
2677 }
2678 req.Header = reqHeaders
2679 googleapi.Expand(req.URL, map[string]string{
2680 "resource": c.resource,
2681 })
2682 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2683 }
2684
2685
2686
2687
2688
2689
2690 func (c *FoldersSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
2691 gensupport.SetOptions(c.urlParams_, opts...)
2692 res, err := c.doRequest("json")
2693 if res != nil && res.StatusCode == http.StatusNotModified {
2694 if res.Body != nil {
2695 res.Body.Close()
2696 }
2697 return nil, gensupport.WrapError(&googleapi.Error{
2698 Code: res.StatusCode,
2699 Header: res.Header,
2700 })
2701 }
2702 if err != nil {
2703 return nil, err
2704 }
2705 defer googleapi.CloseBody(res)
2706 if err := googleapi.CheckResponse(res); err != nil {
2707 return nil, gensupport.WrapError(err)
2708 }
2709 ret := &OrgPolicy{
2710 ServerResponse: googleapi.ServerResponse{
2711 Header: res.Header,
2712 HTTPStatusCode: res.StatusCode,
2713 },
2714 }
2715 target := &ret
2716 if err := gensupport.DecodeResponse(target, res); err != nil {
2717 return nil, err
2718 }
2719 return ret, nil
2720 }
2721
2722 type LiensCreateCall struct {
2723 s *Service
2724 lien *Lien
2725 urlParams_ gensupport.URLParams
2726 ctx_ context.Context
2727 header_ http.Header
2728 }
2729
2730
2731
2732
2733
2734
2735 func (r *LiensService) Create(lien *Lien) *LiensCreateCall {
2736 c := &LiensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2737 c.lien = lien
2738 return c
2739 }
2740
2741
2742
2743
2744 func (c *LiensCreateCall) Fields(s ...googleapi.Field) *LiensCreateCall {
2745 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2746 return c
2747 }
2748
2749
2750 func (c *LiensCreateCall) Context(ctx context.Context) *LiensCreateCall {
2751 c.ctx_ = ctx
2752 return c
2753 }
2754
2755
2756
2757 func (c *LiensCreateCall) Header() http.Header {
2758 if c.header_ == nil {
2759 c.header_ = make(http.Header)
2760 }
2761 return c.header_
2762 }
2763
2764 func (c *LiensCreateCall) doRequest(alt string) (*http.Response, error) {
2765 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2766 var body io.Reader = nil
2767 body, err := googleapi.WithoutDataWrapper.JSONReader(c.lien)
2768 if err != nil {
2769 return nil, err
2770 }
2771 c.urlParams_.Set("alt", alt)
2772 c.urlParams_.Set("prettyPrint", "false")
2773 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens")
2774 urls += "?" + c.urlParams_.Encode()
2775 req, err := http.NewRequest("POST", urls, body)
2776 if err != nil {
2777 return nil, err
2778 }
2779 req.Header = reqHeaders
2780 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2781 }
2782
2783
2784
2785
2786
2787
2788 func (c *LiensCreateCall) Do(opts ...googleapi.CallOption) (*Lien, error) {
2789 gensupport.SetOptions(c.urlParams_, opts...)
2790 res, err := c.doRequest("json")
2791 if res != nil && res.StatusCode == http.StatusNotModified {
2792 if res.Body != nil {
2793 res.Body.Close()
2794 }
2795 return nil, gensupport.WrapError(&googleapi.Error{
2796 Code: res.StatusCode,
2797 Header: res.Header,
2798 })
2799 }
2800 if err != nil {
2801 return nil, err
2802 }
2803 defer googleapi.CloseBody(res)
2804 if err := googleapi.CheckResponse(res); err != nil {
2805 return nil, gensupport.WrapError(err)
2806 }
2807 ret := &Lien{
2808 ServerResponse: googleapi.ServerResponse{
2809 Header: res.Header,
2810 HTTPStatusCode: res.StatusCode,
2811 },
2812 }
2813 target := &ret
2814 if err := gensupport.DecodeResponse(target, res); err != nil {
2815 return nil, err
2816 }
2817 return ret, nil
2818 }
2819
2820 type LiensDeleteCall struct {
2821 s *Service
2822 nameid string
2823 urlParams_ gensupport.URLParams
2824 ctx_ context.Context
2825 header_ http.Header
2826 }
2827
2828
2829
2830
2831
2832
2833 func (r *LiensService) Delete(nameid string) *LiensDeleteCall {
2834 c := &LiensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2835 c.nameid = nameid
2836 return c
2837 }
2838
2839
2840
2841
2842 func (c *LiensDeleteCall) Fields(s ...googleapi.Field) *LiensDeleteCall {
2843 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2844 return c
2845 }
2846
2847
2848 func (c *LiensDeleteCall) Context(ctx context.Context) *LiensDeleteCall {
2849 c.ctx_ = ctx
2850 return c
2851 }
2852
2853
2854
2855 func (c *LiensDeleteCall) Header() http.Header {
2856 if c.header_ == nil {
2857 c.header_ = make(http.Header)
2858 }
2859 return c.header_
2860 }
2861
2862 func (c *LiensDeleteCall) doRequest(alt string) (*http.Response, error) {
2863 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2864 var body io.Reader = nil
2865 c.urlParams_.Set("alt", alt)
2866 c.urlParams_.Set("prettyPrint", "false")
2867 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2868 urls += "?" + c.urlParams_.Encode()
2869 req, err := http.NewRequest("DELETE", urls, body)
2870 if err != nil {
2871 return nil, err
2872 }
2873 req.Header = reqHeaders
2874 googleapi.Expand(req.URL, map[string]string{
2875 "name": c.nameid,
2876 })
2877 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2878 }
2879
2880
2881
2882
2883
2884
2885 func (c *LiensDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2886 gensupport.SetOptions(c.urlParams_, opts...)
2887 res, err := c.doRequest("json")
2888 if res != nil && res.StatusCode == http.StatusNotModified {
2889 if res.Body != nil {
2890 res.Body.Close()
2891 }
2892 return nil, gensupport.WrapError(&googleapi.Error{
2893 Code: res.StatusCode,
2894 Header: res.Header,
2895 })
2896 }
2897 if err != nil {
2898 return nil, err
2899 }
2900 defer googleapi.CloseBody(res)
2901 if err := googleapi.CheckResponse(res); err != nil {
2902 return nil, gensupport.WrapError(err)
2903 }
2904 ret := &Empty{
2905 ServerResponse: googleapi.ServerResponse{
2906 Header: res.Header,
2907 HTTPStatusCode: res.StatusCode,
2908 },
2909 }
2910 target := &ret
2911 if err := gensupport.DecodeResponse(target, res); err != nil {
2912 return nil, err
2913 }
2914 return ret, nil
2915 }
2916
2917 type LiensGetCall struct {
2918 s *Service
2919 nameid string
2920 urlParams_ gensupport.URLParams
2921 ifNoneMatch_ string
2922 ctx_ context.Context
2923 header_ http.Header
2924 }
2925
2926
2927
2928
2929
2930
2931 func (r *LiensService) Get(nameid string) *LiensGetCall {
2932 c := &LiensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2933 c.nameid = nameid
2934 return c
2935 }
2936
2937
2938
2939
2940 func (c *LiensGetCall) Fields(s ...googleapi.Field) *LiensGetCall {
2941 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2942 return c
2943 }
2944
2945
2946
2947
2948 func (c *LiensGetCall) IfNoneMatch(entityTag string) *LiensGetCall {
2949 c.ifNoneMatch_ = entityTag
2950 return c
2951 }
2952
2953
2954 func (c *LiensGetCall) Context(ctx context.Context) *LiensGetCall {
2955 c.ctx_ = ctx
2956 return c
2957 }
2958
2959
2960
2961 func (c *LiensGetCall) Header() http.Header {
2962 if c.header_ == nil {
2963 c.header_ = make(http.Header)
2964 }
2965 return c.header_
2966 }
2967
2968 func (c *LiensGetCall) doRequest(alt string) (*http.Response, error) {
2969 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2970 if c.ifNoneMatch_ != "" {
2971 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2972 }
2973 var body io.Reader = nil
2974 c.urlParams_.Set("alt", alt)
2975 c.urlParams_.Set("prettyPrint", "false")
2976 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2977 urls += "?" + c.urlParams_.Encode()
2978 req, err := http.NewRequest("GET", urls, body)
2979 if err != nil {
2980 return nil, err
2981 }
2982 req.Header = reqHeaders
2983 googleapi.Expand(req.URL, map[string]string{
2984 "name": c.nameid,
2985 })
2986 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2987 }
2988
2989
2990
2991
2992
2993
2994 func (c *LiensGetCall) Do(opts ...googleapi.CallOption) (*Lien, error) {
2995 gensupport.SetOptions(c.urlParams_, opts...)
2996 res, err := c.doRequest("json")
2997 if res != nil && res.StatusCode == http.StatusNotModified {
2998 if res.Body != nil {
2999 res.Body.Close()
3000 }
3001 return nil, gensupport.WrapError(&googleapi.Error{
3002 Code: res.StatusCode,
3003 Header: res.Header,
3004 })
3005 }
3006 if err != nil {
3007 return nil, err
3008 }
3009 defer googleapi.CloseBody(res)
3010 if err := googleapi.CheckResponse(res); err != nil {
3011 return nil, gensupport.WrapError(err)
3012 }
3013 ret := &Lien{
3014 ServerResponse: googleapi.ServerResponse{
3015 Header: res.Header,
3016 HTTPStatusCode: res.StatusCode,
3017 },
3018 }
3019 target := &ret
3020 if err := gensupport.DecodeResponse(target, res); err != nil {
3021 return nil, err
3022 }
3023 return ret, nil
3024 }
3025
3026 type LiensListCall struct {
3027 s *Service
3028 urlParams_ gensupport.URLParams
3029 ifNoneMatch_ string
3030 ctx_ context.Context
3031 header_ http.Header
3032 }
3033
3034
3035
3036
3037
3038 func (r *LiensService) List() *LiensListCall {
3039 c := &LiensListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3040 return c
3041 }
3042
3043
3044
3045
3046 func (c *LiensListCall) PageSize(pageSize int64) *LiensListCall {
3047 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3048 return c
3049 }
3050
3051
3052
3053 func (c *LiensListCall) PageToken(pageToken string) *LiensListCall {
3054 c.urlParams_.Set("pageToken", pageToken)
3055 return c
3056 }
3057
3058
3059
3060
3061
3062
3063 func (c *LiensListCall) Parent(parent string) *LiensListCall {
3064 c.urlParams_.Set("parent", parent)
3065 return c
3066 }
3067
3068
3069
3070
3071 func (c *LiensListCall) Fields(s ...googleapi.Field) *LiensListCall {
3072 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3073 return c
3074 }
3075
3076
3077
3078
3079 func (c *LiensListCall) IfNoneMatch(entityTag string) *LiensListCall {
3080 c.ifNoneMatch_ = entityTag
3081 return c
3082 }
3083
3084
3085 func (c *LiensListCall) Context(ctx context.Context) *LiensListCall {
3086 c.ctx_ = ctx
3087 return c
3088 }
3089
3090
3091
3092 func (c *LiensListCall) Header() http.Header {
3093 if c.header_ == nil {
3094 c.header_ = make(http.Header)
3095 }
3096 return c.header_
3097 }
3098
3099 func (c *LiensListCall) doRequest(alt string) (*http.Response, error) {
3100 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3101 if c.ifNoneMatch_ != "" {
3102 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3103 }
3104 var body io.Reader = nil
3105 c.urlParams_.Set("alt", alt)
3106 c.urlParams_.Set("prettyPrint", "false")
3107 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens")
3108 urls += "?" + c.urlParams_.Encode()
3109 req, err := http.NewRequest("GET", urls, body)
3110 if err != nil {
3111 return nil, err
3112 }
3113 req.Header = reqHeaders
3114 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3115 }
3116
3117
3118
3119
3120
3121
3122
3123 func (c *LiensListCall) Do(opts ...googleapi.CallOption) (*ListLiensResponse, error) {
3124 gensupport.SetOptions(c.urlParams_, opts...)
3125 res, err := c.doRequest("json")
3126 if res != nil && res.StatusCode == http.StatusNotModified {
3127 if res.Body != nil {
3128 res.Body.Close()
3129 }
3130 return nil, gensupport.WrapError(&googleapi.Error{
3131 Code: res.StatusCode,
3132 Header: res.Header,
3133 })
3134 }
3135 if err != nil {
3136 return nil, err
3137 }
3138 defer googleapi.CloseBody(res)
3139 if err := googleapi.CheckResponse(res); err != nil {
3140 return nil, gensupport.WrapError(err)
3141 }
3142 ret := &ListLiensResponse{
3143 ServerResponse: googleapi.ServerResponse{
3144 Header: res.Header,
3145 HTTPStatusCode: res.StatusCode,
3146 },
3147 }
3148 target := &ret
3149 if err := gensupport.DecodeResponse(target, res); err != nil {
3150 return nil, err
3151 }
3152 return ret, nil
3153 }
3154
3155
3156
3157
3158 func (c *LiensListCall) Pages(ctx context.Context, f func(*ListLiensResponse) error) error {
3159 c.ctx_ = ctx
3160 defer c.PageToken(c.urlParams_.Get("pageToken"))
3161 for {
3162 x, err := c.Do()
3163 if err != nil {
3164 return err
3165 }
3166 if err := f(x); err != nil {
3167 return err
3168 }
3169 if x.NextPageToken == "" {
3170 return nil
3171 }
3172 c.PageToken(x.NextPageToken)
3173 }
3174 }
3175
3176 type OperationsGetCall struct {
3177 s *Service
3178 name string
3179 urlParams_ gensupport.URLParams
3180 ifNoneMatch_ string
3181 ctx_ context.Context
3182 header_ http.Header
3183 }
3184
3185
3186
3187
3188
3189
3190 func (r *OperationsService) Get(name string) *OperationsGetCall {
3191 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3192 c.name = name
3193 return c
3194 }
3195
3196
3197
3198
3199 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
3200 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3201 return c
3202 }
3203
3204
3205
3206
3207 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
3208 c.ifNoneMatch_ = entityTag
3209 return c
3210 }
3211
3212
3213 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
3214 c.ctx_ = ctx
3215 return c
3216 }
3217
3218
3219
3220 func (c *OperationsGetCall) Header() http.Header {
3221 if c.header_ == nil {
3222 c.header_ = make(http.Header)
3223 }
3224 return c.header_
3225 }
3226
3227 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
3228 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3229 if c.ifNoneMatch_ != "" {
3230 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3231 }
3232 var body io.Reader = nil
3233 c.urlParams_.Set("alt", alt)
3234 c.urlParams_.Set("prettyPrint", "false")
3235 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3236 urls += "?" + c.urlParams_.Encode()
3237 req, err := http.NewRequest("GET", urls, body)
3238 if err != nil {
3239 return nil, err
3240 }
3241 req.Header = reqHeaders
3242 googleapi.Expand(req.URL, map[string]string{
3243 "name": c.name,
3244 })
3245 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3246 }
3247
3248
3249
3250
3251
3252
3253 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3254 gensupport.SetOptions(c.urlParams_, opts...)
3255 res, err := c.doRequest("json")
3256 if res != nil && res.StatusCode == http.StatusNotModified {
3257 if res.Body != nil {
3258 res.Body.Close()
3259 }
3260 return nil, gensupport.WrapError(&googleapi.Error{
3261 Code: res.StatusCode,
3262 Header: res.Header,
3263 })
3264 }
3265 if err != nil {
3266 return nil, err
3267 }
3268 defer googleapi.CloseBody(res)
3269 if err := googleapi.CheckResponse(res); err != nil {
3270 return nil, gensupport.WrapError(err)
3271 }
3272 ret := &Operation{
3273 ServerResponse: googleapi.ServerResponse{
3274 Header: res.Header,
3275 HTTPStatusCode: res.StatusCode,
3276 },
3277 }
3278 target := &ret
3279 if err := gensupport.DecodeResponse(target, res); err != nil {
3280 return nil, err
3281 }
3282 return ret, nil
3283 }
3284
3285 type OrganizationsClearOrgPolicyCall struct {
3286 s *Service
3287 resource string
3288 clearorgpolicyrequest *ClearOrgPolicyRequest
3289 urlParams_ gensupport.URLParams
3290 ctx_ context.Context
3291 header_ http.Header
3292 }
3293
3294
3295
3296
3297 func (r *OrganizationsService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *OrganizationsClearOrgPolicyCall {
3298 c := &OrganizationsClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3299 c.resource = resource
3300 c.clearorgpolicyrequest = clearorgpolicyrequest
3301 return c
3302 }
3303
3304
3305
3306
3307 func (c *OrganizationsClearOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsClearOrgPolicyCall {
3308 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3309 return c
3310 }
3311
3312
3313 func (c *OrganizationsClearOrgPolicyCall) Context(ctx context.Context) *OrganizationsClearOrgPolicyCall {
3314 c.ctx_ = ctx
3315 return c
3316 }
3317
3318
3319
3320 func (c *OrganizationsClearOrgPolicyCall) Header() http.Header {
3321 if c.header_ == nil {
3322 c.header_ = make(http.Header)
3323 }
3324 return c.header_
3325 }
3326
3327 func (c *OrganizationsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
3328 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3329 var body io.Reader = nil
3330 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest)
3331 if err != nil {
3332 return nil, err
3333 }
3334 c.urlParams_.Set("alt", alt)
3335 c.urlParams_.Set("prettyPrint", "false")
3336 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy")
3337 urls += "?" + c.urlParams_.Encode()
3338 req, err := http.NewRequest("POST", urls, body)
3339 if err != nil {
3340 return nil, err
3341 }
3342 req.Header = reqHeaders
3343 googleapi.Expand(req.URL, map[string]string{
3344 "resource": c.resource,
3345 })
3346 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3347 }
3348
3349
3350
3351
3352
3353
3354 func (c *OrganizationsClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3355 gensupport.SetOptions(c.urlParams_, opts...)
3356 res, err := c.doRequest("json")
3357 if res != nil && res.StatusCode == http.StatusNotModified {
3358 if res.Body != nil {
3359 res.Body.Close()
3360 }
3361 return nil, gensupport.WrapError(&googleapi.Error{
3362 Code: res.StatusCode,
3363 Header: res.Header,
3364 })
3365 }
3366 if err != nil {
3367 return nil, err
3368 }
3369 defer googleapi.CloseBody(res)
3370 if err := googleapi.CheckResponse(res); err != nil {
3371 return nil, gensupport.WrapError(err)
3372 }
3373 ret := &Empty{
3374 ServerResponse: googleapi.ServerResponse{
3375 Header: res.Header,
3376 HTTPStatusCode: res.StatusCode,
3377 },
3378 }
3379 target := &ret
3380 if err := gensupport.DecodeResponse(target, res); err != nil {
3381 return nil, err
3382 }
3383 return ret, nil
3384 }
3385
3386 type OrganizationsGetCall struct {
3387 s *Service
3388 name string
3389 urlParams_ gensupport.URLParams
3390 ifNoneMatch_ string
3391 ctx_ context.Context
3392 header_ http.Header
3393 }
3394
3395
3396
3397
3398
3399
3400
3401 func (r *OrganizationsService) Get(name string) *OrganizationsGetCall {
3402 c := &OrganizationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3403 c.name = name
3404 return c
3405 }
3406
3407
3408
3409
3410 func (c *OrganizationsGetCall) Fields(s ...googleapi.Field) *OrganizationsGetCall {
3411 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3412 return c
3413 }
3414
3415
3416
3417
3418 func (c *OrganizationsGetCall) IfNoneMatch(entityTag string) *OrganizationsGetCall {
3419 c.ifNoneMatch_ = entityTag
3420 return c
3421 }
3422
3423
3424 func (c *OrganizationsGetCall) Context(ctx context.Context) *OrganizationsGetCall {
3425 c.ctx_ = ctx
3426 return c
3427 }
3428
3429
3430
3431 func (c *OrganizationsGetCall) Header() http.Header {
3432 if c.header_ == nil {
3433 c.header_ = make(http.Header)
3434 }
3435 return c.header_
3436 }
3437
3438 func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) {
3439 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3440 if c.ifNoneMatch_ != "" {
3441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3442 }
3443 var body io.Reader = nil
3444 c.urlParams_.Set("alt", alt)
3445 c.urlParams_.Set("prettyPrint", "false")
3446 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3447 urls += "?" + c.urlParams_.Encode()
3448 req, err := http.NewRequest("GET", urls, body)
3449 if err != nil {
3450 return nil, err
3451 }
3452 req.Header = reqHeaders
3453 googleapi.Expand(req.URL, map[string]string{
3454 "name": c.name,
3455 })
3456 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3457 }
3458
3459
3460
3461
3462
3463
3464 func (c *OrganizationsGetCall) Do(opts ...googleapi.CallOption) (*Organization, error) {
3465 gensupport.SetOptions(c.urlParams_, opts...)
3466 res, err := c.doRequest("json")
3467 if res != nil && res.StatusCode == http.StatusNotModified {
3468 if res.Body != nil {
3469 res.Body.Close()
3470 }
3471 return nil, gensupport.WrapError(&googleapi.Error{
3472 Code: res.StatusCode,
3473 Header: res.Header,
3474 })
3475 }
3476 if err != nil {
3477 return nil, err
3478 }
3479 defer googleapi.CloseBody(res)
3480 if err := googleapi.CheckResponse(res); err != nil {
3481 return nil, gensupport.WrapError(err)
3482 }
3483 ret := &Organization{
3484 ServerResponse: googleapi.ServerResponse{
3485 Header: res.Header,
3486 HTTPStatusCode: res.StatusCode,
3487 },
3488 }
3489 target := &ret
3490 if err := gensupport.DecodeResponse(target, res); err != nil {
3491 return nil, err
3492 }
3493 return ret, nil
3494 }
3495
3496 type OrganizationsGetEffectiveOrgPolicyCall struct {
3497 s *Service
3498 resource string
3499 geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest
3500 urlParams_ gensupport.URLParams
3501 ctx_ context.Context
3502 header_ http.Header
3503 }
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513 func (r *OrganizationsService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *OrganizationsGetEffectiveOrgPolicyCall {
3514 c := &OrganizationsGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3515 c.resource = resource
3516 c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest
3517 return c
3518 }
3519
3520
3521
3522
3523 func (c *OrganizationsGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetEffectiveOrgPolicyCall {
3524 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3525 return c
3526 }
3527
3528
3529 func (c *OrganizationsGetEffectiveOrgPolicyCall) Context(ctx context.Context) *OrganizationsGetEffectiveOrgPolicyCall {
3530 c.ctx_ = ctx
3531 return c
3532 }
3533
3534
3535
3536 func (c *OrganizationsGetEffectiveOrgPolicyCall) Header() http.Header {
3537 if c.header_ == nil {
3538 c.header_ = make(http.Header)
3539 }
3540 return c.header_
3541 }
3542
3543 func (c *OrganizationsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
3544 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3545 var body io.Reader = nil
3546 body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest)
3547 if err != nil {
3548 return nil, err
3549 }
3550 c.urlParams_.Set("alt", alt)
3551 c.urlParams_.Set("prettyPrint", "false")
3552 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy")
3553 urls += "?" + c.urlParams_.Encode()
3554 req, err := http.NewRequest("POST", urls, body)
3555 if err != nil {
3556 return nil, err
3557 }
3558 req.Header = reqHeaders
3559 googleapi.Expand(req.URL, map[string]string{
3560 "resource": c.resource,
3561 })
3562 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3563 }
3564
3565
3566
3567
3568
3569
3570 func (c *OrganizationsGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
3571 gensupport.SetOptions(c.urlParams_, opts...)
3572 res, err := c.doRequest("json")
3573 if res != nil && res.StatusCode == http.StatusNotModified {
3574 if res.Body != nil {
3575 res.Body.Close()
3576 }
3577 return nil, gensupport.WrapError(&googleapi.Error{
3578 Code: res.StatusCode,
3579 Header: res.Header,
3580 })
3581 }
3582 if err != nil {
3583 return nil, err
3584 }
3585 defer googleapi.CloseBody(res)
3586 if err := googleapi.CheckResponse(res); err != nil {
3587 return nil, gensupport.WrapError(err)
3588 }
3589 ret := &OrgPolicy{
3590 ServerResponse: googleapi.ServerResponse{
3591 Header: res.Header,
3592 HTTPStatusCode: res.StatusCode,
3593 },
3594 }
3595 target := &ret
3596 if err := gensupport.DecodeResponse(target, res); err != nil {
3597 return nil, err
3598 }
3599 return ret, nil
3600 }
3601
3602 type OrganizationsGetIamPolicyCall struct {
3603 s *Service
3604 resource string
3605 getiampolicyrequest *GetIamPolicyRequest
3606 urlParams_ gensupport.URLParams
3607 ctx_ context.Context
3608 header_ http.Header
3609 }
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620 func (r *OrganizationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsGetIamPolicyCall {
3621 c := &OrganizationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3622 c.resource = resource
3623 c.getiampolicyrequest = getiampolicyrequest
3624 return c
3625 }
3626
3627
3628
3629
3630 func (c *OrganizationsGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetIamPolicyCall {
3631 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3632 return c
3633 }
3634
3635
3636 func (c *OrganizationsGetIamPolicyCall) Context(ctx context.Context) *OrganizationsGetIamPolicyCall {
3637 c.ctx_ = ctx
3638 return c
3639 }
3640
3641
3642
3643 func (c *OrganizationsGetIamPolicyCall) Header() http.Header {
3644 if c.header_ == nil {
3645 c.header_ = make(http.Header)
3646 }
3647 return c.header_
3648 }
3649
3650 func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3651 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3652 var body io.Reader = nil
3653 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
3654 if err != nil {
3655 return nil, err
3656 }
3657 c.urlParams_.Set("alt", alt)
3658 c.urlParams_.Set("prettyPrint", "false")
3659 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
3660 urls += "?" + c.urlParams_.Encode()
3661 req, err := http.NewRequest("POST", urls, body)
3662 if err != nil {
3663 return nil, err
3664 }
3665 req.Header = reqHeaders
3666 googleapi.Expand(req.URL, map[string]string{
3667 "resource": c.resource,
3668 })
3669 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3670 }
3671
3672
3673
3674
3675
3676
3677 func (c *OrganizationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3678 gensupport.SetOptions(c.urlParams_, opts...)
3679 res, err := c.doRequest("json")
3680 if res != nil && res.StatusCode == http.StatusNotModified {
3681 if res.Body != nil {
3682 res.Body.Close()
3683 }
3684 return nil, gensupport.WrapError(&googleapi.Error{
3685 Code: res.StatusCode,
3686 Header: res.Header,
3687 })
3688 }
3689 if err != nil {
3690 return nil, err
3691 }
3692 defer googleapi.CloseBody(res)
3693 if err := googleapi.CheckResponse(res); err != nil {
3694 return nil, gensupport.WrapError(err)
3695 }
3696 ret := &Policy{
3697 ServerResponse: googleapi.ServerResponse{
3698 Header: res.Header,
3699 HTTPStatusCode: res.StatusCode,
3700 },
3701 }
3702 target := &ret
3703 if err := gensupport.DecodeResponse(target, res); err != nil {
3704 return nil, err
3705 }
3706 return ret, nil
3707 }
3708
3709 type OrganizationsGetOrgPolicyCall struct {
3710 s *Service
3711 resource string
3712 getorgpolicyrequest *GetOrgPolicyRequest
3713 urlParams_ gensupport.URLParams
3714 ctx_ context.Context
3715 header_ http.Header
3716 }
3717
3718
3719
3720
3721
3722
3723
3724
3725 func (r *OrganizationsService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *OrganizationsGetOrgPolicyCall {
3726 c := &OrganizationsGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3727 c.resource = resource
3728 c.getorgpolicyrequest = getorgpolicyrequest
3729 return c
3730 }
3731
3732
3733
3734
3735 func (c *OrganizationsGetOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetOrgPolicyCall {
3736 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3737 return c
3738 }
3739
3740
3741 func (c *OrganizationsGetOrgPolicyCall) Context(ctx context.Context) *OrganizationsGetOrgPolicyCall {
3742 c.ctx_ = ctx
3743 return c
3744 }
3745
3746
3747
3748 func (c *OrganizationsGetOrgPolicyCall) Header() http.Header {
3749 if c.header_ == nil {
3750 c.header_ = make(http.Header)
3751 }
3752 return c.header_
3753 }
3754
3755 func (c *OrganizationsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
3756 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3757 var body io.Reader = nil
3758 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest)
3759 if err != nil {
3760 return nil, err
3761 }
3762 c.urlParams_.Set("alt", alt)
3763 c.urlParams_.Set("prettyPrint", "false")
3764 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy")
3765 urls += "?" + c.urlParams_.Encode()
3766 req, err := http.NewRequest("POST", urls, body)
3767 if err != nil {
3768 return nil, err
3769 }
3770 req.Header = reqHeaders
3771 googleapi.Expand(req.URL, map[string]string{
3772 "resource": c.resource,
3773 })
3774 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3775 }
3776
3777
3778
3779
3780
3781
3782 func (c *OrganizationsGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
3783 gensupport.SetOptions(c.urlParams_, opts...)
3784 res, err := c.doRequest("json")
3785 if res != nil && res.StatusCode == http.StatusNotModified {
3786 if res.Body != nil {
3787 res.Body.Close()
3788 }
3789 return nil, gensupport.WrapError(&googleapi.Error{
3790 Code: res.StatusCode,
3791 Header: res.Header,
3792 })
3793 }
3794 if err != nil {
3795 return nil, err
3796 }
3797 defer googleapi.CloseBody(res)
3798 if err := googleapi.CheckResponse(res); err != nil {
3799 return nil, gensupport.WrapError(err)
3800 }
3801 ret := &OrgPolicy{
3802 ServerResponse: googleapi.ServerResponse{
3803 Header: res.Header,
3804 HTTPStatusCode: res.StatusCode,
3805 },
3806 }
3807 target := &ret
3808 if err := gensupport.DecodeResponse(target, res); err != nil {
3809 return nil, err
3810 }
3811 return ret, nil
3812 }
3813
3814 type OrganizationsListAvailableOrgPolicyConstraintsCall struct {
3815 s *Service
3816 resource string
3817 listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest
3818 urlParams_ gensupport.URLParams
3819 ctx_ context.Context
3820 header_ http.Header
3821 }
3822
3823
3824
3825
3826
3827 func (r *OrganizationsService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *OrganizationsListAvailableOrgPolicyConstraintsCall {
3828 c := &OrganizationsListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3829 c.resource = resource
3830 c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest
3831 return c
3832 }
3833
3834
3835
3836
3837 func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *OrganizationsListAvailableOrgPolicyConstraintsCall {
3838 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3839 return c
3840 }
3841
3842
3843 func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *OrganizationsListAvailableOrgPolicyConstraintsCall {
3844 c.ctx_ = ctx
3845 return c
3846 }
3847
3848
3849
3850 func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Header() http.Header {
3851 if c.header_ == nil {
3852 c.header_ = make(http.Header)
3853 }
3854 return c.header_
3855 }
3856
3857 func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) {
3858 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3859 var body io.Reader = nil
3860 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest)
3861 if err != nil {
3862 return nil, err
3863 }
3864 c.urlParams_.Set("alt", alt)
3865 c.urlParams_.Set("prettyPrint", "false")
3866 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints")
3867 urls += "?" + c.urlParams_.Encode()
3868 req, err := http.NewRequest("POST", urls, body)
3869 if err != nil {
3870 return nil, err
3871 }
3872 req.Header = reqHeaders
3873 googleapi.Expand(req.URL, map[string]string{
3874 "resource": c.resource,
3875 })
3876 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3877 }
3878
3879
3880
3881
3882
3883
3884
3885 func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) {
3886 gensupport.SetOptions(c.urlParams_, opts...)
3887 res, err := c.doRequest("json")
3888 if res != nil && res.StatusCode == http.StatusNotModified {
3889 if res.Body != nil {
3890 res.Body.Close()
3891 }
3892 return nil, gensupport.WrapError(&googleapi.Error{
3893 Code: res.StatusCode,
3894 Header: res.Header,
3895 })
3896 }
3897 if err != nil {
3898 return nil, err
3899 }
3900 defer googleapi.CloseBody(res)
3901 if err := googleapi.CheckResponse(res); err != nil {
3902 return nil, gensupport.WrapError(err)
3903 }
3904 ret := &ListAvailableOrgPolicyConstraintsResponse{
3905 ServerResponse: googleapi.ServerResponse{
3906 Header: res.Header,
3907 HTTPStatusCode: res.StatusCode,
3908 },
3909 }
3910 target := &ret
3911 if err := gensupport.DecodeResponse(target, res); err != nil {
3912 return nil, err
3913 }
3914 return ret, nil
3915 }
3916
3917
3918
3919
3920 func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error {
3921 c.ctx_ = ctx
3922 defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken)
3923 for {
3924 x, err := c.Do()
3925 if err != nil {
3926 return err
3927 }
3928 if err := f(x); err != nil {
3929 return err
3930 }
3931 if x.NextPageToken == "" {
3932 return nil
3933 }
3934 c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken
3935 }
3936 }
3937
3938 type OrganizationsListOrgPoliciesCall struct {
3939 s *Service
3940 resource string
3941 listorgpoliciesrequest *ListOrgPoliciesRequest
3942 urlParams_ gensupport.URLParams
3943 ctx_ context.Context
3944 header_ http.Header
3945 }
3946
3947
3948
3949
3950 func (r *OrganizationsService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *OrganizationsListOrgPoliciesCall {
3951 c := &OrganizationsListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3952 c.resource = resource
3953 c.listorgpoliciesrequest = listorgpoliciesrequest
3954 return c
3955 }
3956
3957
3958
3959
3960 func (c *OrganizationsListOrgPoliciesCall) Fields(s ...googleapi.Field) *OrganizationsListOrgPoliciesCall {
3961 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3962 return c
3963 }
3964
3965
3966 func (c *OrganizationsListOrgPoliciesCall) Context(ctx context.Context) *OrganizationsListOrgPoliciesCall {
3967 c.ctx_ = ctx
3968 return c
3969 }
3970
3971
3972
3973 func (c *OrganizationsListOrgPoliciesCall) Header() http.Header {
3974 if c.header_ == nil {
3975 c.header_ = make(http.Header)
3976 }
3977 return c.header_
3978 }
3979
3980 func (c *OrganizationsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) {
3981 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3982 var body io.Reader = nil
3983 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest)
3984 if err != nil {
3985 return nil, err
3986 }
3987 c.urlParams_.Set("alt", alt)
3988 c.urlParams_.Set("prettyPrint", "false")
3989 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies")
3990 urls += "?" + c.urlParams_.Encode()
3991 req, err := http.NewRequest("POST", urls, body)
3992 if err != nil {
3993 return nil, err
3994 }
3995 req.Header = reqHeaders
3996 googleapi.Expand(req.URL, map[string]string{
3997 "resource": c.resource,
3998 })
3999 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4000 }
4001
4002
4003
4004
4005
4006
4007
4008 func (c *OrganizationsListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) {
4009 gensupport.SetOptions(c.urlParams_, opts...)
4010 res, err := c.doRequest("json")
4011 if res != nil && res.StatusCode == http.StatusNotModified {
4012 if res.Body != nil {
4013 res.Body.Close()
4014 }
4015 return nil, gensupport.WrapError(&googleapi.Error{
4016 Code: res.StatusCode,
4017 Header: res.Header,
4018 })
4019 }
4020 if err != nil {
4021 return nil, err
4022 }
4023 defer googleapi.CloseBody(res)
4024 if err := googleapi.CheckResponse(res); err != nil {
4025 return nil, gensupport.WrapError(err)
4026 }
4027 ret := &ListOrgPoliciesResponse{
4028 ServerResponse: googleapi.ServerResponse{
4029 Header: res.Header,
4030 HTTPStatusCode: res.StatusCode,
4031 },
4032 }
4033 target := &ret
4034 if err := gensupport.DecodeResponse(target, res); err != nil {
4035 return nil, err
4036 }
4037 return ret, nil
4038 }
4039
4040
4041
4042
4043 func (c *OrganizationsListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error {
4044 c.ctx_ = ctx
4045 defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken)
4046 for {
4047 x, err := c.Do()
4048 if err != nil {
4049 return err
4050 }
4051 if err := f(x); err != nil {
4052 return err
4053 }
4054 if x.NextPageToken == "" {
4055 return nil
4056 }
4057 c.listorgpoliciesrequest.PageToken = x.NextPageToken
4058 }
4059 }
4060
4061 type OrganizationsSearchCall struct {
4062 s *Service
4063 searchorganizationsrequest *SearchOrganizationsRequest
4064 urlParams_ gensupport.URLParams
4065 ctx_ context.Context
4066 header_ http.Header
4067 }
4068
4069
4070
4071
4072
4073
4074
4075 func (r *OrganizationsService) Search(searchorganizationsrequest *SearchOrganizationsRequest) *OrganizationsSearchCall {
4076 c := &OrganizationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4077 c.searchorganizationsrequest = searchorganizationsrequest
4078 return c
4079 }
4080
4081
4082
4083
4084 func (c *OrganizationsSearchCall) Fields(s ...googleapi.Field) *OrganizationsSearchCall {
4085 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4086 return c
4087 }
4088
4089
4090 func (c *OrganizationsSearchCall) Context(ctx context.Context) *OrganizationsSearchCall {
4091 c.ctx_ = ctx
4092 return c
4093 }
4094
4095
4096
4097 func (c *OrganizationsSearchCall) Header() http.Header {
4098 if c.header_ == nil {
4099 c.header_ = make(http.Header)
4100 }
4101 return c.header_
4102 }
4103
4104 func (c *OrganizationsSearchCall) doRequest(alt string) (*http.Response, error) {
4105 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4106 var body io.Reader = nil
4107 body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchorganizationsrequest)
4108 if err != nil {
4109 return nil, err
4110 }
4111 c.urlParams_.Set("alt", alt)
4112 c.urlParams_.Set("prettyPrint", "false")
4113 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/organizations:search")
4114 urls += "?" + c.urlParams_.Encode()
4115 req, err := http.NewRequest("POST", urls, body)
4116 if err != nil {
4117 return nil, err
4118 }
4119 req.Header = reqHeaders
4120 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4121 }
4122
4123
4124
4125
4126
4127
4128
4129 func (c *OrganizationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchOrganizationsResponse, error) {
4130 gensupport.SetOptions(c.urlParams_, opts...)
4131 res, err := c.doRequest("json")
4132 if res != nil && res.StatusCode == http.StatusNotModified {
4133 if res.Body != nil {
4134 res.Body.Close()
4135 }
4136 return nil, gensupport.WrapError(&googleapi.Error{
4137 Code: res.StatusCode,
4138 Header: res.Header,
4139 })
4140 }
4141 if err != nil {
4142 return nil, err
4143 }
4144 defer googleapi.CloseBody(res)
4145 if err := googleapi.CheckResponse(res); err != nil {
4146 return nil, gensupport.WrapError(err)
4147 }
4148 ret := &SearchOrganizationsResponse{
4149 ServerResponse: googleapi.ServerResponse{
4150 Header: res.Header,
4151 HTTPStatusCode: res.StatusCode,
4152 },
4153 }
4154 target := &ret
4155 if err := gensupport.DecodeResponse(target, res); err != nil {
4156 return nil, err
4157 }
4158 return ret, nil
4159 }
4160
4161
4162
4163
4164 func (c *OrganizationsSearchCall) Pages(ctx context.Context, f func(*SearchOrganizationsResponse) error) error {
4165 c.ctx_ = ctx
4166 defer func(pt string) { c.searchorganizationsrequest.PageToken = pt }(c.searchorganizationsrequest.PageToken)
4167 for {
4168 x, err := c.Do()
4169 if err != nil {
4170 return err
4171 }
4172 if err := f(x); err != nil {
4173 return err
4174 }
4175 if x.NextPageToken == "" {
4176 return nil
4177 }
4178 c.searchorganizationsrequest.PageToken = x.NextPageToken
4179 }
4180 }
4181
4182 type OrganizationsSetIamPolicyCall struct {
4183 s *Service
4184 resource string
4185 setiampolicyrequest *SetIamPolicyRequest
4186 urlParams_ gensupport.URLParams
4187 ctx_ context.Context
4188 header_ http.Header
4189 }
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200 func (r *OrganizationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSetIamPolicyCall {
4201 c := &OrganizationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4202 c.resource = resource
4203 c.setiampolicyrequest = setiampolicyrequest
4204 return c
4205 }
4206
4207
4208
4209
4210 func (c *OrganizationsSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetIamPolicyCall {
4211 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4212 return c
4213 }
4214
4215
4216 func (c *OrganizationsSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSetIamPolicyCall {
4217 c.ctx_ = ctx
4218 return c
4219 }
4220
4221
4222
4223 func (c *OrganizationsSetIamPolicyCall) Header() http.Header {
4224 if c.header_ == nil {
4225 c.header_ = make(http.Header)
4226 }
4227 return c.header_
4228 }
4229
4230 func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4231 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4232 var body io.Reader = nil
4233 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4234 if err != nil {
4235 return nil, err
4236 }
4237 c.urlParams_.Set("alt", alt)
4238 c.urlParams_.Set("prettyPrint", "false")
4239 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
4240 urls += "?" + c.urlParams_.Encode()
4241 req, err := http.NewRequest("POST", urls, body)
4242 if err != nil {
4243 return nil, err
4244 }
4245 req.Header = reqHeaders
4246 googleapi.Expand(req.URL, map[string]string{
4247 "resource": c.resource,
4248 })
4249 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4250 }
4251
4252
4253
4254
4255
4256
4257 func (c *OrganizationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4258 gensupport.SetOptions(c.urlParams_, opts...)
4259 res, err := c.doRequest("json")
4260 if res != nil && res.StatusCode == http.StatusNotModified {
4261 if res.Body != nil {
4262 res.Body.Close()
4263 }
4264 return nil, gensupport.WrapError(&googleapi.Error{
4265 Code: res.StatusCode,
4266 Header: res.Header,
4267 })
4268 }
4269 if err != nil {
4270 return nil, err
4271 }
4272 defer googleapi.CloseBody(res)
4273 if err := googleapi.CheckResponse(res); err != nil {
4274 return nil, gensupport.WrapError(err)
4275 }
4276 ret := &Policy{
4277 ServerResponse: googleapi.ServerResponse{
4278 Header: res.Header,
4279 HTTPStatusCode: res.StatusCode,
4280 },
4281 }
4282 target := &ret
4283 if err := gensupport.DecodeResponse(target, res); err != nil {
4284 return nil, err
4285 }
4286 return ret, nil
4287 }
4288
4289 type OrganizationsSetOrgPolicyCall struct {
4290 s *Service
4291 resource string
4292 setorgpolicyrequest *SetOrgPolicyRequest
4293 urlParams_ gensupport.URLParams
4294 ctx_ context.Context
4295 header_ http.Header
4296 }
4297
4298
4299
4300
4301
4302
4303
4304 func (r *OrganizationsService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *OrganizationsSetOrgPolicyCall {
4305 c := &OrganizationsSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4306 c.resource = resource
4307 c.setorgpolicyrequest = setorgpolicyrequest
4308 return c
4309 }
4310
4311
4312
4313
4314 func (c *OrganizationsSetOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetOrgPolicyCall {
4315 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4316 return c
4317 }
4318
4319
4320 func (c *OrganizationsSetOrgPolicyCall) Context(ctx context.Context) *OrganizationsSetOrgPolicyCall {
4321 c.ctx_ = ctx
4322 return c
4323 }
4324
4325
4326
4327 func (c *OrganizationsSetOrgPolicyCall) Header() http.Header {
4328 if c.header_ == nil {
4329 c.header_ = make(http.Header)
4330 }
4331 return c.header_
4332 }
4333
4334 func (c *OrganizationsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
4335 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4336 var body io.Reader = nil
4337 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest)
4338 if err != nil {
4339 return nil, err
4340 }
4341 c.urlParams_.Set("alt", alt)
4342 c.urlParams_.Set("prettyPrint", "false")
4343 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy")
4344 urls += "?" + c.urlParams_.Encode()
4345 req, err := http.NewRequest("POST", urls, body)
4346 if err != nil {
4347 return nil, err
4348 }
4349 req.Header = reqHeaders
4350 googleapi.Expand(req.URL, map[string]string{
4351 "resource": c.resource,
4352 })
4353 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4354 }
4355
4356
4357
4358
4359
4360
4361 func (c *OrganizationsSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
4362 gensupport.SetOptions(c.urlParams_, opts...)
4363 res, err := c.doRequest("json")
4364 if res != nil && res.StatusCode == http.StatusNotModified {
4365 if res.Body != nil {
4366 res.Body.Close()
4367 }
4368 return nil, gensupport.WrapError(&googleapi.Error{
4369 Code: res.StatusCode,
4370 Header: res.Header,
4371 })
4372 }
4373 if err != nil {
4374 return nil, err
4375 }
4376 defer googleapi.CloseBody(res)
4377 if err := googleapi.CheckResponse(res); err != nil {
4378 return nil, gensupport.WrapError(err)
4379 }
4380 ret := &OrgPolicy{
4381 ServerResponse: googleapi.ServerResponse{
4382 Header: res.Header,
4383 HTTPStatusCode: res.StatusCode,
4384 },
4385 }
4386 target := &ret
4387 if err := gensupport.DecodeResponse(target, res); err != nil {
4388 return nil, err
4389 }
4390 return ret, nil
4391 }
4392
4393 type OrganizationsTestIamPermissionsCall struct {
4394 s *Service
4395 resource string
4396 testiampermissionsrequest *TestIamPermissionsRequest
4397 urlParams_ gensupport.URLParams
4398 ctx_ context.Context
4399 header_ http.Header
4400 }
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411 func (r *OrganizationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsTestIamPermissionsCall {
4412 c := &OrganizationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4413 c.resource = resource
4414 c.testiampermissionsrequest = testiampermissionsrequest
4415 return c
4416 }
4417
4418
4419
4420
4421 func (c *OrganizationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsTestIamPermissionsCall {
4422 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4423 return c
4424 }
4425
4426
4427 func (c *OrganizationsTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsTestIamPermissionsCall {
4428 c.ctx_ = ctx
4429 return c
4430 }
4431
4432
4433
4434 func (c *OrganizationsTestIamPermissionsCall) Header() http.Header {
4435 if c.header_ == nil {
4436 c.header_ = make(http.Header)
4437 }
4438 return c.header_
4439 }
4440
4441 func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4442 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4443 var body io.Reader = nil
4444 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4445 if err != nil {
4446 return nil, err
4447 }
4448 c.urlParams_.Set("alt", alt)
4449 c.urlParams_.Set("prettyPrint", "false")
4450 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
4451 urls += "?" + c.urlParams_.Encode()
4452 req, err := http.NewRequest("POST", urls, body)
4453 if err != nil {
4454 return nil, err
4455 }
4456 req.Header = reqHeaders
4457 googleapi.Expand(req.URL, map[string]string{
4458 "resource": c.resource,
4459 })
4460 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4461 }
4462
4463
4464
4465
4466
4467
4468
4469 func (c *OrganizationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4470 gensupport.SetOptions(c.urlParams_, opts...)
4471 res, err := c.doRequest("json")
4472 if res != nil && res.StatusCode == http.StatusNotModified {
4473 if res.Body != nil {
4474 res.Body.Close()
4475 }
4476 return nil, gensupport.WrapError(&googleapi.Error{
4477 Code: res.StatusCode,
4478 Header: res.Header,
4479 })
4480 }
4481 if err != nil {
4482 return nil, err
4483 }
4484 defer googleapi.CloseBody(res)
4485 if err := googleapi.CheckResponse(res); err != nil {
4486 return nil, gensupport.WrapError(err)
4487 }
4488 ret := &TestIamPermissionsResponse{
4489 ServerResponse: googleapi.ServerResponse{
4490 Header: res.Header,
4491 HTTPStatusCode: res.StatusCode,
4492 },
4493 }
4494 target := &ret
4495 if err := gensupport.DecodeResponse(target, res); err != nil {
4496 return nil, err
4497 }
4498 return ret, nil
4499 }
4500
4501 type ProjectsClearOrgPolicyCall struct {
4502 s *Service
4503 resource string
4504 clearorgpolicyrequest *ClearOrgPolicyRequest
4505 urlParams_ gensupport.URLParams
4506 ctx_ context.Context
4507 header_ http.Header
4508 }
4509
4510
4511
4512
4513 func (r *ProjectsService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *ProjectsClearOrgPolicyCall {
4514 c := &ProjectsClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4515 c.resource = resource
4516 c.clearorgpolicyrequest = clearorgpolicyrequest
4517 return c
4518 }
4519
4520
4521
4522
4523 func (c *ProjectsClearOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsClearOrgPolicyCall {
4524 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4525 return c
4526 }
4527
4528
4529 func (c *ProjectsClearOrgPolicyCall) Context(ctx context.Context) *ProjectsClearOrgPolicyCall {
4530 c.ctx_ = ctx
4531 return c
4532 }
4533
4534
4535
4536 func (c *ProjectsClearOrgPolicyCall) Header() http.Header {
4537 if c.header_ == nil {
4538 c.header_ = make(http.Header)
4539 }
4540 return c.header_
4541 }
4542
4543 func (c *ProjectsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
4544 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4545 var body io.Reader = nil
4546 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest)
4547 if err != nil {
4548 return nil, err
4549 }
4550 c.urlParams_.Set("alt", alt)
4551 c.urlParams_.Set("prettyPrint", "false")
4552 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy")
4553 urls += "?" + c.urlParams_.Encode()
4554 req, err := http.NewRequest("POST", urls, body)
4555 if err != nil {
4556 return nil, err
4557 }
4558 req.Header = reqHeaders
4559 googleapi.Expand(req.URL, map[string]string{
4560 "resource": c.resource,
4561 })
4562 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4563 }
4564
4565
4566
4567
4568
4569
4570 func (c *ProjectsClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4571 gensupport.SetOptions(c.urlParams_, opts...)
4572 res, err := c.doRequest("json")
4573 if res != nil && res.StatusCode == http.StatusNotModified {
4574 if res.Body != nil {
4575 res.Body.Close()
4576 }
4577 return nil, gensupport.WrapError(&googleapi.Error{
4578 Code: res.StatusCode,
4579 Header: res.Header,
4580 })
4581 }
4582 if err != nil {
4583 return nil, err
4584 }
4585 defer googleapi.CloseBody(res)
4586 if err := googleapi.CheckResponse(res); err != nil {
4587 return nil, gensupport.WrapError(err)
4588 }
4589 ret := &Empty{
4590 ServerResponse: googleapi.ServerResponse{
4591 Header: res.Header,
4592 HTTPStatusCode: res.StatusCode,
4593 },
4594 }
4595 target := &ret
4596 if err := gensupport.DecodeResponse(target, res); err != nil {
4597 return nil, err
4598 }
4599 return ret, nil
4600 }
4601
4602 type ProjectsCreateCall struct {
4603 s *Service
4604 project *Project
4605 urlParams_ gensupport.URLParams
4606 ctx_ context.Context
4607 header_ http.Header
4608 }
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622 func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall {
4623 c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4624 c.project = project
4625 return c
4626 }
4627
4628
4629
4630
4631 func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall {
4632 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4633 return c
4634 }
4635
4636
4637 func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall {
4638 c.ctx_ = ctx
4639 return c
4640 }
4641
4642
4643
4644 func (c *ProjectsCreateCall) Header() http.Header {
4645 if c.header_ == nil {
4646 c.header_ = make(http.Header)
4647 }
4648 return c.header_
4649 }
4650
4651 func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) {
4652 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4653 var body io.Reader = nil
4654 body, err := googleapi.WithoutDataWrapper.JSONReader(c.project)
4655 if err != nil {
4656 return nil, err
4657 }
4658 c.urlParams_.Set("alt", alt)
4659 c.urlParams_.Set("prettyPrint", "false")
4660 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects")
4661 urls += "?" + c.urlParams_.Encode()
4662 req, err := http.NewRequest("POST", urls, body)
4663 if err != nil {
4664 return nil, err
4665 }
4666 req.Header = reqHeaders
4667 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4668 }
4669
4670
4671
4672
4673
4674
4675 func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4676 gensupport.SetOptions(c.urlParams_, opts...)
4677 res, err := c.doRequest("json")
4678 if res != nil && res.StatusCode == http.StatusNotModified {
4679 if res.Body != nil {
4680 res.Body.Close()
4681 }
4682 return nil, gensupport.WrapError(&googleapi.Error{
4683 Code: res.StatusCode,
4684 Header: res.Header,
4685 })
4686 }
4687 if err != nil {
4688 return nil, err
4689 }
4690 defer googleapi.CloseBody(res)
4691 if err := googleapi.CheckResponse(res); err != nil {
4692 return nil, gensupport.WrapError(err)
4693 }
4694 ret := &Operation{
4695 ServerResponse: googleapi.ServerResponse{
4696 Header: res.Header,
4697 HTTPStatusCode: res.StatusCode,
4698 },
4699 }
4700 target := &ret
4701 if err := gensupport.DecodeResponse(target, res); err != nil {
4702 return nil, err
4703 }
4704 return ret, nil
4705 }
4706
4707 type ProjectsDeleteCall struct {
4708 s *Service
4709 projectId string
4710 urlParams_ gensupport.URLParams
4711 ctx_ context.Context
4712 header_ http.Header
4713 }
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728 func (r *ProjectsService) Delete(projectId string) *ProjectsDeleteCall {
4729 c := &ProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4730 c.projectId = projectId
4731 return c
4732 }
4733
4734
4735
4736
4737 func (c *ProjectsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeleteCall {
4738 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4739 return c
4740 }
4741
4742
4743 func (c *ProjectsDeleteCall) Context(ctx context.Context) *ProjectsDeleteCall {
4744 c.ctx_ = ctx
4745 return c
4746 }
4747
4748
4749
4750 func (c *ProjectsDeleteCall) Header() http.Header {
4751 if c.header_ == nil {
4752 c.header_ = make(http.Header)
4753 }
4754 return c.header_
4755 }
4756
4757 func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
4758 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4759 var body io.Reader = nil
4760 c.urlParams_.Set("alt", alt)
4761 c.urlParams_.Set("prettyPrint", "false")
4762 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}")
4763 urls += "?" + c.urlParams_.Encode()
4764 req, err := http.NewRequest("DELETE", urls, body)
4765 if err != nil {
4766 return nil, err
4767 }
4768 req.Header = reqHeaders
4769 googleapi.Expand(req.URL, map[string]string{
4770 "projectId": c.projectId,
4771 })
4772 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4773 }
4774
4775
4776
4777
4778
4779
4780 func (c *ProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4781 gensupport.SetOptions(c.urlParams_, opts...)
4782 res, err := c.doRequest("json")
4783 if res != nil && res.StatusCode == http.StatusNotModified {
4784 if res.Body != nil {
4785 res.Body.Close()
4786 }
4787 return nil, gensupport.WrapError(&googleapi.Error{
4788 Code: res.StatusCode,
4789 Header: res.Header,
4790 })
4791 }
4792 if err != nil {
4793 return nil, err
4794 }
4795 defer googleapi.CloseBody(res)
4796 if err := googleapi.CheckResponse(res); err != nil {
4797 return nil, gensupport.WrapError(err)
4798 }
4799 ret := &Empty{
4800 ServerResponse: googleapi.ServerResponse{
4801 Header: res.Header,
4802 HTTPStatusCode: res.StatusCode,
4803 },
4804 }
4805 target := &ret
4806 if err := gensupport.DecodeResponse(target, res); err != nil {
4807 return nil, err
4808 }
4809 return ret, nil
4810 }
4811
4812 type ProjectsGetCall struct {
4813 s *Service
4814 projectId string
4815 urlParams_ gensupport.URLParams
4816 ifNoneMatch_ string
4817 ctx_ context.Context
4818 header_ http.Header
4819 }
4820
4821
4822
4823
4824
4825
4826 func (r *ProjectsService) Get(projectId string) *ProjectsGetCall {
4827 c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4828 c.projectId = projectId
4829 return c
4830 }
4831
4832
4833
4834
4835 func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
4836 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4837 return c
4838 }
4839
4840
4841
4842
4843 func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
4844 c.ifNoneMatch_ = entityTag
4845 return c
4846 }
4847
4848
4849 func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
4850 c.ctx_ = ctx
4851 return c
4852 }
4853
4854
4855
4856 func (c *ProjectsGetCall) Header() http.Header {
4857 if c.header_ == nil {
4858 c.header_ = make(http.Header)
4859 }
4860 return c.header_
4861 }
4862
4863 func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
4864 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4865 if c.ifNoneMatch_ != "" {
4866 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4867 }
4868 var body io.Reader = nil
4869 c.urlParams_.Set("alt", alt)
4870 c.urlParams_.Set("prettyPrint", "false")
4871 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}")
4872 urls += "?" + c.urlParams_.Encode()
4873 req, err := http.NewRequest("GET", urls, body)
4874 if err != nil {
4875 return nil, err
4876 }
4877 req.Header = reqHeaders
4878 googleapi.Expand(req.URL, map[string]string{
4879 "projectId": c.projectId,
4880 })
4881 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4882 }
4883
4884
4885
4886
4887
4888
4889 func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
4890 gensupport.SetOptions(c.urlParams_, opts...)
4891 res, err := c.doRequest("json")
4892 if res != nil && res.StatusCode == http.StatusNotModified {
4893 if res.Body != nil {
4894 res.Body.Close()
4895 }
4896 return nil, gensupport.WrapError(&googleapi.Error{
4897 Code: res.StatusCode,
4898 Header: res.Header,
4899 })
4900 }
4901 if err != nil {
4902 return nil, err
4903 }
4904 defer googleapi.CloseBody(res)
4905 if err := googleapi.CheckResponse(res); err != nil {
4906 return nil, gensupport.WrapError(err)
4907 }
4908 ret := &Project{
4909 ServerResponse: googleapi.ServerResponse{
4910 Header: res.Header,
4911 HTTPStatusCode: res.StatusCode,
4912 },
4913 }
4914 target := &ret
4915 if err := gensupport.DecodeResponse(target, res); err != nil {
4916 return nil, err
4917 }
4918 return ret, nil
4919 }
4920
4921 type ProjectsGetAncestryCall struct {
4922 s *Service
4923 projectId string
4924 getancestryrequest *GetAncestryRequest
4925 urlParams_ gensupport.URLParams
4926 ctx_ context.Context
4927 header_ http.Header
4928 }
4929
4930
4931
4932
4933
4934
4935 func (r *ProjectsService) GetAncestry(projectId string, getancestryrequest *GetAncestryRequest) *ProjectsGetAncestryCall {
4936 c := &ProjectsGetAncestryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4937 c.projectId = projectId
4938 c.getancestryrequest = getancestryrequest
4939 return c
4940 }
4941
4942
4943
4944
4945 func (c *ProjectsGetAncestryCall) Fields(s ...googleapi.Field) *ProjectsGetAncestryCall {
4946 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4947 return c
4948 }
4949
4950
4951 func (c *ProjectsGetAncestryCall) Context(ctx context.Context) *ProjectsGetAncestryCall {
4952 c.ctx_ = ctx
4953 return c
4954 }
4955
4956
4957
4958 func (c *ProjectsGetAncestryCall) Header() http.Header {
4959 if c.header_ == nil {
4960 c.header_ = make(http.Header)
4961 }
4962 return c.header_
4963 }
4964
4965 func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) {
4966 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4967 var body io.Reader = nil
4968 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest)
4969 if err != nil {
4970 return nil, err
4971 }
4972 c.urlParams_.Set("alt", alt)
4973 c.urlParams_.Set("prettyPrint", "false")
4974 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:getAncestry")
4975 urls += "?" + c.urlParams_.Encode()
4976 req, err := http.NewRequest("POST", urls, body)
4977 if err != nil {
4978 return nil, err
4979 }
4980 req.Header = reqHeaders
4981 googleapi.Expand(req.URL, map[string]string{
4982 "projectId": c.projectId,
4983 })
4984 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4985 }
4986
4987
4988
4989
4990
4991
4992
4993 func (c *ProjectsGetAncestryCall) Do(opts ...googleapi.CallOption) (*GetAncestryResponse, error) {
4994 gensupport.SetOptions(c.urlParams_, opts...)
4995 res, err := c.doRequest("json")
4996 if res != nil && res.StatusCode == http.StatusNotModified {
4997 if res.Body != nil {
4998 res.Body.Close()
4999 }
5000 return nil, gensupport.WrapError(&googleapi.Error{
5001 Code: res.StatusCode,
5002 Header: res.Header,
5003 })
5004 }
5005 if err != nil {
5006 return nil, err
5007 }
5008 defer googleapi.CloseBody(res)
5009 if err := googleapi.CheckResponse(res); err != nil {
5010 return nil, gensupport.WrapError(err)
5011 }
5012 ret := &GetAncestryResponse{
5013 ServerResponse: googleapi.ServerResponse{
5014 Header: res.Header,
5015 HTTPStatusCode: res.StatusCode,
5016 },
5017 }
5018 target := &ret
5019 if err := gensupport.DecodeResponse(target, res); err != nil {
5020 return nil, err
5021 }
5022 return ret, nil
5023 }
5024
5025 type ProjectsGetEffectiveOrgPolicyCall struct {
5026 s *Service
5027 resource string
5028 geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest
5029 urlParams_ gensupport.URLParams
5030 ctx_ context.Context
5031 header_ http.Header
5032 }
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042 func (r *ProjectsService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *ProjectsGetEffectiveOrgPolicyCall {
5043 c := &ProjectsGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5044 c.resource = resource
5045 c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest
5046 return c
5047 }
5048
5049
5050
5051
5052 func (c *ProjectsGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetEffectiveOrgPolicyCall {
5053 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5054 return c
5055 }
5056
5057
5058 func (c *ProjectsGetEffectiveOrgPolicyCall) Context(ctx context.Context) *ProjectsGetEffectiveOrgPolicyCall {
5059 c.ctx_ = ctx
5060 return c
5061 }
5062
5063
5064
5065 func (c *ProjectsGetEffectiveOrgPolicyCall) Header() http.Header {
5066 if c.header_ == nil {
5067 c.header_ = make(http.Header)
5068 }
5069 return c.header_
5070 }
5071
5072 func (c *ProjectsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
5073 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5074 var body io.Reader = nil
5075 body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest)
5076 if err != nil {
5077 return nil, err
5078 }
5079 c.urlParams_.Set("alt", alt)
5080 c.urlParams_.Set("prettyPrint", "false")
5081 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy")
5082 urls += "?" + c.urlParams_.Encode()
5083 req, err := http.NewRequest("POST", urls, body)
5084 if err != nil {
5085 return nil, err
5086 }
5087 req.Header = reqHeaders
5088 googleapi.Expand(req.URL, map[string]string{
5089 "resource": c.resource,
5090 })
5091 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5092 }
5093
5094
5095
5096
5097
5098
5099 func (c *ProjectsGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
5100 gensupport.SetOptions(c.urlParams_, opts...)
5101 res, err := c.doRequest("json")
5102 if res != nil && res.StatusCode == http.StatusNotModified {
5103 if res.Body != nil {
5104 res.Body.Close()
5105 }
5106 return nil, gensupport.WrapError(&googleapi.Error{
5107 Code: res.StatusCode,
5108 Header: res.Header,
5109 })
5110 }
5111 if err != nil {
5112 return nil, err
5113 }
5114 defer googleapi.CloseBody(res)
5115 if err := googleapi.CheckResponse(res); err != nil {
5116 return nil, gensupport.WrapError(err)
5117 }
5118 ret := &OrgPolicy{
5119 ServerResponse: googleapi.ServerResponse{
5120 Header: res.Header,
5121 HTTPStatusCode: res.StatusCode,
5122 },
5123 }
5124 target := &ret
5125 if err := gensupport.DecodeResponse(target, res); err != nil {
5126 return nil, err
5127 }
5128 return ret, nil
5129 }
5130
5131 type ProjectsGetIamPolicyCall struct {
5132 s *Service
5133 resource string
5134 getiampolicyrequest *GetIamPolicyRequest
5135 urlParams_ gensupport.URLParams
5136 ctx_ context.Context
5137 header_ http.Header
5138 }
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151 func (r *ProjectsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsGetIamPolicyCall {
5152 c := &ProjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5153 c.resource = resource
5154 c.getiampolicyrequest = getiampolicyrequest
5155 return c
5156 }
5157
5158
5159
5160
5161 func (c *ProjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetIamPolicyCall {
5162 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5163 return c
5164 }
5165
5166
5167 func (c *ProjectsGetIamPolicyCall) Context(ctx context.Context) *ProjectsGetIamPolicyCall {
5168 c.ctx_ = ctx
5169 return c
5170 }
5171
5172
5173
5174 func (c *ProjectsGetIamPolicyCall) Header() http.Header {
5175 if c.header_ == nil {
5176 c.header_ = make(http.Header)
5177 }
5178 return c.header_
5179 }
5180
5181 func (c *ProjectsGetIamPolicyCall) 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.getiampolicyrequest)
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, "v1/projects/{resource}:getIamPolicy")
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 "resource": c.resource,
5199 })
5200 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5201 }
5202
5203
5204
5205
5206
5207
5208 func (c *ProjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{
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 ProjectsGetOrgPolicyCall struct {
5241 s *Service
5242 resource string
5243 getorgpolicyrequest *GetOrgPolicyRequest
5244 urlParams_ gensupport.URLParams
5245 ctx_ context.Context
5246 header_ http.Header
5247 }
5248
5249
5250
5251
5252
5253
5254
5255
5256 func (r *ProjectsService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *ProjectsGetOrgPolicyCall {
5257 c := &ProjectsGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5258 c.resource = resource
5259 c.getorgpolicyrequest = getorgpolicyrequest
5260 return c
5261 }
5262
5263
5264
5265
5266 func (c *ProjectsGetOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetOrgPolicyCall {
5267 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5268 return c
5269 }
5270
5271
5272 func (c *ProjectsGetOrgPolicyCall) Context(ctx context.Context) *ProjectsGetOrgPolicyCall {
5273 c.ctx_ = ctx
5274 return c
5275 }
5276
5277
5278
5279 func (c *ProjectsGetOrgPolicyCall) Header() http.Header {
5280 if c.header_ == nil {
5281 c.header_ = make(http.Header)
5282 }
5283 return c.header_
5284 }
5285
5286 func (c *ProjectsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
5287 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5288 var body io.Reader = nil
5289 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest)
5290 if err != nil {
5291 return nil, err
5292 }
5293 c.urlParams_.Set("alt", alt)
5294 c.urlParams_.Set("prettyPrint", "false")
5295 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy")
5296 urls += "?" + c.urlParams_.Encode()
5297 req, err := http.NewRequest("POST", urls, body)
5298 if err != nil {
5299 return nil, err
5300 }
5301 req.Header = reqHeaders
5302 googleapi.Expand(req.URL, map[string]string{
5303 "resource": c.resource,
5304 })
5305 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5306 }
5307
5308
5309
5310
5311
5312
5313 func (c *ProjectsGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
5314 gensupport.SetOptions(c.urlParams_, opts...)
5315 res, err := c.doRequest("json")
5316 if res != nil && res.StatusCode == http.StatusNotModified {
5317 if res.Body != nil {
5318 res.Body.Close()
5319 }
5320 return nil, gensupport.WrapError(&googleapi.Error{
5321 Code: res.StatusCode,
5322 Header: res.Header,
5323 })
5324 }
5325 if err != nil {
5326 return nil, err
5327 }
5328 defer googleapi.CloseBody(res)
5329 if err := googleapi.CheckResponse(res); err != nil {
5330 return nil, gensupport.WrapError(err)
5331 }
5332 ret := &OrgPolicy{
5333 ServerResponse: googleapi.ServerResponse{
5334 Header: res.Header,
5335 HTTPStatusCode: res.StatusCode,
5336 },
5337 }
5338 target := &ret
5339 if err := gensupport.DecodeResponse(target, res); err != nil {
5340 return nil, err
5341 }
5342 return ret, nil
5343 }
5344
5345 type ProjectsListCall struct {
5346 s *Service
5347 urlParams_ gensupport.URLParams
5348 ifNoneMatch_ string
5349 ctx_ context.Context
5350 header_ http.Header
5351 }
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365 func (r *ProjectsService) List() *ProjectsListCall {
5366 c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5367 return c
5368 }
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392 func (c *ProjectsListCall) Filter(filter string) *ProjectsListCall {
5393 c.urlParams_.Set("filter", filter)
5394 return c
5395 }
5396
5397
5398
5399
5400 func (c *ProjectsListCall) PageSize(pageSize int64) *ProjectsListCall {
5401 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5402 return c
5403 }
5404
5405
5406
5407
5408 func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
5409 c.urlParams_.Set("pageToken", pageToken)
5410 return c
5411 }
5412
5413
5414
5415
5416 func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
5417 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5418 return c
5419 }
5420
5421
5422
5423
5424 func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
5425 c.ifNoneMatch_ = entityTag
5426 return c
5427 }
5428
5429
5430 func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
5431 c.ctx_ = ctx
5432 return c
5433 }
5434
5435
5436
5437 func (c *ProjectsListCall) Header() http.Header {
5438 if c.header_ == nil {
5439 c.header_ = make(http.Header)
5440 }
5441 return c.header_
5442 }
5443
5444 func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
5445 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5446 if c.ifNoneMatch_ != "" {
5447 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5448 }
5449 var body io.Reader = nil
5450 c.urlParams_.Set("alt", alt)
5451 c.urlParams_.Set("prettyPrint", "false")
5452 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects")
5453 urls += "?" + c.urlParams_.Encode()
5454 req, err := http.NewRequest("GET", urls, body)
5455 if err != nil {
5456 return nil, err
5457 }
5458 req.Header = reqHeaders
5459 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5460 }
5461
5462
5463
5464
5465
5466
5467
5468 func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectsResponse, error) {
5469 gensupport.SetOptions(c.urlParams_, opts...)
5470 res, err := c.doRequest("json")
5471 if res != nil && res.StatusCode == http.StatusNotModified {
5472 if res.Body != nil {
5473 res.Body.Close()
5474 }
5475 return nil, gensupport.WrapError(&googleapi.Error{
5476 Code: res.StatusCode,
5477 Header: res.Header,
5478 })
5479 }
5480 if err != nil {
5481 return nil, err
5482 }
5483 defer googleapi.CloseBody(res)
5484 if err := googleapi.CheckResponse(res); err != nil {
5485 return nil, gensupport.WrapError(err)
5486 }
5487 ret := &ListProjectsResponse{
5488 ServerResponse: googleapi.ServerResponse{
5489 Header: res.Header,
5490 HTTPStatusCode: res.StatusCode,
5491 },
5492 }
5493 target := &ret
5494 if err := gensupport.DecodeResponse(target, res); err != nil {
5495 return nil, err
5496 }
5497 return ret, nil
5498 }
5499
5500
5501
5502
5503 func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ListProjectsResponse) error) error {
5504 c.ctx_ = ctx
5505 defer c.PageToken(c.urlParams_.Get("pageToken"))
5506 for {
5507 x, err := c.Do()
5508 if err != nil {
5509 return err
5510 }
5511 if err := f(x); err != nil {
5512 return err
5513 }
5514 if x.NextPageToken == "" {
5515 return nil
5516 }
5517 c.PageToken(x.NextPageToken)
5518 }
5519 }
5520
5521 type ProjectsListAvailableOrgPolicyConstraintsCall struct {
5522 s *Service
5523 resource string
5524 listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest
5525 urlParams_ gensupport.URLParams
5526 ctx_ context.Context
5527 header_ http.Header
5528 }
5529
5530
5531
5532
5533
5534 func (r *ProjectsService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *ProjectsListAvailableOrgPolicyConstraintsCall {
5535 c := &ProjectsListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5536 c.resource = resource
5537 c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest
5538 return c
5539 }
5540
5541
5542
5543
5544 func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *ProjectsListAvailableOrgPolicyConstraintsCall {
5545 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5546 return c
5547 }
5548
5549
5550 func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *ProjectsListAvailableOrgPolicyConstraintsCall {
5551 c.ctx_ = ctx
5552 return c
5553 }
5554
5555
5556
5557 func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Header() http.Header {
5558 if c.header_ == nil {
5559 c.header_ = make(http.Header)
5560 }
5561 return c.header_
5562 }
5563
5564 func (c *ProjectsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) {
5565 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5566 var body io.Reader = nil
5567 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest)
5568 if err != nil {
5569 return nil, err
5570 }
5571 c.urlParams_.Set("alt", alt)
5572 c.urlParams_.Set("prettyPrint", "false")
5573 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints")
5574 urls += "?" + c.urlParams_.Encode()
5575 req, err := http.NewRequest("POST", urls, body)
5576 if err != nil {
5577 return nil, err
5578 }
5579 req.Header = reqHeaders
5580 googleapi.Expand(req.URL, map[string]string{
5581 "resource": c.resource,
5582 })
5583 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5584 }
5585
5586
5587
5588
5589
5590
5591
5592 func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) {
5593 gensupport.SetOptions(c.urlParams_, opts...)
5594 res, err := c.doRequest("json")
5595 if res != nil && res.StatusCode == http.StatusNotModified {
5596 if res.Body != nil {
5597 res.Body.Close()
5598 }
5599 return nil, gensupport.WrapError(&googleapi.Error{
5600 Code: res.StatusCode,
5601 Header: res.Header,
5602 })
5603 }
5604 if err != nil {
5605 return nil, err
5606 }
5607 defer googleapi.CloseBody(res)
5608 if err := googleapi.CheckResponse(res); err != nil {
5609 return nil, gensupport.WrapError(err)
5610 }
5611 ret := &ListAvailableOrgPolicyConstraintsResponse{
5612 ServerResponse: googleapi.ServerResponse{
5613 Header: res.Header,
5614 HTTPStatusCode: res.StatusCode,
5615 },
5616 }
5617 target := &ret
5618 if err := gensupport.DecodeResponse(target, res); err != nil {
5619 return nil, err
5620 }
5621 return ret, nil
5622 }
5623
5624
5625
5626
5627 func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error {
5628 c.ctx_ = ctx
5629 defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken)
5630 for {
5631 x, err := c.Do()
5632 if err != nil {
5633 return err
5634 }
5635 if err := f(x); err != nil {
5636 return err
5637 }
5638 if x.NextPageToken == "" {
5639 return nil
5640 }
5641 c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken
5642 }
5643 }
5644
5645 type ProjectsListOrgPoliciesCall struct {
5646 s *Service
5647 resource string
5648 listorgpoliciesrequest *ListOrgPoliciesRequest
5649 urlParams_ gensupport.URLParams
5650 ctx_ context.Context
5651 header_ http.Header
5652 }
5653
5654
5655
5656
5657 func (r *ProjectsService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *ProjectsListOrgPoliciesCall {
5658 c := &ProjectsListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5659 c.resource = resource
5660 c.listorgpoliciesrequest = listorgpoliciesrequest
5661 return c
5662 }
5663
5664
5665
5666
5667 func (c *ProjectsListOrgPoliciesCall) Fields(s ...googleapi.Field) *ProjectsListOrgPoliciesCall {
5668 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5669 return c
5670 }
5671
5672
5673 func (c *ProjectsListOrgPoliciesCall) Context(ctx context.Context) *ProjectsListOrgPoliciesCall {
5674 c.ctx_ = ctx
5675 return c
5676 }
5677
5678
5679
5680 func (c *ProjectsListOrgPoliciesCall) Header() http.Header {
5681 if c.header_ == nil {
5682 c.header_ = make(http.Header)
5683 }
5684 return c.header_
5685 }
5686
5687 func (c *ProjectsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) {
5688 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5689 var body io.Reader = nil
5690 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest)
5691 if err != nil {
5692 return nil, err
5693 }
5694 c.urlParams_.Set("alt", alt)
5695 c.urlParams_.Set("prettyPrint", "false")
5696 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies")
5697 urls += "?" + c.urlParams_.Encode()
5698 req, err := http.NewRequest("POST", urls, body)
5699 if err != nil {
5700 return nil, err
5701 }
5702 req.Header = reqHeaders
5703 googleapi.Expand(req.URL, map[string]string{
5704 "resource": c.resource,
5705 })
5706 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5707 }
5708
5709
5710
5711
5712
5713
5714
5715 func (c *ProjectsListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) {
5716 gensupport.SetOptions(c.urlParams_, opts...)
5717 res, err := c.doRequest("json")
5718 if res != nil && res.StatusCode == http.StatusNotModified {
5719 if res.Body != nil {
5720 res.Body.Close()
5721 }
5722 return nil, gensupport.WrapError(&googleapi.Error{
5723 Code: res.StatusCode,
5724 Header: res.Header,
5725 })
5726 }
5727 if err != nil {
5728 return nil, err
5729 }
5730 defer googleapi.CloseBody(res)
5731 if err := googleapi.CheckResponse(res); err != nil {
5732 return nil, gensupport.WrapError(err)
5733 }
5734 ret := &ListOrgPoliciesResponse{
5735 ServerResponse: googleapi.ServerResponse{
5736 Header: res.Header,
5737 HTTPStatusCode: res.StatusCode,
5738 },
5739 }
5740 target := &ret
5741 if err := gensupport.DecodeResponse(target, res); err != nil {
5742 return nil, err
5743 }
5744 return ret, nil
5745 }
5746
5747
5748
5749
5750 func (c *ProjectsListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error {
5751 c.ctx_ = ctx
5752 defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken)
5753 for {
5754 x, err := c.Do()
5755 if err != nil {
5756 return err
5757 }
5758 if err := f(x); err != nil {
5759 return err
5760 }
5761 if x.NextPageToken == "" {
5762 return nil
5763 }
5764 c.listorgpoliciesrequest.PageToken = x.NextPageToken
5765 }
5766 }
5767
5768 type ProjectsSetIamPolicyCall struct {
5769 s *Service
5770 resource string
5771 setiampolicyrequest *SetIamPolicyRequest
5772 urlParams_ gensupport.URLParams
5773 ctx_ context.Context
5774 header_ http.Header
5775 }
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814 func (r *ProjectsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSetIamPolicyCall {
5815 c := &ProjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5816 c.resource = resource
5817 c.setiampolicyrequest = setiampolicyrequest
5818 return c
5819 }
5820
5821
5822
5823
5824 func (c *ProjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetIamPolicyCall {
5825 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5826 return c
5827 }
5828
5829
5830 func (c *ProjectsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSetIamPolicyCall {
5831 c.ctx_ = ctx
5832 return c
5833 }
5834
5835
5836
5837 func (c *ProjectsSetIamPolicyCall) Header() http.Header {
5838 if c.header_ == nil {
5839 c.header_ = make(http.Header)
5840 }
5841 return c.header_
5842 }
5843
5844 func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5845 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5846 var body io.Reader = nil
5847 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
5848 if err != nil {
5849 return nil, err
5850 }
5851 c.urlParams_.Set("alt", alt)
5852 c.urlParams_.Set("prettyPrint", "false")
5853 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:setIamPolicy")
5854 urls += "?" + c.urlParams_.Encode()
5855 req, err := http.NewRequest("POST", urls, body)
5856 if err != nil {
5857 return nil, err
5858 }
5859 req.Header = reqHeaders
5860 googleapi.Expand(req.URL, map[string]string{
5861 "resource": c.resource,
5862 })
5863 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5864 }
5865
5866
5867
5868
5869
5870
5871 func (c *ProjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5872 gensupport.SetOptions(c.urlParams_, opts...)
5873 res, err := c.doRequest("json")
5874 if res != nil && res.StatusCode == http.StatusNotModified {
5875 if res.Body != nil {
5876 res.Body.Close()
5877 }
5878 return nil, gensupport.WrapError(&googleapi.Error{
5879 Code: res.StatusCode,
5880 Header: res.Header,
5881 })
5882 }
5883 if err != nil {
5884 return nil, err
5885 }
5886 defer googleapi.CloseBody(res)
5887 if err := googleapi.CheckResponse(res); err != nil {
5888 return nil, gensupport.WrapError(err)
5889 }
5890 ret := &Policy{
5891 ServerResponse: googleapi.ServerResponse{
5892 Header: res.Header,
5893 HTTPStatusCode: res.StatusCode,
5894 },
5895 }
5896 target := &ret
5897 if err := gensupport.DecodeResponse(target, res); err != nil {
5898 return nil, err
5899 }
5900 return ret, nil
5901 }
5902
5903 type ProjectsSetOrgPolicyCall struct {
5904 s *Service
5905 resource string
5906 setorgpolicyrequest *SetOrgPolicyRequest
5907 urlParams_ gensupport.URLParams
5908 ctx_ context.Context
5909 header_ http.Header
5910 }
5911
5912
5913
5914
5915
5916
5917
5918 func (r *ProjectsService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *ProjectsSetOrgPolicyCall {
5919 c := &ProjectsSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5920 c.resource = resource
5921 c.setorgpolicyrequest = setorgpolicyrequest
5922 return c
5923 }
5924
5925
5926
5927
5928 func (c *ProjectsSetOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetOrgPolicyCall {
5929 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5930 return c
5931 }
5932
5933
5934 func (c *ProjectsSetOrgPolicyCall) Context(ctx context.Context) *ProjectsSetOrgPolicyCall {
5935 c.ctx_ = ctx
5936 return c
5937 }
5938
5939
5940
5941 func (c *ProjectsSetOrgPolicyCall) Header() http.Header {
5942 if c.header_ == nil {
5943 c.header_ = make(http.Header)
5944 }
5945 return c.header_
5946 }
5947
5948 func (c *ProjectsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
5949 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5950 var body io.Reader = nil
5951 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest)
5952 if err != nil {
5953 return nil, err
5954 }
5955 c.urlParams_.Set("alt", alt)
5956 c.urlParams_.Set("prettyPrint", "false")
5957 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy")
5958 urls += "?" + c.urlParams_.Encode()
5959 req, err := http.NewRequest("POST", urls, body)
5960 if err != nil {
5961 return nil, err
5962 }
5963 req.Header = reqHeaders
5964 googleapi.Expand(req.URL, map[string]string{
5965 "resource": c.resource,
5966 })
5967 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5968 }
5969
5970
5971
5972
5973
5974
5975 func (c *ProjectsSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
5976 gensupport.SetOptions(c.urlParams_, opts...)
5977 res, err := c.doRequest("json")
5978 if res != nil && res.StatusCode == http.StatusNotModified {
5979 if res.Body != nil {
5980 res.Body.Close()
5981 }
5982 return nil, gensupport.WrapError(&googleapi.Error{
5983 Code: res.StatusCode,
5984 Header: res.Header,
5985 })
5986 }
5987 if err != nil {
5988 return nil, err
5989 }
5990 defer googleapi.CloseBody(res)
5991 if err := googleapi.CheckResponse(res); err != nil {
5992 return nil, gensupport.WrapError(err)
5993 }
5994 ret := &OrgPolicy{
5995 ServerResponse: googleapi.ServerResponse{
5996 Header: res.Header,
5997 HTTPStatusCode: res.StatusCode,
5998 },
5999 }
6000 target := &ret
6001 if err := gensupport.DecodeResponse(target, res); err != nil {
6002 return nil, err
6003 }
6004 return ret, nil
6005 }
6006
6007 type ProjectsTestIamPermissionsCall struct {
6008 s *Service
6009 resource string
6010 testiampermissionsrequest *TestIamPermissionsRequest
6011 urlParams_ gensupport.URLParams
6012 ctx_ context.Context
6013 header_ http.Header
6014 }
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026 func (r *ProjectsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTestIamPermissionsCall {
6027 c := &ProjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6028 c.resource = resource
6029 c.testiampermissionsrequest = testiampermissionsrequest
6030 return c
6031 }
6032
6033
6034
6035
6036 func (c *ProjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTestIamPermissionsCall {
6037 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6038 return c
6039 }
6040
6041
6042 func (c *ProjectsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTestIamPermissionsCall {
6043 c.ctx_ = ctx
6044 return c
6045 }
6046
6047
6048
6049 func (c *ProjectsTestIamPermissionsCall) Header() http.Header {
6050 if c.header_ == nil {
6051 c.header_ = make(http.Header)
6052 }
6053 return c.header_
6054 }
6055
6056 func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6057 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6058 var body io.Reader = nil
6059 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
6060 if err != nil {
6061 return nil, err
6062 }
6063 c.urlParams_.Set("alt", alt)
6064 c.urlParams_.Set("prettyPrint", "false")
6065 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:testIamPermissions")
6066 urls += "?" + c.urlParams_.Encode()
6067 req, err := http.NewRequest("POST", urls, body)
6068 if err != nil {
6069 return nil, err
6070 }
6071 req.Header = reqHeaders
6072 googleapi.Expand(req.URL, map[string]string{
6073 "resource": c.resource,
6074 })
6075 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6076 }
6077
6078
6079
6080
6081
6082
6083
6084 func (c *ProjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6085 gensupport.SetOptions(c.urlParams_, opts...)
6086 res, err := c.doRequest("json")
6087 if res != nil && res.StatusCode == http.StatusNotModified {
6088 if res.Body != nil {
6089 res.Body.Close()
6090 }
6091 return nil, gensupport.WrapError(&googleapi.Error{
6092 Code: res.StatusCode,
6093 Header: res.Header,
6094 })
6095 }
6096 if err != nil {
6097 return nil, err
6098 }
6099 defer googleapi.CloseBody(res)
6100 if err := googleapi.CheckResponse(res); err != nil {
6101 return nil, gensupport.WrapError(err)
6102 }
6103 ret := &TestIamPermissionsResponse{
6104 ServerResponse: googleapi.ServerResponse{
6105 Header: res.Header,
6106 HTTPStatusCode: res.StatusCode,
6107 },
6108 }
6109 target := &ret
6110 if err := gensupport.DecodeResponse(target, res); err != nil {
6111 return nil, err
6112 }
6113 return ret, nil
6114 }
6115
6116 type ProjectsUndeleteCall struct {
6117 s *Service
6118 projectId string
6119 undeleteprojectrequest *UndeleteProjectRequest
6120 urlParams_ gensupport.URLParams
6121 ctx_ context.Context
6122 header_ http.Header
6123 }
6124
6125
6126
6127
6128
6129
6130
6131
6132 func (r *ProjectsService) Undelete(projectId string, undeleteprojectrequest *UndeleteProjectRequest) *ProjectsUndeleteCall {
6133 c := &ProjectsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6134 c.projectId = projectId
6135 c.undeleteprojectrequest = undeleteprojectrequest
6136 return c
6137 }
6138
6139
6140
6141
6142 func (c *ProjectsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsUndeleteCall {
6143 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6144 return c
6145 }
6146
6147
6148 func (c *ProjectsUndeleteCall) Context(ctx context.Context) *ProjectsUndeleteCall {
6149 c.ctx_ = ctx
6150 return c
6151 }
6152
6153
6154
6155 func (c *ProjectsUndeleteCall) Header() http.Header {
6156 if c.header_ == nil {
6157 c.header_ = make(http.Header)
6158 }
6159 return c.header_
6160 }
6161
6162 func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) {
6163 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6164 var body io.Reader = nil
6165 body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest)
6166 if err != nil {
6167 return nil, err
6168 }
6169 c.urlParams_.Set("alt", alt)
6170 c.urlParams_.Set("prettyPrint", "false")
6171 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:undelete")
6172 urls += "?" + c.urlParams_.Encode()
6173 req, err := http.NewRequest("POST", urls, body)
6174 if err != nil {
6175 return nil, err
6176 }
6177 req.Header = reqHeaders
6178 googleapi.Expand(req.URL, map[string]string{
6179 "projectId": c.projectId,
6180 })
6181 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6182 }
6183
6184
6185
6186
6187
6188
6189 func (c *ProjectsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6190 gensupport.SetOptions(c.urlParams_, opts...)
6191 res, err := c.doRequest("json")
6192 if res != nil && res.StatusCode == http.StatusNotModified {
6193 if res.Body != nil {
6194 res.Body.Close()
6195 }
6196 return nil, gensupport.WrapError(&googleapi.Error{
6197 Code: res.StatusCode,
6198 Header: res.Header,
6199 })
6200 }
6201 if err != nil {
6202 return nil, err
6203 }
6204 defer googleapi.CloseBody(res)
6205 if err := googleapi.CheckResponse(res); err != nil {
6206 return nil, gensupport.WrapError(err)
6207 }
6208 ret := &Empty{
6209 ServerResponse: googleapi.ServerResponse{
6210 Header: res.Header,
6211 HTTPStatusCode: res.StatusCode,
6212 },
6213 }
6214 target := &ret
6215 if err := gensupport.DecodeResponse(target, res); err != nil {
6216 return nil, err
6217 }
6218 return ret, nil
6219 }
6220
6221 type ProjectsUpdateCall struct {
6222 s *Service
6223 projectId string
6224 project *Project
6225 urlParams_ gensupport.URLParams
6226 ctx_ context.Context
6227 header_ http.Header
6228 }
6229
6230
6231
6232
6233
6234
6235 func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall {
6236 c := &ProjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6237 c.projectId = projectId
6238 c.project = project
6239 return c
6240 }
6241
6242
6243
6244
6245 func (c *ProjectsUpdateCall) Fields(s ...googleapi.Field) *ProjectsUpdateCall {
6246 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6247 return c
6248 }
6249
6250
6251 func (c *ProjectsUpdateCall) Context(ctx context.Context) *ProjectsUpdateCall {
6252 c.ctx_ = ctx
6253 return c
6254 }
6255
6256
6257
6258 func (c *ProjectsUpdateCall) Header() http.Header {
6259 if c.header_ == nil {
6260 c.header_ = make(http.Header)
6261 }
6262 return c.header_
6263 }
6264
6265 func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
6266 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6267 var body io.Reader = nil
6268 body, err := googleapi.WithoutDataWrapper.JSONReader(c.project)
6269 if err != nil {
6270 return nil, err
6271 }
6272 c.urlParams_.Set("alt", alt)
6273 c.urlParams_.Set("prettyPrint", "false")
6274 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}")
6275 urls += "?" + c.urlParams_.Encode()
6276 req, err := http.NewRequest("PUT", urls, body)
6277 if err != nil {
6278 return nil, err
6279 }
6280 req.Header = reqHeaders
6281 googleapi.Expand(req.URL, map[string]string{
6282 "projectId": c.projectId,
6283 })
6284 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6285 }
6286
6287
6288
6289
6290
6291
6292 func (c *ProjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Project, error) {
6293 gensupport.SetOptions(c.urlParams_, opts...)
6294 res, err := c.doRequest("json")
6295 if res != nil && res.StatusCode == http.StatusNotModified {
6296 if res.Body != nil {
6297 res.Body.Close()
6298 }
6299 return nil, gensupport.WrapError(&googleapi.Error{
6300 Code: res.StatusCode,
6301 Header: res.Header,
6302 })
6303 }
6304 if err != nil {
6305 return nil, err
6306 }
6307 defer googleapi.CloseBody(res)
6308 if err := googleapi.CheckResponse(res); err != nil {
6309 return nil, gensupport.WrapError(err)
6310 }
6311 ret := &Project{
6312 ServerResponse: googleapi.ServerResponse{
6313 Header: res.Header,
6314 HTTPStatusCode: res.StatusCode,
6315 },
6316 }
6317 target := &ret
6318 if err := gensupport.DecodeResponse(target, res); err != nil {
6319 return nil, err
6320 }
6321 return ret, nil
6322 }
6323
View as plain text