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
57
58 package cloudkms
59
60 import (
61 "bytes"
62 "context"
63 "encoding/json"
64 "errors"
65 "fmt"
66 "io"
67 "net/http"
68 "net/url"
69 "strconv"
70 "strings"
71
72 googleapi "google.golang.org/api/googleapi"
73 internal "google.golang.org/api/internal"
74 gensupport "google.golang.org/api/internal/gensupport"
75 option "google.golang.org/api/option"
76 internaloption "google.golang.org/api/option/internaloption"
77 htransport "google.golang.org/api/transport/http"
78 )
79
80
81
82 var _ = bytes.NewBuffer
83 var _ = strconv.Itoa
84 var _ = fmt.Sprintf
85 var _ = json.NewDecoder
86 var _ = io.Copy
87 var _ = url.Parse
88 var _ = gensupport.MarshalJSON
89 var _ = googleapi.Version
90 var _ = errors.New
91 var _ = strings.Replace
92 var _ = context.Canceled
93 var _ = internaloption.WithDefaultEndpoint
94 var _ = internal.Version
95
96 const apiId = "cloudkms:v1"
97 const apiName = "cloudkms"
98 const apiVersion = "v1"
99 const basePath = "https://cloudkms.googleapis.com/"
100 const basePathTemplate = "https://cloudkms.UNIVERSE_DOMAIN/"
101 const mtlsBasePath = "https://cloudkms.mtls.googleapis.com/"
102
103
104 const (
105
106
107 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
108
109
110 CloudkmsScope = "https://www.googleapis.com/auth/cloudkms"
111 )
112
113
114 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
115 scopesOption := internaloption.WithDefaultScopes(
116 "https://www.googleapis.com/auth/cloud-platform",
117 "https://www.googleapis.com/auth/cloudkms",
118 )
119
120 opts = append([]option.ClientOption{scopesOption}, opts...)
121 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
122 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
123 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
124 opts = append(opts, internaloption.EnableNewAuthLibrary())
125 client, endpoint, err := htransport.NewClient(ctx, opts...)
126 if err != nil {
127 return nil, err
128 }
129 s, err := New(client)
130 if err != nil {
131 return nil, err
132 }
133 if endpoint != "" {
134 s.BasePath = endpoint
135 }
136 return s, nil
137 }
138
139
140
141
142
143
144 func New(client *http.Client) (*Service, error) {
145 if client == nil {
146 return nil, errors.New("client is nil")
147 }
148 s := &Service{client: client, BasePath: basePath}
149 s.Folders = NewFoldersService(s)
150 s.Projects = NewProjectsService(s)
151 return s, nil
152 }
153
154 type Service struct {
155 client *http.Client
156 BasePath string
157 UserAgent string
158
159 Folders *FoldersService
160
161 Projects *ProjectsService
162 }
163
164 func (s *Service) userAgent() string {
165 if s.UserAgent == "" {
166 return googleapi.UserAgent
167 }
168 return googleapi.UserAgent + " " + s.UserAgent
169 }
170
171 func NewFoldersService(s *Service) *FoldersService {
172 rs := &FoldersService{s: s}
173 return rs
174 }
175
176 type FoldersService struct {
177 s *Service
178 }
179
180 func NewProjectsService(s *Service) *ProjectsService {
181 rs := &ProjectsService{s: s}
182 rs.Locations = NewProjectsLocationsService(s)
183 return rs
184 }
185
186 type ProjectsService struct {
187 s *Service
188
189 Locations *ProjectsLocationsService
190 }
191
192 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
193 rs := &ProjectsLocationsService{s: s}
194 rs.EkmConfig = NewProjectsLocationsEkmConfigService(s)
195 rs.EkmConnections = NewProjectsLocationsEkmConnectionsService(s)
196 rs.KeyHandles = NewProjectsLocationsKeyHandlesService(s)
197 rs.KeyRings = NewProjectsLocationsKeyRingsService(s)
198 rs.Operations = NewProjectsLocationsOperationsService(s)
199 return rs
200 }
201
202 type ProjectsLocationsService struct {
203 s *Service
204
205 EkmConfig *ProjectsLocationsEkmConfigService
206
207 EkmConnections *ProjectsLocationsEkmConnectionsService
208
209 KeyHandles *ProjectsLocationsKeyHandlesService
210
211 KeyRings *ProjectsLocationsKeyRingsService
212
213 Operations *ProjectsLocationsOperationsService
214 }
215
216 func NewProjectsLocationsEkmConfigService(s *Service) *ProjectsLocationsEkmConfigService {
217 rs := &ProjectsLocationsEkmConfigService{s: s}
218 return rs
219 }
220
221 type ProjectsLocationsEkmConfigService struct {
222 s *Service
223 }
224
225 func NewProjectsLocationsEkmConnectionsService(s *Service) *ProjectsLocationsEkmConnectionsService {
226 rs := &ProjectsLocationsEkmConnectionsService{s: s}
227 return rs
228 }
229
230 type ProjectsLocationsEkmConnectionsService struct {
231 s *Service
232 }
233
234 func NewProjectsLocationsKeyHandlesService(s *Service) *ProjectsLocationsKeyHandlesService {
235 rs := &ProjectsLocationsKeyHandlesService{s: s}
236 return rs
237 }
238
239 type ProjectsLocationsKeyHandlesService struct {
240 s *Service
241 }
242
243 func NewProjectsLocationsKeyRingsService(s *Service) *ProjectsLocationsKeyRingsService {
244 rs := &ProjectsLocationsKeyRingsService{s: s}
245 rs.CryptoKeys = NewProjectsLocationsKeyRingsCryptoKeysService(s)
246 rs.ImportJobs = NewProjectsLocationsKeyRingsImportJobsService(s)
247 return rs
248 }
249
250 type ProjectsLocationsKeyRingsService struct {
251 s *Service
252
253 CryptoKeys *ProjectsLocationsKeyRingsCryptoKeysService
254
255 ImportJobs *ProjectsLocationsKeyRingsImportJobsService
256 }
257
258 func NewProjectsLocationsKeyRingsCryptoKeysService(s *Service) *ProjectsLocationsKeyRingsCryptoKeysService {
259 rs := &ProjectsLocationsKeyRingsCryptoKeysService{s: s}
260 rs.CryptoKeyVersions = NewProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService(s)
261 return rs
262 }
263
264 type ProjectsLocationsKeyRingsCryptoKeysService struct {
265 s *Service
266
267 CryptoKeyVersions *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService
268 }
269
270 func NewProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService(s *Service) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService {
271 rs := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService{s: s}
272 return rs
273 }
274
275 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService struct {
276 s *Service
277 }
278
279 func NewProjectsLocationsKeyRingsImportJobsService(s *Service) *ProjectsLocationsKeyRingsImportJobsService {
280 rs := &ProjectsLocationsKeyRingsImportJobsService{s: s}
281 return rs
282 }
283
284 type ProjectsLocationsKeyRingsImportJobsService struct {
285 s *Service
286 }
287
288 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
289 rs := &ProjectsLocationsOperationsService{s: s}
290 return rs
291 }
292
293 type ProjectsLocationsOperationsService struct {
294 s *Service
295 }
296
297
298
299 type AsymmetricDecryptRequest struct {
300
301
302 Ciphertext string `json:"ciphertext,omitempty"`
303
304
305
306
307
308
309
310
311
312
313
314
315 CiphertextCrc32c int64 `json:"ciphertextCrc32c,omitempty,string"`
316
317
318
319
320
321 ForceSendFields []string `json:"-"`
322
323
324
325
326 NullFields []string `json:"-"`
327 }
328
329 func (s *AsymmetricDecryptRequest) MarshalJSON() ([]byte, error) {
330 type NoMethod AsymmetricDecryptRequest
331 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
332 }
333
334
335
336 type AsymmetricDecryptResponse struct {
337
338
339 Plaintext string `json:"plaintext,omitempty"`
340
341
342
343
344
345
346
347
348
349
350 PlaintextCrc32c int64 `json:"plaintextCrc32c,omitempty,string"`
351
352
353
354
355
356
357
358
359
360
361 ProtectionLevel string `json:"protectionLevel,omitempty"`
362
363
364
365
366
367
368
369
370 VerifiedCiphertextCrc32c bool `json:"verifiedCiphertextCrc32c,omitempty"`
371
372
373 googleapi.ServerResponse `json:"-"`
374
375
376
377
378
379 ForceSendFields []string `json:"-"`
380
381
382
383
384 NullFields []string `json:"-"`
385 }
386
387 func (s *AsymmetricDecryptResponse) MarshalJSON() ([]byte, error) {
388 type NoMethod AsymmetricDecryptResponse
389 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
390 }
391
392
393
394 type AsymmetricSignRequest struct {
395
396
397 Data string `json:"data,omitempty"`
398
399
400
401
402
403
404
405
406
407
408
409
410 DataCrc32c int64 `json:"dataCrc32c,omitempty,string"`
411
412
413
414
415 Digest *Digest `json:"digest,omitempty"`
416
417
418
419
420
421
422
423
424
425
426
427
428 DigestCrc32c int64 `json:"digestCrc32c,omitempty,string"`
429
430
431
432
433
434 ForceSendFields []string `json:"-"`
435
436
437
438
439 NullFields []string `json:"-"`
440 }
441
442 func (s *AsymmetricSignRequest) MarshalJSON() ([]byte, error) {
443 type NoMethod AsymmetricSignRequest
444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
445 }
446
447
448
449 type AsymmetricSignResponse struct {
450
451
452 Name string `json:"name,omitempty"`
453
454
455
456
457
458
459
460
461
462
463 ProtectionLevel string `json:"protectionLevel,omitempty"`
464
465 Signature string `json:"signature,omitempty"`
466
467
468
469
470
471
472
473
474
475
476 SignatureCrc32c int64 `json:"signatureCrc32c,omitempty,string"`
477
478
479
480
481
482
483
484 VerifiedDataCrc32c bool `json:"verifiedDataCrc32c,omitempty"`
485
486
487
488
489
490
491
492
493 VerifiedDigestCrc32c bool `json:"verifiedDigestCrc32c,omitempty"`
494
495
496 googleapi.ServerResponse `json:"-"`
497
498
499
500
501
502 ForceSendFields []string `json:"-"`
503
504
505
506
507 NullFields []string `json:"-"`
508 }
509
510 func (s *AsymmetricSignResponse) MarshalJSON() ([]byte, error) {
511 type NoMethod AsymmetricSignResponse
512 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
513 }
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531 type AuditConfig struct {
532
533 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
534
535
536
537 Service string `json:"service,omitempty"`
538
539
540
541
542
543 ForceSendFields []string `json:"-"`
544
545
546
547
548 NullFields []string `json:"-"`
549 }
550
551 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
552 type NoMethod AuditConfig
553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
554 }
555
556
557
558
559
560
561 type AuditLogConfig struct {
562
563
564 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
565
566
567
568
569
570
571
572 LogType string `json:"logType,omitempty"`
573
574
575
576
577
578 ForceSendFields []string `json:"-"`
579
580
581
582
583 NullFields []string `json:"-"`
584 }
585
586 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
587 type NoMethod AuditLogConfig
588 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
589 }
590
591
592 type AutokeyConfig struct {
593
594
595
596
597
598
599
600
601
602 KeyProject string `json:"keyProject,omitempty"`
603
604
605 Name string `json:"name,omitempty"`
606
607
608 googleapi.ServerResponse `json:"-"`
609
610
611
612
613
614 ForceSendFields []string `json:"-"`
615
616
617
618
619 NullFields []string `json:"-"`
620 }
621
622 func (s *AutokeyConfig) MarshalJSON() ([]byte, error) {
623 type NoMethod AutokeyConfig
624 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
625 }
626
627
628 type Binding struct {
629
630
631
632
633
634
635
636
637 Condition *Expr `json:"condition,omitempty"`
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700 Members []string `json:"members,omitempty"`
701
702
703
704
705
706
707 Role string `json:"role,omitempty"`
708
709
710
711
712
713 ForceSendFields []string `json:"-"`
714
715
716
717
718 NullFields []string `json:"-"`
719 }
720
721 func (s *Binding) MarshalJSON() ([]byte, error) {
722 type NoMethod Binding
723 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
724 }
725
726
727
728 type Certificate struct {
729
730
731 Issuer string `json:"issuer,omitempty"`
732
733
734 NotAfterTime string `json:"notAfterTime,omitempty"`
735
736
737 NotBeforeTime string `json:"notBeforeTime,omitempty"`
738
739 Parsed bool `json:"parsed,omitempty"`
740
741 RawDer string `json:"rawDer,omitempty"`
742
743
744 SerialNumber string `json:"serialNumber,omitempty"`
745
746
747 Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"`
748
749
750 Subject string `json:"subject,omitempty"`
751
752
753 SubjectAlternativeDnsNames []string `json:"subjectAlternativeDnsNames,omitempty"`
754
755
756
757
758
759 ForceSendFields []string `json:"-"`
760
761
762
763
764 NullFields []string `json:"-"`
765 }
766
767 func (s *Certificate) MarshalJSON() ([]byte, error) {
768 type NoMethod Certificate
769 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
770 }
771
772
773
774
775 type CertificateChains struct {
776
777 CaviumCerts []string `json:"caviumCerts,omitempty"`
778
779
780 GoogleCardCerts []string `json:"googleCardCerts,omitempty"`
781
782
783 GooglePartitionCerts []string `json:"googlePartitionCerts,omitempty"`
784
785
786
787
788
789 ForceSendFields []string `json:"-"`
790
791
792
793
794 NullFields []string `json:"-"`
795 }
796
797 func (s *CertificateChains) MarshalJSON() ([]byte, error) {
798 type NoMethod CertificateChains
799 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
800 }
801
802
803
804
805 type CryptoKey struct {
806
807 CreateTime string `json:"createTime,omitempty"`
808
809
810
811
812
813
814
815 CryptoKeyBackend string `json:"cryptoKeyBackend,omitempty"`
816
817
818
819
820 DestroyScheduledDuration string `json:"destroyScheduledDuration,omitempty"`
821
822 ImportOnly bool `json:"importOnly,omitempty"`
823
824
825 Labels map[string]string `json:"labels,omitempty"`
826
827
828 Name string `json:"name,omitempty"`
829
830
831
832
833
834
835 NextRotationTime string `json:"nextRotationTime,omitempty"`
836
837
838
839
840
841 Primary *CryptoKeyVersion `json:"primary,omitempty"`
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857 Purpose string `json:"purpose,omitempty"`
858
859
860
861
862
863 RotationPeriod string `json:"rotationPeriod,omitempty"`
864
865
866
867
868 VersionTemplate *CryptoKeyVersionTemplate `json:"versionTemplate,omitempty"`
869
870
871 googleapi.ServerResponse `json:"-"`
872
873
874
875
876
877 ForceSendFields []string `json:"-"`
878
879
880
881
882 NullFields []string `json:"-"`
883 }
884
885 func (s *CryptoKey) MarshalJSON() ([]byte, error) {
886 type NoMethod CryptoKey
887 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
888 }
889
890
891
892
893
894
895
896 type CryptoKeyVersion struct {
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957 Algorithm string `json:"algorithm,omitempty"`
958
959
960
961
962 Attestation *KeyOperationAttestation `json:"attestation,omitempty"`
963
964
965 CreateTime string `json:"createTime,omitempty"`
966
967
968 DestroyEventTime string `json:"destroyEventTime,omitempty"`
969
970
971 DestroyTime string `json:"destroyTime,omitempty"`
972
973
974
975 ExternalDestructionFailureReason string `json:"externalDestructionFailureReason,omitempty"`
976
977
978
979
980 ExternalProtectionLevelOptions *ExternalProtectionLevelOptions `json:"externalProtectionLevelOptions,omitempty"`
981
982
983 GenerateTime string `json:"generateTime,omitempty"`
984
985
986 GenerationFailureReason string `json:"generationFailureReason,omitempty"`
987
988
989 ImportFailureReason string `json:"importFailureReason,omitempty"`
990
991
992
993 ImportJob string `json:"importJob,omitempty"`
994
995
996 ImportTime string `json:"importTime,omitempty"`
997
998
999 Name string `json:"name,omitempty"`
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010 ProtectionLevel string `json:"protectionLevel,omitempty"`
1011
1012
1013
1014 ReimportEligible bool `json:"reimportEligible,omitempty"`
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050 State string `json:"state,omitempty"`
1051
1052
1053 googleapi.ServerResponse `json:"-"`
1054
1055
1056
1057
1058
1059 ForceSendFields []string `json:"-"`
1060
1061
1062
1063
1064 NullFields []string `json:"-"`
1065 }
1066
1067 func (s *CryptoKeyVersion) MarshalJSON() ([]byte, error) {
1068 type NoMethod CryptoKeyVersion
1069 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1070 }
1071
1072
1073
1074
1075 type CryptoKeyVersionTemplate struct {
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138 Algorithm string `json:"algorithm,omitempty"`
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149 ProtectionLevel string `json:"protectionLevel,omitempty"`
1150
1151
1152
1153
1154
1155 ForceSendFields []string `json:"-"`
1156
1157
1158
1159
1160 NullFields []string `json:"-"`
1161 }
1162
1163 func (s *CryptoKeyVersionTemplate) MarshalJSON() ([]byte, error) {
1164 type NoMethod CryptoKeyVersionTemplate
1165 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1166 }
1167
1168
1169 type DecryptRequest struct {
1170
1171
1172 AdditionalAuthenticatedData string `json:"additionalAuthenticatedData,omitempty"`
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186 AdditionalAuthenticatedDataCrc32c int64 `json:"additionalAuthenticatedDataCrc32c,omitempty,string"`
1187
1188
1189 Ciphertext string `json:"ciphertext,omitempty"`
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202 CiphertextCrc32c int64 `json:"ciphertextCrc32c,omitempty,string"`
1203
1204
1205
1206
1207
1208 ForceSendFields []string `json:"-"`
1209
1210
1211
1212
1213 NullFields []string `json:"-"`
1214 }
1215
1216 func (s *DecryptRequest) MarshalJSON() ([]byte, error) {
1217 type NoMethod DecryptRequest
1218 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1219 }
1220
1221
1222 type DecryptResponse struct {
1223
1224
1225 Plaintext string `json:"plaintext,omitempty"`
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238 PlaintextCrc32c int64 `json:"plaintextCrc32c,omitempty,string"`
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249 ProtectionLevel string `json:"protectionLevel,omitempty"`
1250
1251
1252 UsedPrimary bool `json:"usedPrimary,omitempty"`
1253
1254
1255 googleapi.ServerResponse `json:"-"`
1256
1257
1258
1259
1260
1261 ForceSendFields []string `json:"-"`
1262
1263
1264
1265
1266 NullFields []string `json:"-"`
1267 }
1268
1269 func (s *DecryptResponse) MarshalJSON() ([]byte, error) {
1270 type NoMethod DecryptResponse
1271 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1272 }
1273
1274
1275
1276 type DestroyCryptoKeyVersionRequest struct {
1277 }
1278
1279
1280 type Digest struct {
1281
1282 Sha256 string `json:"sha256,omitempty"`
1283
1284 Sha384 string `json:"sha384,omitempty"`
1285
1286 Sha512 string `json:"sha512,omitempty"`
1287
1288
1289
1290
1291
1292 ForceSendFields []string `json:"-"`
1293
1294
1295
1296
1297 NullFields []string `json:"-"`
1298 }
1299
1300 func (s *Digest) MarshalJSON() ([]byte, error) {
1301 type NoMethod Digest
1302 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1303 }
1304
1305
1306
1307
1308 type EkmConfig struct {
1309
1310
1311 DefaultEkmConnection string `json:"defaultEkmConnection,omitempty"`
1312
1313
1314 Name string `json:"name,omitempty"`
1315
1316
1317 googleapi.ServerResponse `json:"-"`
1318
1319
1320
1321
1322
1323 ForceSendFields []string `json:"-"`
1324
1325
1326
1327
1328 NullFields []string `json:"-"`
1329 }
1330
1331 func (s *EkmConfig) MarshalJSON() ([]byte, error) {
1332 type NoMethod EkmConfig
1333 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1334 }
1335
1336
1337
1338
1339
1340 type EkmConnection struct {
1341
1342 CreateTime string `json:"createTime,omitempty"`
1343
1344
1345
1346 CryptoSpacePath string `json:"cryptoSpacePath,omitempty"`
1347
1348 Etag string `json:"etag,omitempty"`
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370 KeyManagementMode string `json:"keyManagementMode,omitempty"`
1371
1372
1373 Name string `json:"name,omitempty"`
1374
1375
1376
1377 ServiceResolvers []*ServiceResolver `json:"serviceResolvers,omitempty"`
1378
1379
1380 googleapi.ServerResponse `json:"-"`
1381
1382
1383
1384
1385
1386 ForceSendFields []string `json:"-"`
1387
1388
1389
1390
1391 NullFields []string `json:"-"`
1392 }
1393
1394 func (s *EkmConnection) MarshalJSON() ([]byte, error) {
1395 type NoMethod EkmConnection
1396 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1397 }
1398
1399
1400 type EncryptRequest struct {
1401
1402
1403
1404
1405
1406
1407
1408 AdditionalAuthenticatedData string `json:"additionalAuthenticatedData,omitempty"`
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422 AdditionalAuthenticatedDataCrc32c int64 `json:"additionalAuthenticatedDataCrc32c,omitempty,string"`
1423
1424
1425
1426
1427
1428 Plaintext string `json:"plaintext,omitempty"`
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441 PlaintextCrc32c int64 `json:"plaintextCrc32c,omitempty,string"`
1442
1443
1444
1445
1446
1447 ForceSendFields []string `json:"-"`
1448
1449
1450
1451
1452 NullFields []string `json:"-"`
1453 }
1454
1455 func (s *EncryptRequest) MarshalJSON() ([]byte, error) {
1456 type NoMethod EncryptRequest
1457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1458 }
1459
1460
1461 type EncryptResponse struct {
1462
1463 Ciphertext string `json:"ciphertext,omitempty"`
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474 CiphertextCrc32c int64 `json:"ciphertextCrc32c,omitempty,string"`
1475
1476
1477 Name string `json:"name,omitempty"`
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488 ProtectionLevel string `json:"protectionLevel,omitempty"`
1489
1490
1491
1492
1493
1494
1495
1496
1497 VerifiedAdditionalAuthenticatedDataCrc32c bool `json:"verifiedAdditionalAuthenticatedDataCrc32c,omitempty"`
1498
1499
1500
1501
1502
1503
1504
1505 VerifiedPlaintextCrc32c bool `json:"verifiedPlaintextCrc32c,omitempty"`
1506
1507
1508 googleapi.ServerResponse `json:"-"`
1509
1510
1511
1512
1513
1514 ForceSendFields []string `json:"-"`
1515
1516
1517
1518
1519 NullFields []string `json:"-"`
1520 }
1521
1522 func (s *EncryptResponse) MarshalJSON() ([]byte, error) {
1523 type NoMethod EncryptResponse
1524 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1525 }
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543 type Expr struct {
1544
1545
1546 Description string `json:"description,omitempty"`
1547
1548
1549 Expression string `json:"expression,omitempty"`
1550
1551
1552 Location string `json:"location,omitempty"`
1553
1554
1555
1556 Title string `json:"title,omitempty"`
1557
1558
1559
1560
1561
1562 ForceSendFields []string `json:"-"`
1563
1564
1565
1566
1567 NullFields []string `json:"-"`
1568 }
1569
1570 func (s *Expr) MarshalJSON() ([]byte, error) {
1571 type NoMethod Expr
1572 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1573 }
1574
1575
1576
1577
1578
1579 type ExternalProtectionLevelOptions struct {
1580
1581
1582
1583 EkmConnectionKeyPath string `json:"ekmConnectionKeyPath,omitempty"`
1584
1585
1586 ExternalKeyUri string `json:"externalKeyUri,omitempty"`
1587
1588
1589
1590
1591
1592 ForceSendFields []string `json:"-"`
1593
1594
1595
1596
1597 NullFields []string `json:"-"`
1598 }
1599
1600 func (s *ExternalProtectionLevelOptions) MarshalJSON() ([]byte, error) {
1601 type NoMethod ExternalProtectionLevelOptions
1602 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1603 }
1604
1605
1606
1607 type GenerateRandomBytesRequest struct {
1608
1609
1610 LengthBytes int64 `json:"lengthBytes,omitempty"`
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621 ProtectionLevel string `json:"protectionLevel,omitempty"`
1622
1623
1624
1625
1626
1627 ForceSendFields []string `json:"-"`
1628
1629
1630
1631
1632 NullFields []string `json:"-"`
1633 }
1634
1635 func (s *GenerateRandomBytesRequest) MarshalJSON() ([]byte, error) {
1636 type NoMethod GenerateRandomBytesRequest
1637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1638 }
1639
1640
1641
1642 type GenerateRandomBytesResponse struct {
1643
1644 Data string `json:"data,omitempty"`
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655 DataCrc32c int64 `json:"dataCrc32c,omitempty,string"`
1656
1657
1658 googleapi.ServerResponse `json:"-"`
1659
1660
1661
1662
1663
1664 ForceSendFields []string `json:"-"`
1665
1666
1667
1668
1669 NullFields []string `json:"-"`
1670 }
1671
1672 func (s *GenerateRandomBytesResponse) MarshalJSON() ([]byte, error) {
1673 type NoMethod GenerateRandomBytesResponse
1674 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1675 }
1676
1677
1678
1679 type ImportCryptoKeyVersionRequest struct {
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741 Algorithm string `json:"algorithm,omitempty"`
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752 CryptoKeyVersion string `json:"cryptoKeyVersion,omitempty"`
1753
1754
1755 ImportJob string `json:"importJob,omitempty"`
1756
1757
1758
1759 RsaAesWrappedKey string `json:"rsaAesWrappedKey,omitempty"`
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776 WrappedKey string `json:"wrappedKey,omitempty"`
1777
1778
1779
1780
1781
1782 ForceSendFields []string `json:"-"`
1783
1784
1785
1786
1787 NullFields []string `json:"-"`
1788 }
1789
1790 func (s *ImportCryptoKeyVersionRequest) MarshalJSON() ([]byte, error) {
1791 type NoMethod ImportCryptoKeyVersionRequest
1792 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1793 }
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813 type ImportJob struct {
1814
1815
1816
1817
1818
1819 Attestation *KeyOperationAttestation `json:"attestation,omitempty"`
1820
1821 CreateTime string `json:"createTime,omitempty"`
1822
1823
1824 ExpireEventTime string `json:"expireEventTime,omitempty"`
1825
1826
1827 ExpireTime string `json:"expireTime,omitempty"`
1828
1829
1830 GenerateTime string `json:"generateTime,omitempty"`
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872 ImportMethod string `json:"importMethod,omitempty"`
1873
1874
1875 Name string `json:"name,omitempty"`
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887 ProtectionLevel string `json:"protectionLevel,omitempty"`
1888
1889
1890 PublicKey *WrappingPublicKey `json:"publicKey,omitempty"`
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903 State string `json:"state,omitempty"`
1904
1905
1906 googleapi.ServerResponse `json:"-"`
1907
1908
1909
1910
1911
1912 ForceSendFields []string `json:"-"`
1913
1914
1915
1916
1917 NullFields []string `json:"-"`
1918 }
1919
1920 func (s *ImportJob) MarshalJSON() ([]byte, error) {
1921 type NoMethod ImportJob
1922 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1923 }
1924
1925
1926
1927 type KeyHandle struct {
1928
1929
1930
1931
1932
1933
1934
1935 KmsKey string `json:"kmsKey,omitempty"`
1936
1937
1938 Name string `json:"name,omitempty"`
1939
1940
1941
1942
1943 ResourceTypeSelector string `json:"resourceTypeSelector,omitempty"`
1944
1945
1946 googleapi.ServerResponse `json:"-"`
1947
1948
1949
1950
1951
1952 ForceSendFields []string `json:"-"`
1953
1954
1955
1956
1957 NullFields []string `json:"-"`
1958 }
1959
1960 func (s *KeyHandle) MarshalJSON() ([]byte, error) {
1961 type NoMethod KeyHandle
1962 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1963 }
1964
1965
1966
1967
1968 type KeyOperationAttestation struct {
1969
1970
1971 CertChains *CertificateChains `json:"certChains,omitempty"`
1972
1973
1974 Content string `json:"content,omitempty"`
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984 Format string `json:"format,omitempty"`
1985
1986
1987
1988
1989
1990 ForceSendFields []string `json:"-"`
1991
1992
1993
1994
1995 NullFields []string `json:"-"`
1996 }
1997
1998 func (s *KeyOperationAttestation) MarshalJSON() ([]byte, error) {
1999 type NoMethod KeyOperationAttestation
2000 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2001 }
2002
2003
2004 type KeyRing struct {
2005
2006 CreateTime string `json:"createTime,omitempty"`
2007
2008
2009 Name string `json:"name,omitempty"`
2010
2011
2012 googleapi.ServerResponse `json:"-"`
2013
2014
2015
2016
2017
2018 ForceSendFields []string `json:"-"`
2019
2020
2021
2022
2023 NullFields []string `json:"-"`
2024 }
2025
2026 func (s *KeyRing) MarshalJSON() ([]byte, error) {
2027 type NoMethod KeyRing
2028 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2029 }
2030
2031
2032
2033 type ListCryptoKeyVersionsResponse struct {
2034
2035 CryptoKeyVersions []*CryptoKeyVersion `json:"cryptoKeyVersions,omitempty"`
2036
2037
2038
2039 NextPageToken string `json:"nextPageToken,omitempty"`
2040
2041 TotalSize int64 `json:"totalSize,omitempty"`
2042
2043
2044 googleapi.ServerResponse `json:"-"`
2045
2046
2047
2048
2049
2050 ForceSendFields []string `json:"-"`
2051
2052
2053
2054
2055 NullFields []string `json:"-"`
2056 }
2057
2058 func (s *ListCryptoKeyVersionsResponse) MarshalJSON() ([]byte, error) {
2059 type NoMethod ListCryptoKeyVersionsResponse
2060 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2061 }
2062
2063
2064
2065 type ListCryptoKeysResponse struct {
2066
2067 CryptoKeys []*CryptoKey `json:"cryptoKeys,omitempty"`
2068
2069
2070 NextPageToken string `json:"nextPageToken,omitempty"`
2071
2072 TotalSize int64 `json:"totalSize,omitempty"`
2073
2074
2075 googleapi.ServerResponse `json:"-"`
2076
2077
2078
2079
2080
2081 ForceSendFields []string `json:"-"`
2082
2083
2084
2085
2086 NullFields []string `json:"-"`
2087 }
2088
2089 func (s *ListCryptoKeysResponse) MarshalJSON() ([]byte, error) {
2090 type NoMethod ListCryptoKeysResponse
2091 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2092 }
2093
2094
2095
2096 type ListEkmConnectionsResponse struct {
2097
2098 EkmConnections []*EkmConnection `json:"ekmConnections,omitempty"`
2099
2100
2101 NextPageToken string `json:"nextPageToken,omitempty"`
2102
2103 TotalSize int64 `json:"totalSize,omitempty"`
2104
2105
2106 googleapi.ServerResponse `json:"-"`
2107
2108
2109
2110
2111
2112 ForceSendFields []string `json:"-"`
2113
2114
2115
2116
2117 NullFields []string `json:"-"`
2118 }
2119
2120 func (s *ListEkmConnectionsResponse) MarshalJSON() ([]byte, error) {
2121 type NoMethod ListEkmConnectionsResponse
2122 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2123 }
2124
2125
2126
2127 type ListImportJobsResponse struct {
2128
2129 ImportJobs []*ImportJob `json:"importJobs,omitempty"`
2130
2131
2132 NextPageToken string `json:"nextPageToken,omitempty"`
2133
2134 TotalSize int64 `json:"totalSize,omitempty"`
2135
2136
2137 googleapi.ServerResponse `json:"-"`
2138
2139
2140
2141
2142
2143 ForceSendFields []string `json:"-"`
2144
2145
2146
2147
2148 NullFields []string `json:"-"`
2149 }
2150
2151 func (s *ListImportJobsResponse) MarshalJSON() ([]byte, error) {
2152 type NoMethod ListImportJobsResponse
2153 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2154 }
2155
2156
2157 type ListKeyHandlesResponse struct {
2158
2159 KeyHandles []*KeyHandle `json:"keyHandles,omitempty"`
2160
2161
2162 googleapi.ServerResponse `json:"-"`
2163
2164
2165
2166
2167
2168 ForceSendFields []string `json:"-"`
2169
2170
2171
2172
2173 NullFields []string `json:"-"`
2174 }
2175
2176 func (s *ListKeyHandlesResponse) MarshalJSON() ([]byte, error) {
2177 type NoMethod ListKeyHandlesResponse
2178 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2179 }
2180
2181
2182
2183 type ListKeyRingsResponse struct {
2184
2185 KeyRings []*KeyRing `json:"keyRings,omitempty"`
2186
2187
2188 NextPageToken string `json:"nextPageToken,omitempty"`
2189
2190 TotalSize int64 `json:"totalSize,omitempty"`
2191
2192
2193 googleapi.ServerResponse `json:"-"`
2194
2195
2196
2197
2198
2199 ForceSendFields []string `json:"-"`
2200
2201
2202
2203
2204 NullFields []string `json:"-"`
2205 }
2206
2207 func (s *ListKeyRingsResponse) MarshalJSON() ([]byte, error) {
2208 type NoMethod ListKeyRingsResponse
2209 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2210 }
2211
2212
2213 type ListLocationsResponse struct {
2214
2215
2216 Locations []*Location `json:"locations,omitempty"`
2217
2218 NextPageToken string `json:"nextPageToken,omitempty"`
2219
2220
2221 googleapi.ServerResponse `json:"-"`
2222
2223
2224
2225
2226
2227 ForceSendFields []string `json:"-"`
2228
2229
2230
2231
2232 NullFields []string `json:"-"`
2233 }
2234
2235 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
2236 type NoMethod ListLocationsResponse
2237 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2238 }
2239
2240
2241 type Location struct {
2242
2243
2244 DisplayName string `json:"displayName,omitempty"`
2245
2246
2247 Labels map[string]string `json:"labels,omitempty"`
2248
2249 LocationId string `json:"locationId,omitempty"`
2250
2251
2252 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2253
2254
2255
2256 Name string `json:"name,omitempty"`
2257
2258
2259 googleapi.ServerResponse `json:"-"`
2260
2261
2262
2263
2264
2265 ForceSendFields []string `json:"-"`
2266
2267
2268
2269
2270 NullFields []string `json:"-"`
2271 }
2272
2273 func (s *Location) MarshalJSON() ([]byte, error) {
2274 type NoMethod Location
2275 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2276 }
2277
2278
2279
2280 type LocationMetadata struct {
2281
2282
2283 EkmAvailable bool `json:"ekmAvailable,omitempty"`
2284
2285
2286 HsmAvailable bool `json:"hsmAvailable,omitempty"`
2287
2288
2289
2290
2291
2292 ForceSendFields []string `json:"-"`
2293
2294
2295
2296
2297 NullFields []string `json:"-"`
2298 }
2299
2300 func (s *LocationMetadata) MarshalJSON() ([]byte, error) {
2301 type NoMethod LocationMetadata
2302 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2303 }
2304
2305
2306 type MacSignRequest struct {
2307
2308
2309 Data string `json:"data,omitempty"`
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321 DataCrc32c int64 `json:"dataCrc32c,omitempty,string"`
2322
2323
2324
2325
2326
2327 ForceSendFields []string `json:"-"`
2328
2329
2330
2331
2332 NullFields []string `json:"-"`
2333 }
2334
2335 func (s *MacSignRequest) MarshalJSON() ([]byte, error) {
2336 type NoMethod MacSignRequest
2337 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2338 }
2339
2340
2341 type MacSignResponse struct {
2342
2343 Mac string `json:"mac,omitempty"`
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354 MacCrc32c int64 `json:"macCrc32c,omitempty,string"`
2355
2356
2357 Name string `json:"name,omitempty"`
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368 ProtectionLevel string `json:"protectionLevel,omitempty"`
2369
2370
2371
2372
2373
2374
2375
2376 VerifiedDataCrc32c bool `json:"verifiedDataCrc32c,omitempty"`
2377
2378
2379 googleapi.ServerResponse `json:"-"`
2380
2381
2382
2383
2384
2385 ForceSendFields []string `json:"-"`
2386
2387
2388
2389
2390 NullFields []string `json:"-"`
2391 }
2392
2393 func (s *MacSignResponse) MarshalJSON() ([]byte, error) {
2394 type NoMethod MacSignResponse
2395 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2396 }
2397
2398
2399 type MacVerifyRequest struct {
2400
2401
2402 Data string `json:"data,omitempty"`
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415 DataCrc32c int64 `json:"dataCrc32c,omitempty,string"`
2416
2417 Mac string `json:"mac,omitempty"`
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429 MacCrc32c int64 `json:"macCrc32c,omitempty,string"`
2430
2431
2432
2433
2434
2435 ForceSendFields []string `json:"-"`
2436
2437
2438
2439
2440 NullFields []string `json:"-"`
2441 }
2442
2443 func (s *MacVerifyRequest) MarshalJSON() ([]byte, error) {
2444 type NoMethod MacVerifyRequest
2445 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2446 }
2447
2448
2449 type MacVerifyResponse struct {
2450
2451
2452 Name string `json:"name,omitempty"`
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463 ProtectionLevel string `json:"protectionLevel,omitempty"`
2464
2465
2466 Success bool `json:"success,omitempty"`
2467
2468
2469
2470
2471
2472
2473
2474 VerifiedDataCrc32c bool `json:"verifiedDataCrc32c,omitempty"`
2475
2476
2477
2478
2479
2480
2481
2482 VerifiedMacCrc32c bool `json:"verifiedMacCrc32c,omitempty"`
2483
2484
2485
2486
2487 VerifiedSuccessIntegrity bool `json:"verifiedSuccessIntegrity,omitempty"`
2488
2489
2490 googleapi.ServerResponse `json:"-"`
2491
2492
2493
2494
2495
2496 ForceSendFields []string `json:"-"`
2497
2498
2499
2500
2501 NullFields []string `json:"-"`
2502 }
2503
2504 func (s *MacVerifyResponse) MarshalJSON() ([]byte, error) {
2505 type NoMethod MacVerifyResponse
2506 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2507 }
2508
2509
2510
2511 type Operation struct {
2512
2513
2514
2515 Done bool `json:"done,omitempty"`
2516
2517 Error *Status `json:"error,omitempty"`
2518
2519
2520
2521
2522 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2523
2524
2525
2526 Name string `json:"name,omitempty"`
2527
2528
2529
2530
2531
2532
2533
2534 Response googleapi.RawMessage `json:"response,omitempty"`
2535
2536
2537 googleapi.ServerResponse `json:"-"`
2538
2539
2540
2541
2542
2543 ForceSendFields []string `json:"-"`
2544
2545
2546
2547
2548 NullFields []string `json:"-"`
2549 }
2550
2551 func (s *Operation) MarshalJSON() ([]byte, error) {
2552 type NoMethod Operation
2553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2554 }
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586 type Policy struct {
2587
2588 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598 Bindings []*Binding `json:"bindings,omitempty"`
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610 Etag string `json:"etag,omitempty"`
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626 Version int64 `json:"version,omitempty"`
2627
2628
2629 googleapi.ServerResponse `json:"-"`
2630
2631
2632
2633
2634
2635 ForceSendFields []string `json:"-"`
2636
2637
2638
2639
2640 NullFields []string `json:"-"`
2641 }
2642
2643 func (s *Policy) MarshalJSON() ([]byte, error) {
2644 type NoMethod Policy
2645 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2646 }
2647
2648
2649
2650 type PublicKey struct {
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710 Algorithm string `json:"algorithm,omitempty"`
2711
2712
2713 Name string `json:"name,omitempty"`
2714
2715
2716
2717
2718
2719 Pem string `json:"pem,omitempty"`
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730 PemCrc32c int64 `json:"pemCrc32c,omitempty,string"`
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740 ProtectionLevel string `json:"protectionLevel,omitempty"`
2741
2742
2743 googleapi.ServerResponse `json:"-"`
2744
2745
2746
2747
2748
2749 ForceSendFields []string `json:"-"`
2750
2751
2752
2753
2754 NullFields []string `json:"-"`
2755 }
2756
2757 func (s *PublicKey) MarshalJSON() ([]byte, error) {
2758 type NoMethod PublicKey
2759 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2760 }
2761
2762
2763 type RawDecryptRequest struct {
2764
2765
2766 AdditionalAuthenticatedData string `json:"additionalAuthenticatedData,omitempty"`
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780 AdditionalAuthenticatedDataCrc32c int64 `json:"additionalAuthenticatedDataCrc32c,omitempty,string"`
2781
2782
2783 Ciphertext string `json:"ciphertext,omitempty"`
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795 CiphertextCrc32c int64 `json:"ciphertextCrc32c,omitempty,string"`
2796
2797
2798
2799 InitializationVector string `json:"initializationVector,omitempty"`
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812 InitializationVectorCrc32c int64 `json:"initializationVectorCrc32c,omitempty,string"`
2813
2814
2815
2816 TagLength int64 `json:"tagLength,omitempty"`
2817
2818
2819
2820
2821
2822 ForceSendFields []string `json:"-"`
2823
2824
2825
2826
2827 NullFields []string `json:"-"`
2828 }
2829
2830 func (s *RawDecryptRequest) MarshalJSON() ([]byte, error) {
2831 type NoMethod RawDecryptRequest
2832 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2833 }
2834
2835
2836 type RawDecryptResponse struct {
2837
2838 Plaintext string `json:"plaintext,omitempty"`
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850 PlaintextCrc32c int64 `json:"plaintextCrc32c,omitempty,string"`
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861 ProtectionLevel string `json:"protectionLevel,omitempty"`
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871 VerifiedAdditionalAuthenticatedDataCrc32c bool `json:"verifiedAdditionalAuthenticatedDataCrc32c,omitempty"`
2872
2873
2874
2875
2876
2877
2878
2879
2880 VerifiedCiphertextCrc32c bool `json:"verifiedCiphertextCrc32c,omitempty"`
2881
2882
2883
2884
2885
2886
2887
2888
2889 VerifiedInitializationVectorCrc32c bool `json:"verifiedInitializationVectorCrc32c,omitempty"`
2890
2891
2892 googleapi.ServerResponse `json:"-"`
2893
2894
2895
2896
2897
2898 ForceSendFields []string `json:"-"`
2899
2900
2901
2902
2903 NullFields []string `json:"-"`
2904 }
2905
2906 func (s *RawDecryptResponse) MarshalJSON() ([]byte, error) {
2907 type NoMethod RawDecryptResponse
2908 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2909 }
2910
2911
2912 type RawEncryptRequest struct {
2913
2914
2915
2916
2917
2918
2919
2920
2921 AdditionalAuthenticatedData string `json:"additionalAuthenticatedData,omitempty"`
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935 AdditionalAuthenticatedDataCrc32c int64 `json:"additionalAuthenticatedDataCrc32c,omitempty,string"`
2936
2937
2938
2939
2940 InitializationVector string `json:"initializationVector,omitempty"`
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953 InitializationVectorCrc32c int64 `json:"initializationVectorCrc32c,omitempty,string"`
2954
2955
2956
2957
2958
2959 Plaintext string `json:"plaintext,omitempty"`
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971 PlaintextCrc32c int64 `json:"plaintextCrc32c,omitempty,string"`
2972
2973
2974
2975
2976
2977 ForceSendFields []string `json:"-"`
2978
2979
2980
2981
2982 NullFields []string `json:"-"`
2983 }
2984
2985 func (s *RawEncryptRequest) MarshalJSON() ([]byte, error) {
2986 type NoMethod RawEncryptRequest
2987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2988 }
2989
2990
2991 type RawEncryptResponse struct {
2992
2993
2994 Ciphertext string `json:"ciphertext,omitempty"`
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005 CiphertextCrc32c int64 `json:"ciphertextCrc32c,omitempty,string"`
3006
3007
3008
3009 InitializationVector string `json:"initializationVector,omitempty"`
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020 InitializationVectorCrc32c int64 `json:"initializationVectorCrc32c,omitempty,string"`
3021
3022
3023 Name string `json:"name,omitempty"`
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034 ProtectionLevel string `json:"protectionLevel,omitempty"`
3035
3036
3037 TagLength int64 `json:"tagLength,omitempty"`
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047 VerifiedAdditionalAuthenticatedDataCrc32c bool `json:"verifiedAdditionalAuthenticatedDataCrc32c,omitempty"`
3048
3049
3050
3051
3052
3053
3054
3055
3056 VerifiedInitializationVectorCrc32c bool `json:"verifiedInitializationVectorCrc32c,omitempty"`
3057
3058
3059
3060
3061
3062
3063
3064
3065 VerifiedPlaintextCrc32c bool `json:"verifiedPlaintextCrc32c,omitempty"`
3066
3067
3068 googleapi.ServerResponse `json:"-"`
3069
3070
3071
3072
3073
3074 ForceSendFields []string `json:"-"`
3075
3076
3077
3078
3079 NullFields []string `json:"-"`
3080 }
3081
3082 func (s *RawEncryptResponse) MarshalJSON() ([]byte, error) {
3083 type NoMethod RawEncryptResponse
3084 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3085 }
3086
3087
3088
3089 type RestoreCryptoKeyVersionRequest struct {
3090 }
3091
3092
3093
3094 type ServiceResolver struct {
3095
3096
3097
3098
3099
3100 EndpointFilter string `json:"endpointFilter,omitempty"`
3101
3102
3103 Hostname string `json:"hostname,omitempty"`
3104
3105
3106
3107 ServerCertificates []*Certificate `json:"serverCertificates,omitempty"`
3108
3109
3110
3111 ServiceDirectoryService string `json:"serviceDirectoryService,omitempty"`
3112
3113
3114
3115
3116
3117 ForceSendFields []string `json:"-"`
3118
3119
3120
3121
3122 NullFields []string `json:"-"`
3123 }
3124
3125 func (s *ServiceResolver) MarshalJSON() ([]byte, error) {
3126 type NoMethod ServiceResolver
3127 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3128 }
3129
3130
3131 type SetIamPolicyRequest struct {
3132
3133
3134
3135
3136 Policy *Policy `json:"policy,omitempty"`
3137
3138
3139
3140 UpdateMask string `json:"updateMask,omitempty"`
3141
3142
3143
3144
3145
3146 ForceSendFields []string `json:"-"`
3147
3148
3149
3150
3151 NullFields []string `json:"-"`
3152 }
3153
3154 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
3155 type NoMethod SetIamPolicyRequest
3156 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3157 }
3158
3159
3160
3161 type ShowEffectiveAutokeyConfigResponse struct {
3162
3163
3164 KeyProject string `json:"keyProject,omitempty"`
3165
3166
3167 googleapi.ServerResponse `json:"-"`
3168
3169
3170
3171
3172
3173 ForceSendFields []string `json:"-"`
3174
3175
3176
3177
3178 NullFields []string `json:"-"`
3179 }
3180
3181 func (s *ShowEffectiveAutokeyConfigResponse) MarshalJSON() ([]byte, error) {
3182 type NoMethod ShowEffectiveAutokeyConfigResponse
3183 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3184 }
3185
3186
3187
3188
3189
3190
3191
3192 type Status struct {
3193
3194 Code int64 `json:"code,omitempty"`
3195
3196
3197 Details []googleapi.RawMessage `json:"details,omitempty"`
3198
3199
3200
3201 Message string `json:"message,omitempty"`
3202
3203
3204
3205
3206
3207 ForceSendFields []string `json:"-"`
3208
3209
3210
3211
3212 NullFields []string `json:"-"`
3213 }
3214
3215 func (s *Status) MarshalJSON() ([]byte, error) {
3216 type NoMethod Status
3217 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3218 }
3219
3220
3221 type TestIamPermissionsRequest struct {
3222
3223
3224
3225
3226 Permissions []string `json:"permissions,omitempty"`
3227
3228
3229
3230
3231
3232 ForceSendFields []string `json:"-"`
3233
3234
3235
3236
3237 NullFields []string `json:"-"`
3238 }
3239
3240 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
3241 type NoMethod TestIamPermissionsRequest
3242 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3243 }
3244
3245
3246
3247 type TestIamPermissionsResponse struct {
3248
3249
3250 Permissions []string `json:"permissions,omitempty"`
3251
3252
3253 googleapi.ServerResponse `json:"-"`
3254
3255
3256
3257
3258
3259 ForceSendFields []string `json:"-"`
3260
3261
3262
3263
3264 NullFields []string `json:"-"`
3265 }
3266
3267 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
3268 type NoMethod TestIamPermissionsResponse
3269 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3270 }
3271
3272
3273
3274 type UpdateCryptoKeyPrimaryVersionRequest struct {
3275
3276
3277 CryptoKeyVersionId string `json:"cryptoKeyVersionId,omitempty"`
3278
3279
3280
3281
3282
3283 ForceSendFields []string `json:"-"`
3284
3285
3286
3287
3288 NullFields []string `json:"-"`
3289 }
3290
3291 func (s *UpdateCryptoKeyPrimaryVersionRequest) MarshalJSON() ([]byte, error) {
3292 type NoMethod UpdateCryptoKeyPrimaryVersionRequest
3293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3294 }
3295
3296
3297
3298 type VerifyConnectivityResponse struct {
3299
3300 googleapi.ServerResponse `json:"-"`
3301 }
3302
3303
3304
3305 type WrappingPublicKey struct {
3306
3307
3308
3309
3310
3311 Pem string `json:"pem,omitempty"`
3312
3313
3314
3315
3316
3317 ForceSendFields []string `json:"-"`
3318
3319
3320
3321
3322 NullFields []string `json:"-"`
3323 }
3324
3325 func (s *WrappingPublicKey) MarshalJSON() ([]byte, error) {
3326 type NoMethod WrappingPublicKey
3327 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3328 }
3329
3330 type FoldersGetAutokeyConfigCall struct {
3331 s *Service
3332 name string
3333 urlParams_ gensupport.URLParams
3334 ifNoneMatch_ string
3335 ctx_ context.Context
3336 header_ http.Header
3337 }
3338
3339
3340
3341
3342
3343 func (r *FoldersService) GetAutokeyConfig(name string) *FoldersGetAutokeyConfigCall {
3344 c := &FoldersGetAutokeyConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3345 c.name = name
3346 return c
3347 }
3348
3349
3350
3351
3352 func (c *FoldersGetAutokeyConfigCall) Fields(s ...googleapi.Field) *FoldersGetAutokeyConfigCall {
3353 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3354 return c
3355 }
3356
3357
3358
3359
3360 func (c *FoldersGetAutokeyConfigCall) IfNoneMatch(entityTag string) *FoldersGetAutokeyConfigCall {
3361 c.ifNoneMatch_ = entityTag
3362 return c
3363 }
3364
3365
3366 func (c *FoldersGetAutokeyConfigCall) Context(ctx context.Context) *FoldersGetAutokeyConfigCall {
3367 c.ctx_ = ctx
3368 return c
3369 }
3370
3371
3372
3373 func (c *FoldersGetAutokeyConfigCall) Header() http.Header {
3374 if c.header_ == nil {
3375 c.header_ = make(http.Header)
3376 }
3377 return c.header_
3378 }
3379
3380 func (c *FoldersGetAutokeyConfigCall) doRequest(alt string) (*http.Response, error) {
3381 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3382 if c.ifNoneMatch_ != "" {
3383 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3384 }
3385 var body io.Reader = nil
3386 c.urlParams_.Set("alt", alt)
3387 c.urlParams_.Set("prettyPrint", "false")
3388 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3389 urls += "?" + c.urlParams_.Encode()
3390 req, err := http.NewRequest("GET", urls, body)
3391 if err != nil {
3392 return nil, err
3393 }
3394 req.Header = reqHeaders
3395 googleapi.Expand(req.URL, map[string]string{
3396 "name": c.name,
3397 })
3398 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3399 }
3400
3401
3402
3403
3404
3405
3406 func (c *FoldersGetAutokeyConfigCall) Do(opts ...googleapi.CallOption) (*AutokeyConfig, error) {
3407 gensupport.SetOptions(c.urlParams_, opts...)
3408 res, err := c.doRequest("json")
3409 if res != nil && res.StatusCode == http.StatusNotModified {
3410 if res.Body != nil {
3411 res.Body.Close()
3412 }
3413 return nil, gensupport.WrapError(&googleapi.Error{
3414 Code: res.StatusCode,
3415 Header: res.Header,
3416 })
3417 }
3418 if err != nil {
3419 return nil, err
3420 }
3421 defer googleapi.CloseBody(res)
3422 if err := googleapi.CheckResponse(res); err != nil {
3423 return nil, gensupport.WrapError(err)
3424 }
3425 ret := &AutokeyConfig{
3426 ServerResponse: googleapi.ServerResponse{
3427 Header: res.Header,
3428 HTTPStatusCode: res.StatusCode,
3429 },
3430 }
3431 target := &ret
3432 if err := gensupport.DecodeResponse(target, res); err != nil {
3433 return nil, err
3434 }
3435 return ret, nil
3436 }
3437
3438 type FoldersUpdateAutokeyConfigCall struct {
3439 s *Service
3440 name string
3441 autokeyconfig *AutokeyConfig
3442 urlParams_ gensupport.URLParams
3443 ctx_ context.Context
3444 header_ http.Header
3445 }
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455 func (r *FoldersService) UpdateAutokeyConfig(name string, autokeyconfig *AutokeyConfig) *FoldersUpdateAutokeyConfigCall {
3456 c := &FoldersUpdateAutokeyConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3457 c.name = name
3458 c.autokeyconfig = autokeyconfig
3459 return c
3460 }
3461
3462
3463
3464 func (c *FoldersUpdateAutokeyConfigCall) UpdateMask(updateMask string) *FoldersUpdateAutokeyConfigCall {
3465 c.urlParams_.Set("updateMask", updateMask)
3466 return c
3467 }
3468
3469
3470
3471
3472 func (c *FoldersUpdateAutokeyConfigCall) Fields(s ...googleapi.Field) *FoldersUpdateAutokeyConfigCall {
3473 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3474 return c
3475 }
3476
3477
3478 func (c *FoldersUpdateAutokeyConfigCall) Context(ctx context.Context) *FoldersUpdateAutokeyConfigCall {
3479 c.ctx_ = ctx
3480 return c
3481 }
3482
3483
3484
3485 func (c *FoldersUpdateAutokeyConfigCall) Header() http.Header {
3486 if c.header_ == nil {
3487 c.header_ = make(http.Header)
3488 }
3489 return c.header_
3490 }
3491
3492 func (c *FoldersUpdateAutokeyConfigCall) doRequest(alt string) (*http.Response, error) {
3493 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3494 var body io.Reader = nil
3495 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autokeyconfig)
3496 if err != nil {
3497 return nil, err
3498 }
3499 c.urlParams_.Set("alt", alt)
3500 c.urlParams_.Set("prettyPrint", "false")
3501 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3502 urls += "?" + c.urlParams_.Encode()
3503 req, err := http.NewRequest("PATCH", urls, body)
3504 if err != nil {
3505 return nil, err
3506 }
3507 req.Header = reqHeaders
3508 googleapi.Expand(req.URL, map[string]string{
3509 "name": c.name,
3510 })
3511 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3512 }
3513
3514
3515
3516
3517
3518
3519 func (c *FoldersUpdateAutokeyConfigCall) Do(opts ...googleapi.CallOption) (*AutokeyConfig, error) {
3520 gensupport.SetOptions(c.urlParams_, opts...)
3521 res, err := c.doRequest("json")
3522 if res != nil && res.StatusCode == http.StatusNotModified {
3523 if res.Body != nil {
3524 res.Body.Close()
3525 }
3526 return nil, gensupport.WrapError(&googleapi.Error{
3527 Code: res.StatusCode,
3528 Header: res.Header,
3529 })
3530 }
3531 if err != nil {
3532 return nil, err
3533 }
3534 defer googleapi.CloseBody(res)
3535 if err := googleapi.CheckResponse(res); err != nil {
3536 return nil, gensupport.WrapError(err)
3537 }
3538 ret := &AutokeyConfig{
3539 ServerResponse: googleapi.ServerResponse{
3540 Header: res.Header,
3541 HTTPStatusCode: res.StatusCode,
3542 },
3543 }
3544 target := &ret
3545 if err := gensupport.DecodeResponse(target, res); err != nil {
3546 return nil, err
3547 }
3548 return ret, nil
3549 }
3550
3551 type ProjectsShowEffectiveAutokeyConfigCall struct {
3552 s *Service
3553 parent string
3554 urlParams_ gensupport.URLParams
3555 ifNoneMatch_ string
3556 ctx_ context.Context
3557 header_ http.Header
3558 }
3559
3560
3561
3562
3563
3564
3565
3566 func (r *ProjectsService) ShowEffectiveAutokeyConfig(parent string) *ProjectsShowEffectiveAutokeyConfigCall {
3567 c := &ProjectsShowEffectiveAutokeyConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3568 c.parent = parent
3569 return c
3570 }
3571
3572
3573
3574
3575 func (c *ProjectsShowEffectiveAutokeyConfigCall) Fields(s ...googleapi.Field) *ProjectsShowEffectiveAutokeyConfigCall {
3576 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3577 return c
3578 }
3579
3580
3581
3582
3583 func (c *ProjectsShowEffectiveAutokeyConfigCall) IfNoneMatch(entityTag string) *ProjectsShowEffectiveAutokeyConfigCall {
3584 c.ifNoneMatch_ = entityTag
3585 return c
3586 }
3587
3588
3589 func (c *ProjectsShowEffectiveAutokeyConfigCall) Context(ctx context.Context) *ProjectsShowEffectiveAutokeyConfigCall {
3590 c.ctx_ = ctx
3591 return c
3592 }
3593
3594
3595
3596 func (c *ProjectsShowEffectiveAutokeyConfigCall) Header() http.Header {
3597 if c.header_ == nil {
3598 c.header_ = make(http.Header)
3599 }
3600 return c.header_
3601 }
3602
3603 func (c *ProjectsShowEffectiveAutokeyConfigCall) doRequest(alt string) (*http.Response, error) {
3604 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3605 if c.ifNoneMatch_ != "" {
3606 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3607 }
3608 var body io.Reader = nil
3609 c.urlParams_.Set("alt", alt)
3610 c.urlParams_.Set("prettyPrint", "false")
3611 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:showEffectiveAutokeyConfig")
3612 urls += "?" + c.urlParams_.Encode()
3613 req, err := http.NewRequest("GET", urls, body)
3614 if err != nil {
3615 return nil, err
3616 }
3617 req.Header = reqHeaders
3618 googleapi.Expand(req.URL, map[string]string{
3619 "parent": c.parent,
3620 })
3621 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3622 }
3623
3624
3625
3626
3627
3628
3629
3630 func (c *ProjectsShowEffectiveAutokeyConfigCall) Do(opts ...googleapi.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) {
3631 gensupport.SetOptions(c.urlParams_, opts...)
3632 res, err := c.doRequest("json")
3633 if res != nil && res.StatusCode == http.StatusNotModified {
3634 if res.Body != nil {
3635 res.Body.Close()
3636 }
3637 return nil, gensupport.WrapError(&googleapi.Error{
3638 Code: res.StatusCode,
3639 Header: res.Header,
3640 })
3641 }
3642 if err != nil {
3643 return nil, err
3644 }
3645 defer googleapi.CloseBody(res)
3646 if err := googleapi.CheckResponse(res); err != nil {
3647 return nil, gensupport.WrapError(err)
3648 }
3649 ret := &ShowEffectiveAutokeyConfigResponse{
3650 ServerResponse: googleapi.ServerResponse{
3651 Header: res.Header,
3652 HTTPStatusCode: res.StatusCode,
3653 },
3654 }
3655 target := &ret
3656 if err := gensupport.DecodeResponse(target, res); err != nil {
3657 return nil, err
3658 }
3659 return ret, nil
3660 }
3661
3662 type ProjectsLocationsGenerateRandomBytesCall struct {
3663 s *Service
3664 location string
3665 generaterandombytesrequest *GenerateRandomBytesRequest
3666 urlParams_ gensupport.URLParams
3667 ctx_ context.Context
3668 header_ http.Header
3669 }
3670
3671
3672
3673
3674
3675
3676 func (r *ProjectsLocationsService) GenerateRandomBytes(location string, generaterandombytesrequest *GenerateRandomBytesRequest) *ProjectsLocationsGenerateRandomBytesCall {
3677 c := &ProjectsLocationsGenerateRandomBytesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3678 c.location = location
3679 c.generaterandombytesrequest = generaterandombytesrequest
3680 return c
3681 }
3682
3683
3684
3685
3686 func (c *ProjectsLocationsGenerateRandomBytesCall) Fields(s ...googleapi.Field) *ProjectsLocationsGenerateRandomBytesCall {
3687 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3688 return c
3689 }
3690
3691
3692 func (c *ProjectsLocationsGenerateRandomBytesCall) Context(ctx context.Context) *ProjectsLocationsGenerateRandomBytesCall {
3693 c.ctx_ = ctx
3694 return c
3695 }
3696
3697
3698
3699 func (c *ProjectsLocationsGenerateRandomBytesCall) Header() http.Header {
3700 if c.header_ == nil {
3701 c.header_ = make(http.Header)
3702 }
3703 return c.header_
3704 }
3705
3706 func (c *ProjectsLocationsGenerateRandomBytesCall) doRequest(alt string) (*http.Response, error) {
3707 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3708 var body io.Reader = nil
3709 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generaterandombytesrequest)
3710 if err != nil {
3711 return nil, err
3712 }
3713 c.urlParams_.Set("alt", alt)
3714 c.urlParams_.Set("prettyPrint", "false")
3715 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}:generateRandomBytes")
3716 urls += "?" + c.urlParams_.Encode()
3717 req, err := http.NewRequest("POST", urls, body)
3718 if err != nil {
3719 return nil, err
3720 }
3721 req.Header = reqHeaders
3722 googleapi.Expand(req.URL, map[string]string{
3723 "location": c.location,
3724 })
3725 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3726 }
3727
3728
3729
3730
3731
3732
3733
3734 func (c *ProjectsLocationsGenerateRandomBytesCall) Do(opts ...googleapi.CallOption) (*GenerateRandomBytesResponse, error) {
3735 gensupport.SetOptions(c.urlParams_, opts...)
3736 res, err := c.doRequest("json")
3737 if res != nil && res.StatusCode == http.StatusNotModified {
3738 if res.Body != nil {
3739 res.Body.Close()
3740 }
3741 return nil, gensupport.WrapError(&googleapi.Error{
3742 Code: res.StatusCode,
3743 Header: res.Header,
3744 })
3745 }
3746 if err != nil {
3747 return nil, err
3748 }
3749 defer googleapi.CloseBody(res)
3750 if err := googleapi.CheckResponse(res); err != nil {
3751 return nil, gensupport.WrapError(err)
3752 }
3753 ret := &GenerateRandomBytesResponse{
3754 ServerResponse: googleapi.ServerResponse{
3755 Header: res.Header,
3756 HTTPStatusCode: res.StatusCode,
3757 },
3758 }
3759 target := &ret
3760 if err := gensupport.DecodeResponse(target, res); err != nil {
3761 return nil, err
3762 }
3763 return ret, nil
3764 }
3765
3766 type ProjectsLocationsGetCall struct {
3767 s *Service
3768 name string
3769 urlParams_ gensupport.URLParams
3770 ifNoneMatch_ string
3771 ctx_ context.Context
3772 header_ http.Header
3773 }
3774
3775
3776
3777
3778 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
3779 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3780 c.name = name
3781 return c
3782 }
3783
3784
3785
3786
3787 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
3788 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3789 return c
3790 }
3791
3792
3793
3794
3795 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
3796 c.ifNoneMatch_ = entityTag
3797 return c
3798 }
3799
3800
3801 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
3802 c.ctx_ = ctx
3803 return c
3804 }
3805
3806
3807
3808 func (c *ProjectsLocationsGetCall) Header() http.Header {
3809 if c.header_ == nil {
3810 c.header_ = make(http.Header)
3811 }
3812 return c.header_
3813 }
3814
3815 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
3816 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3817 if c.ifNoneMatch_ != "" {
3818 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3819 }
3820 var body io.Reader = nil
3821 c.urlParams_.Set("alt", alt)
3822 c.urlParams_.Set("prettyPrint", "false")
3823 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3824 urls += "?" + c.urlParams_.Encode()
3825 req, err := http.NewRequest("GET", urls, body)
3826 if err != nil {
3827 return nil, err
3828 }
3829 req.Header = reqHeaders
3830 googleapi.Expand(req.URL, map[string]string{
3831 "name": c.name,
3832 })
3833 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3834 }
3835
3836
3837
3838
3839
3840
3841 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
3842 gensupport.SetOptions(c.urlParams_, opts...)
3843 res, err := c.doRequest("json")
3844 if res != nil && res.StatusCode == http.StatusNotModified {
3845 if res.Body != nil {
3846 res.Body.Close()
3847 }
3848 return nil, gensupport.WrapError(&googleapi.Error{
3849 Code: res.StatusCode,
3850 Header: res.Header,
3851 })
3852 }
3853 if err != nil {
3854 return nil, err
3855 }
3856 defer googleapi.CloseBody(res)
3857 if err := googleapi.CheckResponse(res); err != nil {
3858 return nil, gensupport.WrapError(err)
3859 }
3860 ret := &Location{
3861 ServerResponse: googleapi.ServerResponse{
3862 Header: res.Header,
3863 HTTPStatusCode: res.StatusCode,
3864 },
3865 }
3866 target := &ret
3867 if err := gensupport.DecodeResponse(target, res); err != nil {
3868 return nil, err
3869 }
3870 return ret, nil
3871 }
3872
3873 type ProjectsLocationsGetEkmConfigCall struct {
3874 s *Service
3875 name string
3876 urlParams_ gensupport.URLParams
3877 ifNoneMatch_ string
3878 ctx_ context.Context
3879 header_ http.Header
3880 }
3881
3882
3883
3884
3885
3886 func (r *ProjectsLocationsService) GetEkmConfig(name string) *ProjectsLocationsGetEkmConfigCall {
3887 c := &ProjectsLocationsGetEkmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3888 c.name = name
3889 return c
3890 }
3891
3892
3893
3894
3895 func (c *ProjectsLocationsGetEkmConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetEkmConfigCall {
3896 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3897 return c
3898 }
3899
3900
3901
3902
3903 func (c *ProjectsLocationsGetEkmConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetEkmConfigCall {
3904 c.ifNoneMatch_ = entityTag
3905 return c
3906 }
3907
3908
3909 func (c *ProjectsLocationsGetEkmConfigCall) Context(ctx context.Context) *ProjectsLocationsGetEkmConfigCall {
3910 c.ctx_ = ctx
3911 return c
3912 }
3913
3914
3915
3916 func (c *ProjectsLocationsGetEkmConfigCall) Header() http.Header {
3917 if c.header_ == nil {
3918 c.header_ = make(http.Header)
3919 }
3920 return c.header_
3921 }
3922
3923 func (c *ProjectsLocationsGetEkmConfigCall) doRequest(alt string) (*http.Response, error) {
3924 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3925 if c.ifNoneMatch_ != "" {
3926 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3927 }
3928 var body io.Reader = nil
3929 c.urlParams_.Set("alt", alt)
3930 c.urlParams_.Set("prettyPrint", "false")
3931 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3932 urls += "?" + c.urlParams_.Encode()
3933 req, err := http.NewRequest("GET", urls, body)
3934 if err != nil {
3935 return nil, err
3936 }
3937 req.Header = reqHeaders
3938 googleapi.Expand(req.URL, map[string]string{
3939 "name": c.name,
3940 })
3941 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3942 }
3943
3944
3945
3946
3947
3948
3949 func (c *ProjectsLocationsGetEkmConfigCall) Do(opts ...googleapi.CallOption) (*EkmConfig, error) {
3950 gensupport.SetOptions(c.urlParams_, opts...)
3951 res, err := c.doRequest("json")
3952 if res != nil && res.StatusCode == http.StatusNotModified {
3953 if res.Body != nil {
3954 res.Body.Close()
3955 }
3956 return nil, gensupport.WrapError(&googleapi.Error{
3957 Code: res.StatusCode,
3958 Header: res.Header,
3959 })
3960 }
3961 if err != nil {
3962 return nil, err
3963 }
3964 defer googleapi.CloseBody(res)
3965 if err := googleapi.CheckResponse(res); err != nil {
3966 return nil, gensupport.WrapError(err)
3967 }
3968 ret := &EkmConfig{
3969 ServerResponse: googleapi.ServerResponse{
3970 Header: res.Header,
3971 HTTPStatusCode: res.StatusCode,
3972 },
3973 }
3974 target := &ret
3975 if err := gensupport.DecodeResponse(target, res); err != nil {
3976 return nil, err
3977 }
3978 return ret, nil
3979 }
3980
3981 type ProjectsLocationsListCall struct {
3982 s *Service
3983 name string
3984 urlParams_ gensupport.URLParams
3985 ifNoneMatch_ string
3986 ctx_ context.Context
3987 header_ http.Header
3988 }
3989
3990
3991
3992
3993 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
3994 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3995 c.name = name
3996 return c
3997 }
3998
3999
4000
4001
4002
4003 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
4004 c.urlParams_.Set("filter", filter)
4005 return c
4006 }
4007
4008
4009
4010 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
4011 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4012 return c
4013 }
4014
4015
4016
4017
4018 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
4019 c.urlParams_.Set("pageToken", pageToken)
4020 return c
4021 }
4022
4023
4024
4025
4026 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
4027 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4028 return c
4029 }
4030
4031
4032
4033
4034 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
4035 c.ifNoneMatch_ = entityTag
4036 return c
4037 }
4038
4039
4040 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
4041 c.ctx_ = ctx
4042 return c
4043 }
4044
4045
4046
4047 func (c *ProjectsLocationsListCall) Header() http.Header {
4048 if c.header_ == nil {
4049 c.header_ = make(http.Header)
4050 }
4051 return c.header_
4052 }
4053
4054 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
4055 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4056 if c.ifNoneMatch_ != "" {
4057 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4058 }
4059 var body io.Reader = nil
4060 c.urlParams_.Set("alt", alt)
4061 c.urlParams_.Set("prettyPrint", "false")
4062 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
4063 urls += "?" + c.urlParams_.Encode()
4064 req, err := http.NewRequest("GET", urls, body)
4065 if err != nil {
4066 return nil, err
4067 }
4068 req.Header = reqHeaders
4069 googleapi.Expand(req.URL, map[string]string{
4070 "name": c.name,
4071 })
4072 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4073 }
4074
4075
4076
4077
4078
4079
4080
4081 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
4082 gensupport.SetOptions(c.urlParams_, opts...)
4083 res, err := c.doRequest("json")
4084 if res != nil && res.StatusCode == http.StatusNotModified {
4085 if res.Body != nil {
4086 res.Body.Close()
4087 }
4088 return nil, gensupport.WrapError(&googleapi.Error{
4089 Code: res.StatusCode,
4090 Header: res.Header,
4091 })
4092 }
4093 if err != nil {
4094 return nil, err
4095 }
4096 defer googleapi.CloseBody(res)
4097 if err := googleapi.CheckResponse(res); err != nil {
4098 return nil, gensupport.WrapError(err)
4099 }
4100 ret := &ListLocationsResponse{
4101 ServerResponse: googleapi.ServerResponse{
4102 Header: res.Header,
4103 HTTPStatusCode: res.StatusCode,
4104 },
4105 }
4106 target := &ret
4107 if err := gensupport.DecodeResponse(target, res); err != nil {
4108 return nil, err
4109 }
4110 return ret, nil
4111 }
4112
4113
4114
4115
4116 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
4117 c.ctx_ = ctx
4118 defer c.PageToken(c.urlParams_.Get("pageToken"))
4119 for {
4120 x, err := c.Do()
4121 if err != nil {
4122 return err
4123 }
4124 if err := f(x); err != nil {
4125 return err
4126 }
4127 if x.NextPageToken == "" {
4128 return nil
4129 }
4130 c.PageToken(x.NextPageToken)
4131 }
4132 }
4133
4134 type ProjectsLocationsUpdateEkmConfigCall struct {
4135 s *Service
4136 name string
4137 ekmconfig *EkmConfig
4138 urlParams_ gensupport.URLParams
4139 ctx_ context.Context
4140 header_ http.Header
4141 }
4142
4143
4144
4145
4146
4147
4148 func (r *ProjectsLocationsService) UpdateEkmConfig(name string, ekmconfig *EkmConfig) *ProjectsLocationsUpdateEkmConfigCall {
4149 c := &ProjectsLocationsUpdateEkmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4150 c.name = name
4151 c.ekmconfig = ekmconfig
4152 return c
4153 }
4154
4155
4156
4157 func (c *ProjectsLocationsUpdateEkmConfigCall) UpdateMask(updateMask string) *ProjectsLocationsUpdateEkmConfigCall {
4158 c.urlParams_.Set("updateMask", updateMask)
4159 return c
4160 }
4161
4162
4163
4164
4165 func (c *ProjectsLocationsUpdateEkmConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsUpdateEkmConfigCall {
4166 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4167 return c
4168 }
4169
4170
4171 func (c *ProjectsLocationsUpdateEkmConfigCall) Context(ctx context.Context) *ProjectsLocationsUpdateEkmConfigCall {
4172 c.ctx_ = ctx
4173 return c
4174 }
4175
4176
4177
4178 func (c *ProjectsLocationsUpdateEkmConfigCall) Header() http.Header {
4179 if c.header_ == nil {
4180 c.header_ = make(http.Header)
4181 }
4182 return c.header_
4183 }
4184
4185 func (c *ProjectsLocationsUpdateEkmConfigCall) doRequest(alt string) (*http.Response, error) {
4186 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4187 var body io.Reader = nil
4188 body, err := googleapi.WithoutDataWrapper.JSONReader(c.ekmconfig)
4189 if err != nil {
4190 return nil, err
4191 }
4192 c.urlParams_.Set("alt", alt)
4193 c.urlParams_.Set("prettyPrint", "false")
4194 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4195 urls += "?" + c.urlParams_.Encode()
4196 req, err := http.NewRequest("PATCH", urls, body)
4197 if err != nil {
4198 return nil, err
4199 }
4200 req.Header = reqHeaders
4201 googleapi.Expand(req.URL, map[string]string{
4202 "name": c.name,
4203 })
4204 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4205 }
4206
4207
4208
4209
4210
4211
4212 func (c *ProjectsLocationsUpdateEkmConfigCall) Do(opts ...googleapi.CallOption) (*EkmConfig, error) {
4213 gensupport.SetOptions(c.urlParams_, opts...)
4214 res, err := c.doRequest("json")
4215 if res != nil && res.StatusCode == http.StatusNotModified {
4216 if res.Body != nil {
4217 res.Body.Close()
4218 }
4219 return nil, gensupport.WrapError(&googleapi.Error{
4220 Code: res.StatusCode,
4221 Header: res.Header,
4222 })
4223 }
4224 if err != nil {
4225 return nil, err
4226 }
4227 defer googleapi.CloseBody(res)
4228 if err := googleapi.CheckResponse(res); err != nil {
4229 return nil, gensupport.WrapError(err)
4230 }
4231 ret := &EkmConfig{
4232 ServerResponse: googleapi.ServerResponse{
4233 Header: res.Header,
4234 HTTPStatusCode: res.StatusCode,
4235 },
4236 }
4237 target := &ret
4238 if err := gensupport.DecodeResponse(target, res); err != nil {
4239 return nil, err
4240 }
4241 return ret, nil
4242 }
4243
4244 type ProjectsLocationsEkmConfigGetIamPolicyCall struct {
4245 s *Service
4246 resource string
4247 urlParams_ gensupport.URLParams
4248 ifNoneMatch_ string
4249 ctx_ context.Context
4250 header_ http.Header
4251 }
4252
4253
4254
4255
4256
4257
4258
4259 func (r *ProjectsLocationsEkmConfigService) GetIamPolicy(resource string) *ProjectsLocationsEkmConfigGetIamPolicyCall {
4260 c := &ProjectsLocationsEkmConfigGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4261 c.resource = resource
4262 return c
4263 }
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsEkmConfigGetIamPolicyCall {
4278 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
4279 return c
4280 }
4281
4282
4283
4284
4285 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConfigGetIamPolicyCall {
4286 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4287 return c
4288 }
4289
4290
4291
4292
4293 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsEkmConfigGetIamPolicyCall {
4294 c.ifNoneMatch_ = entityTag
4295 return c
4296 }
4297
4298
4299 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEkmConfigGetIamPolicyCall {
4300 c.ctx_ = ctx
4301 return c
4302 }
4303
4304
4305
4306 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) Header() http.Header {
4307 if c.header_ == nil {
4308 c.header_ = make(http.Header)
4309 }
4310 return c.header_
4311 }
4312
4313 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4314 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4315 if c.ifNoneMatch_ != "" {
4316 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4317 }
4318 var body io.Reader = nil
4319 c.urlParams_.Set("alt", alt)
4320 c.urlParams_.Set("prettyPrint", "false")
4321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4322 urls += "?" + c.urlParams_.Encode()
4323 req, err := http.NewRequest("GET", urls, body)
4324 if err != nil {
4325 return nil, err
4326 }
4327 req.Header = reqHeaders
4328 googleapi.Expand(req.URL, map[string]string{
4329 "resource": c.resource,
4330 })
4331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4332 }
4333
4334
4335
4336
4337
4338
4339 func (c *ProjectsLocationsEkmConfigGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4340 gensupport.SetOptions(c.urlParams_, opts...)
4341 res, err := c.doRequest("json")
4342 if res != nil && res.StatusCode == http.StatusNotModified {
4343 if res.Body != nil {
4344 res.Body.Close()
4345 }
4346 return nil, gensupport.WrapError(&googleapi.Error{
4347 Code: res.StatusCode,
4348 Header: res.Header,
4349 })
4350 }
4351 if err != nil {
4352 return nil, err
4353 }
4354 defer googleapi.CloseBody(res)
4355 if err := googleapi.CheckResponse(res); err != nil {
4356 return nil, gensupport.WrapError(err)
4357 }
4358 ret := &Policy{
4359 ServerResponse: googleapi.ServerResponse{
4360 Header: res.Header,
4361 HTTPStatusCode: res.StatusCode,
4362 },
4363 }
4364 target := &ret
4365 if err := gensupport.DecodeResponse(target, res); err != nil {
4366 return nil, err
4367 }
4368 return ret, nil
4369 }
4370
4371 type ProjectsLocationsEkmConfigSetIamPolicyCall struct {
4372 s *Service
4373 resource string
4374 setiampolicyrequest *SetIamPolicyRequest
4375 urlParams_ gensupport.URLParams
4376 ctx_ context.Context
4377 header_ http.Header
4378 }
4379
4380
4381
4382
4383
4384
4385
4386
4387 func (r *ProjectsLocationsEkmConfigService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsEkmConfigSetIamPolicyCall {
4388 c := &ProjectsLocationsEkmConfigSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4389 c.resource = resource
4390 c.setiampolicyrequest = setiampolicyrequest
4391 return c
4392 }
4393
4394
4395
4396
4397 func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConfigSetIamPolicyCall {
4398 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4399 return c
4400 }
4401
4402
4403 func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEkmConfigSetIamPolicyCall {
4404 c.ctx_ = ctx
4405 return c
4406 }
4407
4408
4409
4410 func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) Header() http.Header {
4411 if c.header_ == nil {
4412 c.header_ = make(http.Header)
4413 }
4414 return c.header_
4415 }
4416
4417 func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4418 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4419 var body io.Reader = nil
4420 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4421 if err != nil {
4422 return nil, err
4423 }
4424 c.urlParams_.Set("alt", alt)
4425 c.urlParams_.Set("prettyPrint", "false")
4426 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
4427 urls += "?" + c.urlParams_.Encode()
4428 req, err := http.NewRequest("POST", urls, body)
4429 if err != nil {
4430 return nil, err
4431 }
4432 req.Header = reqHeaders
4433 googleapi.Expand(req.URL, map[string]string{
4434 "resource": c.resource,
4435 })
4436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4437 }
4438
4439
4440
4441
4442
4443
4444 func (c *ProjectsLocationsEkmConfigSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4445 gensupport.SetOptions(c.urlParams_, opts...)
4446 res, err := c.doRequest("json")
4447 if res != nil && res.StatusCode == http.StatusNotModified {
4448 if res.Body != nil {
4449 res.Body.Close()
4450 }
4451 return nil, gensupport.WrapError(&googleapi.Error{
4452 Code: res.StatusCode,
4453 Header: res.Header,
4454 })
4455 }
4456 if err != nil {
4457 return nil, err
4458 }
4459 defer googleapi.CloseBody(res)
4460 if err := googleapi.CheckResponse(res); err != nil {
4461 return nil, gensupport.WrapError(err)
4462 }
4463 ret := &Policy{
4464 ServerResponse: googleapi.ServerResponse{
4465 Header: res.Header,
4466 HTTPStatusCode: res.StatusCode,
4467 },
4468 }
4469 target := &ret
4470 if err := gensupport.DecodeResponse(target, res); err != nil {
4471 return nil, err
4472 }
4473 return ret, nil
4474 }
4475
4476 type ProjectsLocationsEkmConfigTestIamPermissionsCall struct {
4477 s *Service
4478 resource string
4479 testiampermissionsrequest *TestIamPermissionsRequest
4480 urlParams_ gensupport.URLParams
4481 ctx_ context.Context
4482 header_ http.Header
4483 }
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495 func (r *ProjectsLocationsEkmConfigService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsEkmConfigTestIamPermissionsCall {
4496 c := &ProjectsLocationsEkmConfigTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4497 c.resource = resource
4498 c.testiampermissionsrequest = testiampermissionsrequest
4499 return c
4500 }
4501
4502
4503
4504
4505 func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConfigTestIamPermissionsCall {
4506 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4507 return c
4508 }
4509
4510
4511 func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsEkmConfigTestIamPermissionsCall {
4512 c.ctx_ = ctx
4513 return c
4514 }
4515
4516
4517
4518 func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) Header() http.Header {
4519 if c.header_ == nil {
4520 c.header_ = make(http.Header)
4521 }
4522 return c.header_
4523 }
4524
4525 func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4526 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4527 var body io.Reader = nil
4528 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4529 if err != nil {
4530 return nil, err
4531 }
4532 c.urlParams_.Set("alt", alt)
4533 c.urlParams_.Set("prettyPrint", "false")
4534 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
4535 urls += "?" + c.urlParams_.Encode()
4536 req, err := http.NewRequest("POST", urls, body)
4537 if err != nil {
4538 return nil, err
4539 }
4540 req.Header = reqHeaders
4541 googleapi.Expand(req.URL, map[string]string{
4542 "resource": c.resource,
4543 })
4544 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4545 }
4546
4547
4548
4549
4550
4551
4552
4553 func (c *ProjectsLocationsEkmConfigTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4554 gensupport.SetOptions(c.urlParams_, opts...)
4555 res, err := c.doRequest("json")
4556 if res != nil && res.StatusCode == http.StatusNotModified {
4557 if res.Body != nil {
4558 res.Body.Close()
4559 }
4560 return nil, gensupport.WrapError(&googleapi.Error{
4561 Code: res.StatusCode,
4562 Header: res.Header,
4563 })
4564 }
4565 if err != nil {
4566 return nil, err
4567 }
4568 defer googleapi.CloseBody(res)
4569 if err := googleapi.CheckResponse(res); err != nil {
4570 return nil, gensupport.WrapError(err)
4571 }
4572 ret := &TestIamPermissionsResponse{
4573 ServerResponse: googleapi.ServerResponse{
4574 Header: res.Header,
4575 HTTPStatusCode: res.StatusCode,
4576 },
4577 }
4578 target := &ret
4579 if err := gensupport.DecodeResponse(target, res); err != nil {
4580 return nil, err
4581 }
4582 return ret, nil
4583 }
4584
4585 type ProjectsLocationsEkmConnectionsCreateCall struct {
4586 s *Service
4587 parent string
4588 ekmconnection *EkmConnection
4589 urlParams_ gensupport.URLParams
4590 ctx_ context.Context
4591 header_ http.Header
4592 }
4593
4594
4595
4596
4597
4598 func (r *ProjectsLocationsEkmConnectionsService) Create(parent string, ekmconnection *EkmConnection) *ProjectsLocationsEkmConnectionsCreateCall {
4599 c := &ProjectsLocationsEkmConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4600 c.parent = parent
4601 c.ekmconnection = ekmconnection
4602 return c
4603 }
4604
4605
4606
4607
4608 func (c *ProjectsLocationsEkmConnectionsCreateCall) EkmConnectionId(ekmConnectionId string) *ProjectsLocationsEkmConnectionsCreateCall {
4609 c.urlParams_.Set("ekmConnectionId", ekmConnectionId)
4610 return c
4611 }
4612
4613
4614
4615
4616 func (c *ProjectsLocationsEkmConnectionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsCreateCall {
4617 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4618 return c
4619 }
4620
4621
4622 func (c *ProjectsLocationsEkmConnectionsCreateCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsCreateCall {
4623 c.ctx_ = ctx
4624 return c
4625 }
4626
4627
4628
4629 func (c *ProjectsLocationsEkmConnectionsCreateCall) Header() http.Header {
4630 if c.header_ == nil {
4631 c.header_ = make(http.Header)
4632 }
4633 return c.header_
4634 }
4635
4636 func (c *ProjectsLocationsEkmConnectionsCreateCall) doRequest(alt string) (*http.Response, error) {
4637 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4638 var body io.Reader = nil
4639 body, err := googleapi.WithoutDataWrapper.JSONReader(c.ekmconnection)
4640 if err != nil {
4641 return nil, err
4642 }
4643 c.urlParams_.Set("alt", alt)
4644 c.urlParams_.Set("prettyPrint", "false")
4645 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/ekmConnections")
4646 urls += "?" + c.urlParams_.Encode()
4647 req, err := http.NewRequest("POST", urls, body)
4648 if err != nil {
4649 return nil, err
4650 }
4651 req.Header = reqHeaders
4652 googleapi.Expand(req.URL, map[string]string{
4653 "parent": c.parent,
4654 })
4655 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4656 }
4657
4658
4659
4660
4661
4662
4663 func (c *ProjectsLocationsEkmConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*EkmConnection, error) {
4664 gensupport.SetOptions(c.urlParams_, opts...)
4665 res, err := c.doRequest("json")
4666 if res != nil && res.StatusCode == http.StatusNotModified {
4667 if res.Body != nil {
4668 res.Body.Close()
4669 }
4670 return nil, gensupport.WrapError(&googleapi.Error{
4671 Code: res.StatusCode,
4672 Header: res.Header,
4673 })
4674 }
4675 if err != nil {
4676 return nil, err
4677 }
4678 defer googleapi.CloseBody(res)
4679 if err := googleapi.CheckResponse(res); err != nil {
4680 return nil, gensupport.WrapError(err)
4681 }
4682 ret := &EkmConnection{
4683 ServerResponse: googleapi.ServerResponse{
4684 Header: res.Header,
4685 HTTPStatusCode: res.StatusCode,
4686 },
4687 }
4688 target := &ret
4689 if err := gensupport.DecodeResponse(target, res); err != nil {
4690 return nil, err
4691 }
4692 return ret, nil
4693 }
4694
4695 type ProjectsLocationsEkmConnectionsGetCall struct {
4696 s *Service
4697 name string
4698 urlParams_ gensupport.URLParams
4699 ifNoneMatch_ string
4700 ctx_ context.Context
4701 header_ http.Header
4702 }
4703
4704
4705
4706
4707 func (r *ProjectsLocationsEkmConnectionsService) Get(name string) *ProjectsLocationsEkmConnectionsGetCall {
4708 c := &ProjectsLocationsEkmConnectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4709 c.name = name
4710 return c
4711 }
4712
4713
4714
4715
4716 func (c *ProjectsLocationsEkmConnectionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsGetCall {
4717 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4718 return c
4719 }
4720
4721
4722
4723
4724 func (c *ProjectsLocationsEkmConnectionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEkmConnectionsGetCall {
4725 c.ifNoneMatch_ = entityTag
4726 return c
4727 }
4728
4729
4730 func (c *ProjectsLocationsEkmConnectionsGetCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsGetCall {
4731 c.ctx_ = ctx
4732 return c
4733 }
4734
4735
4736
4737 func (c *ProjectsLocationsEkmConnectionsGetCall) Header() http.Header {
4738 if c.header_ == nil {
4739 c.header_ = make(http.Header)
4740 }
4741 return c.header_
4742 }
4743
4744 func (c *ProjectsLocationsEkmConnectionsGetCall) doRequest(alt string) (*http.Response, error) {
4745 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4746 if c.ifNoneMatch_ != "" {
4747 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4748 }
4749 var body io.Reader = nil
4750 c.urlParams_.Set("alt", alt)
4751 c.urlParams_.Set("prettyPrint", "false")
4752 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4753 urls += "?" + c.urlParams_.Encode()
4754 req, err := http.NewRequest("GET", urls, body)
4755 if err != nil {
4756 return nil, err
4757 }
4758 req.Header = reqHeaders
4759 googleapi.Expand(req.URL, map[string]string{
4760 "name": c.name,
4761 })
4762 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4763 }
4764
4765
4766
4767
4768
4769
4770 func (c *ProjectsLocationsEkmConnectionsGetCall) Do(opts ...googleapi.CallOption) (*EkmConnection, error) {
4771 gensupport.SetOptions(c.urlParams_, opts...)
4772 res, err := c.doRequest("json")
4773 if res != nil && res.StatusCode == http.StatusNotModified {
4774 if res.Body != nil {
4775 res.Body.Close()
4776 }
4777 return nil, gensupport.WrapError(&googleapi.Error{
4778 Code: res.StatusCode,
4779 Header: res.Header,
4780 })
4781 }
4782 if err != nil {
4783 return nil, err
4784 }
4785 defer googleapi.CloseBody(res)
4786 if err := googleapi.CheckResponse(res); err != nil {
4787 return nil, gensupport.WrapError(err)
4788 }
4789 ret := &EkmConnection{
4790 ServerResponse: googleapi.ServerResponse{
4791 Header: res.Header,
4792 HTTPStatusCode: res.StatusCode,
4793 },
4794 }
4795 target := &ret
4796 if err := gensupport.DecodeResponse(target, res); err != nil {
4797 return nil, err
4798 }
4799 return ret, nil
4800 }
4801
4802 type ProjectsLocationsEkmConnectionsGetIamPolicyCall struct {
4803 s *Service
4804 resource string
4805 urlParams_ gensupport.URLParams
4806 ifNoneMatch_ string
4807 ctx_ context.Context
4808 header_ http.Header
4809 }
4810
4811
4812
4813
4814
4815
4816
4817 func (r *ProjectsLocationsEkmConnectionsService) GetIamPolicy(resource string) *ProjectsLocationsEkmConnectionsGetIamPolicyCall {
4818 c := &ProjectsLocationsEkmConnectionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4819 c.resource = resource
4820 return c
4821 }
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsEkmConnectionsGetIamPolicyCall {
4836 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
4837 return c
4838 }
4839
4840
4841
4842
4843 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsGetIamPolicyCall {
4844 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4845 return c
4846 }
4847
4848
4849
4850
4851 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsEkmConnectionsGetIamPolicyCall {
4852 c.ifNoneMatch_ = entityTag
4853 return c
4854 }
4855
4856
4857 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsGetIamPolicyCall {
4858 c.ctx_ = ctx
4859 return c
4860 }
4861
4862
4863
4864 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) Header() http.Header {
4865 if c.header_ == nil {
4866 c.header_ = make(http.Header)
4867 }
4868 return c.header_
4869 }
4870
4871 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4872 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4873 if c.ifNoneMatch_ != "" {
4874 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4875 }
4876 var body io.Reader = nil
4877 c.urlParams_.Set("alt", alt)
4878 c.urlParams_.Set("prettyPrint", "false")
4879 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4880 urls += "?" + c.urlParams_.Encode()
4881 req, err := http.NewRequest("GET", urls, body)
4882 if err != nil {
4883 return nil, err
4884 }
4885 req.Header = reqHeaders
4886 googleapi.Expand(req.URL, map[string]string{
4887 "resource": c.resource,
4888 })
4889 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4890 }
4891
4892
4893
4894
4895
4896
4897 func (c *ProjectsLocationsEkmConnectionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4898 gensupport.SetOptions(c.urlParams_, opts...)
4899 res, err := c.doRequest("json")
4900 if res != nil && res.StatusCode == http.StatusNotModified {
4901 if res.Body != nil {
4902 res.Body.Close()
4903 }
4904 return nil, gensupport.WrapError(&googleapi.Error{
4905 Code: res.StatusCode,
4906 Header: res.Header,
4907 })
4908 }
4909 if err != nil {
4910 return nil, err
4911 }
4912 defer googleapi.CloseBody(res)
4913 if err := googleapi.CheckResponse(res); err != nil {
4914 return nil, gensupport.WrapError(err)
4915 }
4916 ret := &Policy{
4917 ServerResponse: googleapi.ServerResponse{
4918 Header: res.Header,
4919 HTTPStatusCode: res.StatusCode,
4920 },
4921 }
4922 target := &ret
4923 if err := gensupport.DecodeResponse(target, res); err != nil {
4924 return nil, err
4925 }
4926 return ret, nil
4927 }
4928
4929 type ProjectsLocationsEkmConnectionsListCall struct {
4930 s *Service
4931 parent string
4932 urlParams_ gensupport.URLParams
4933 ifNoneMatch_ string
4934 ctx_ context.Context
4935 header_ http.Header
4936 }
4937
4938
4939
4940
4941
4942 func (r *ProjectsLocationsEkmConnectionsService) List(parent string) *ProjectsLocationsEkmConnectionsListCall {
4943 c := &ProjectsLocationsEkmConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4944 c.parent = parent
4945 return c
4946 }
4947
4948
4949
4950
4951
4952 func (c *ProjectsLocationsEkmConnectionsListCall) Filter(filter string) *ProjectsLocationsEkmConnectionsListCall {
4953 c.urlParams_.Set("filter", filter)
4954 return c
4955 }
4956
4957
4958
4959
4960
4961 func (c *ProjectsLocationsEkmConnectionsListCall) OrderBy(orderBy string) *ProjectsLocationsEkmConnectionsListCall {
4962 c.urlParams_.Set("orderBy", orderBy)
4963 return c
4964 }
4965
4966
4967
4968
4969
4970
4971 func (c *ProjectsLocationsEkmConnectionsListCall) PageSize(pageSize int64) *ProjectsLocationsEkmConnectionsListCall {
4972 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4973 return c
4974 }
4975
4976
4977
4978 func (c *ProjectsLocationsEkmConnectionsListCall) PageToken(pageToken string) *ProjectsLocationsEkmConnectionsListCall {
4979 c.urlParams_.Set("pageToken", pageToken)
4980 return c
4981 }
4982
4983
4984
4985
4986 func (c *ProjectsLocationsEkmConnectionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsListCall {
4987 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4988 return c
4989 }
4990
4991
4992
4993
4994 func (c *ProjectsLocationsEkmConnectionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEkmConnectionsListCall {
4995 c.ifNoneMatch_ = entityTag
4996 return c
4997 }
4998
4999
5000 func (c *ProjectsLocationsEkmConnectionsListCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsListCall {
5001 c.ctx_ = ctx
5002 return c
5003 }
5004
5005
5006
5007 func (c *ProjectsLocationsEkmConnectionsListCall) Header() http.Header {
5008 if c.header_ == nil {
5009 c.header_ = make(http.Header)
5010 }
5011 return c.header_
5012 }
5013
5014 func (c *ProjectsLocationsEkmConnectionsListCall) doRequest(alt string) (*http.Response, error) {
5015 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5016 if c.ifNoneMatch_ != "" {
5017 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5018 }
5019 var body io.Reader = nil
5020 c.urlParams_.Set("alt", alt)
5021 c.urlParams_.Set("prettyPrint", "false")
5022 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/ekmConnections")
5023 urls += "?" + c.urlParams_.Encode()
5024 req, err := http.NewRequest("GET", urls, body)
5025 if err != nil {
5026 return nil, err
5027 }
5028 req.Header = reqHeaders
5029 googleapi.Expand(req.URL, map[string]string{
5030 "parent": c.parent,
5031 })
5032 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5033 }
5034
5035
5036
5037
5038
5039
5040
5041 func (c *ProjectsLocationsEkmConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListEkmConnectionsResponse, error) {
5042 gensupport.SetOptions(c.urlParams_, opts...)
5043 res, err := c.doRequest("json")
5044 if res != nil && res.StatusCode == http.StatusNotModified {
5045 if res.Body != nil {
5046 res.Body.Close()
5047 }
5048 return nil, gensupport.WrapError(&googleapi.Error{
5049 Code: res.StatusCode,
5050 Header: res.Header,
5051 })
5052 }
5053 if err != nil {
5054 return nil, err
5055 }
5056 defer googleapi.CloseBody(res)
5057 if err := googleapi.CheckResponse(res); err != nil {
5058 return nil, gensupport.WrapError(err)
5059 }
5060 ret := &ListEkmConnectionsResponse{
5061 ServerResponse: googleapi.ServerResponse{
5062 Header: res.Header,
5063 HTTPStatusCode: res.StatusCode,
5064 },
5065 }
5066 target := &ret
5067 if err := gensupport.DecodeResponse(target, res); err != nil {
5068 return nil, err
5069 }
5070 return ret, nil
5071 }
5072
5073
5074
5075
5076 func (c *ProjectsLocationsEkmConnectionsListCall) Pages(ctx context.Context, f func(*ListEkmConnectionsResponse) error) error {
5077 c.ctx_ = ctx
5078 defer c.PageToken(c.urlParams_.Get("pageToken"))
5079 for {
5080 x, err := c.Do()
5081 if err != nil {
5082 return err
5083 }
5084 if err := f(x); err != nil {
5085 return err
5086 }
5087 if x.NextPageToken == "" {
5088 return nil
5089 }
5090 c.PageToken(x.NextPageToken)
5091 }
5092 }
5093
5094 type ProjectsLocationsEkmConnectionsPatchCall struct {
5095 s *Service
5096 name string
5097 ekmconnection *EkmConnection
5098 urlParams_ gensupport.URLParams
5099 ctx_ context.Context
5100 header_ http.Header
5101 }
5102
5103
5104
5105
5106
5107 func (r *ProjectsLocationsEkmConnectionsService) Patch(name string, ekmconnection *EkmConnection) *ProjectsLocationsEkmConnectionsPatchCall {
5108 c := &ProjectsLocationsEkmConnectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5109 c.name = name
5110 c.ekmconnection = ekmconnection
5111 return c
5112 }
5113
5114
5115
5116 func (c *ProjectsLocationsEkmConnectionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEkmConnectionsPatchCall {
5117 c.urlParams_.Set("updateMask", updateMask)
5118 return c
5119 }
5120
5121
5122
5123
5124 func (c *ProjectsLocationsEkmConnectionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsPatchCall {
5125 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5126 return c
5127 }
5128
5129
5130 func (c *ProjectsLocationsEkmConnectionsPatchCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsPatchCall {
5131 c.ctx_ = ctx
5132 return c
5133 }
5134
5135
5136
5137 func (c *ProjectsLocationsEkmConnectionsPatchCall) Header() http.Header {
5138 if c.header_ == nil {
5139 c.header_ = make(http.Header)
5140 }
5141 return c.header_
5142 }
5143
5144 func (c *ProjectsLocationsEkmConnectionsPatchCall) doRequest(alt string) (*http.Response, error) {
5145 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5146 var body io.Reader = nil
5147 body, err := googleapi.WithoutDataWrapper.JSONReader(c.ekmconnection)
5148 if err != nil {
5149 return nil, err
5150 }
5151 c.urlParams_.Set("alt", alt)
5152 c.urlParams_.Set("prettyPrint", "false")
5153 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5154 urls += "?" + c.urlParams_.Encode()
5155 req, err := http.NewRequest("PATCH", urls, body)
5156 if err != nil {
5157 return nil, err
5158 }
5159 req.Header = reqHeaders
5160 googleapi.Expand(req.URL, map[string]string{
5161 "name": c.name,
5162 })
5163 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5164 }
5165
5166
5167
5168
5169
5170
5171 func (c *ProjectsLocationsEkmConnectionsPatchCall) Do(opts ...googleapi.CallOption) (*EkmConnection, error) {
5172 gensupport.SetOptions(c.urlParams_, opts...)
5173 res, err := c.doRequest("json")
5174 if res != nil && res.StatusCode == http.StatusNotModified {
5175 if res.Body != nil {
5176 res.Body.Close()
5177 }
5178 return nil, gensupport.WrapError(&googleapi.Error{
5179 Code: res.StatusCode,
5180 Header: res.Header,
5181 })
5182 }
5183 if err != nil {
5184 return nil, err
5185 }
5186 defer googleapi.CloseBody(res)
5187 if err := googleapi.CheckResponse(res); err != nil {
5188 return nil, gensupport.WrapError(err)
5189 }
5190 ret := &EkmConnection{
5191 ServerResponse: googleapi.ServerResponse{
5192 Header: res.Header,
5193 HTTPStatusCode: res.StatusCode,
5194 },
5195 }
5196 target := &ret
5197 if err := gensupport.DecodeResponse(target, res); err != nil {
5198 return nil, err
5199 }
5200 return ret, nil
5201 }
5202
5203 type ProjectsLocationsEkmConnectionsSetIamPolicyCall struct {
5204 s *Service
5205 resource string
5206 setiampolicyrequest *SetIamPolicyRequest
5207 urlParams_ gensupport.URLParams
5208 ctx_ context.Context
5209 header_ http.Header
5210 }
5211
5212
5213
5214
5215
5216
5217
5218
5219 func (r *ProjectsLocationsEkmConnectionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsEkmConnectionsSetIamPolicyCall {
5220 c := &ProjectsLocationsEkmConnectionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5221 c.resource = resource
5222 c.setiampolicyrequest = setiampolicyrequest
5223 return c
5224 }
5225
5226
5227
5228
5229 func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsSetIamPolicyCall {
5230 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5231 return c
5232 }
5233
5234
5235 func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsSetIamPolicyCall {
5236 c.ctx_ = ctx
5237 return c
5238 }
5239
5240
5241
5242 func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) Header() http.Header {
5243 if c.header_ == nil {
5244 c.header_ = make(http.Header)
5245 }
5246 return c.header_
5247 }
5248
5249 func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5250 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5251 var body io.Reader = nil
5252 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
5253 if err != nil {
5254 return nil, err
5255 }
5256 c.urlParams_.Set("alt", alt)
5257 c.urlParams_.Set("prettyPrint", "false")
5258 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
5259 urls += "?" + c.urlParams_.Encode()
5260 req, err := http.NewRequest("POST", urls, body)
5261 if err != nil {
5262 return nil, err
5263 }
5264 req.Header = reqHeaders
5265 googleapi.Expand(req.URL, map[string]string{
5266 "resource": c.resource,
5267 })
5268 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5269 }
5270
5271
5272
5273
5274
5275
5276 func (c *ProjectsLocationsEkmConnectionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5277 gensupport.SetOptions(c.urlParams_, opts...)
5278 res, err := c.doRequest("json")
5279 if res != nil && res.StatusCode == http.StatusNotModified {
5280 if res.Body != nil {
5281 res.Body.Close()
5282 }
5283 return nil, gensupport.WrapError(&googleapi.Error{
5284 Code: res.StatusCode,
5285 Header: res.Header,
5286 })
5287 }
5288 if err != nil {
5289 return nil, err
5290 }
5291 defer googleapi.CloseBody(res)
5292 if err := googleapi.CheckResponse(res); err != nil {
5293 return nil, gensupport.WrapError(err)
5294 }
5295 ret := &Policy{
5296 ServerResponse: googleapi.ServerResponse{
5297 Header: res.Header,
5298 HTTPStatusCode: res.StatusCode,
5299 },
5300 }
5301 target := &ret
5302 if err := gensupport.DecodeResponse(target, res); err != nil {
5303 return nil, err
5304 }
5305 return ret, nil
5306 }
5307
5308 type ProjectsLocationsEkmConnectionsTestIamPermissionsCall struct {
5309 s *Service
5310 resource string
5311 testiampermissionsrequest *TestIamPermissionsRequest
5312 urlParams_ gensupport.URLParams
5313 ctx_ context.Context
5314 header_ http.Header
5315 }
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327 func (r *ProjectsLocationsEkmConnectionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsEkmConnectionsTestIamPermissionsCall {
5328 c := &ProjectsLocationsEkmConnectionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5329 c.resource = resource
5330 c.testiampermissionsrequest = testiampermissionsrequest
5331 return c
5332 }
5333
5334
5335
5336
5337 func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsTestIamPermissionsCall {
5338 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5339 return c
5340 }
5341
5342
5343 func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsTestIamPermissionsCall {
5344 c.ctx_ = ctx
5345 return c
5346 }
5347
5348
5349
5350 func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) Header() http.Header {
5351 if c.header_ == nil {
5352 c.header_ = make(http.Header)
5353 }
5354 return c.header_
5355 }
5356
5357 func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5358 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5359 var body io.Reader = nil
5360 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
5361 if err != nil {
5362 return nil, err
5363 }
5364 c.urlParams_.Set("alt", alt)
5365 c.urlParams_.Set("prettyPrint", "false")
5366 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
5367 urls += "?" + c.urlParams_.Encode()
5368 req, err := http.NewRequest("POST", urls, body)
5369 if err != nil {
5370 return nil, err
5371 }
5372 req.Header = reqHeaders
5373 googleapi.Expand(req.URL, map[string]string{
5374 "resource": c.resource,
5375 })
5376 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5377 }
5378
5379
5380
5381
5382
5383
5384
5385 func (c *ProjectsLocationsEkmConnectionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5386 gensupport.SetOptions(c.urlParams_, opts...)
5387 res, err := c.doRequest("json")
5388 if res != nil && res.StatusCode == http.StatusNotModified {
5389 if res.Body != nil {
5390 res.Body.Close()
5391 }
5392 return nil, gensupport.WrapError(&googleapi.Error{
5393 Code: res.StatusCode,
5394 Header: res.Header,
5395 })
5396 }
5397 if err != nil {
5398 return nil, err
5399 }
5400 defer googleapi.CloseBody(res)
5401 if err := googleapi.CheckResponse(res); err != nil {
5402 return nil, gensupport.WrapError(err)
5403 }
5404 ret := &TestIamPermissionsResponse{
5405 ServerResponse: googleapi.ServerResponse{
5406 Header: res.Header,
5407 HTTPStatusCode: res.StatusCode,
5408 },
5409 }
5410 target := &ret
5411 if err := gensupport.DecodeResponse(target, res); err != nil {
5412 return nil, err
5413 }
5414 return ret, nil
5415 }
5416
5417 type ProjectsLocationsEkmConnectionsVerifyConnectivityCall struct {
5418 s *Service
5419 name string
5420 urlParams_ gensupport.URLParams
5421 ifNoneMatch_ string
5422 ctx_ context.Context
5423 header_ http.Header
5424 }
5425
5426
5427
5428
5429
5430
5431
5432
5433 func (r *ProjectsLocationsEkmConnectionsService) VerifyConnectivity(name string) *ProjectsLocationsEkmConnectionsVerifyConnectivityCall {
5434 c := &ProjectsLocationsEkmConnectionsVerifyConnectivityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5435 c.name = name
5436 return c
5437 }
5438
5439
5440
5441
5442 func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) Fields(s ...googleapi.Field) *ProjectsLocationsEkmConnectionsVerifyConnectivityCall {
5443 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5444 return c
5445 }
5446
5447
5448
5449
5450 func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) IfNoneMatch(entityTag string) *ProjectsLocationsEkmConnectionsVerifyConnectivityCall {
5451 c.ifNoneMatch_ = entityTag
5452 return c
5453 }
5454
5455
5456 func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) Context(ctx context.Context) *ProjectsLocationsEkmConnectionsVerifyConnectivityCall {
5457 c.ctx_ = ctx
5458 return c
5459 }
5460
5461
5462
5463 func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) Header() http.Header {
5464 if c.header_ == nil {
5465 c.header_ = make(http.Header)
5466 }
5467 return c.header_
5468 }
5469
5470 func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) doRequest(alt string) (*http.Response, error) {
5471 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5472 if c.ifNoneMatch_ != "" {
5473 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5474 }
5475 var body io.Reader = nil
5476 c.urlParams_.Set("alt", alt)
5477 c.urlParams_.Set("prettyPrint", "false")
5478 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:verifyConnectivity")
5479 urls += "?" + c.urlParams_.Encode()
5480 req, err := http.NewRequest("GET", urls, body)
5481 if err != nil {
5482 return nil, err
5483 }
5484 req.Header = reqHeaders
5485 googleapi.Expand(req.URL, map[string]string{
5486 "name": c.name,
5487 })
5488 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5489 }
5490
5491
5492
5493
5494
5495
5496
5497 func (c *ProjectsLocationsEkmConnectionsVerifyConnectivityCall) Do(opts ...googleapi.CallOption) (*VerifyConnectivityResponse, error) {
5498 gensupport.SetOptions(c.urlParams_, opts...)
5499 res, err := c.doRequest("json")
5500 if res != nil && res.StatusCode == http.StatusNotModified {
5501 if res.Body != nil {
5502 res.Body.Close()
5503 }
5504 return nil, gensupport.WrapError(&googleapi.Error{
5505 Code: res.StatusCode,
5506 Header: res.Header,
5507 })
5508 }
5509 if err != nil {
5510 return nil, err
5511 }
5512 defer googleapi.CloseBody(res)
5513 if err := googleapi.CheckResponse(res); err != nil {
5514 return nil, gensupport.WrapError(err)
5515 }
5516 ret := &VerifyConnectivityResponse{
5517 ServerResponse: googleapi.ServerResponse{
5518 Header: res.Header,
5519 HTTPStatusCode: res.StatusCode,
5520 },
5521 }
5522 target := &ret
5523 if err := gensupport.DecodeResponse(target, res); err != nil {
5524 return nil, err
5525 }
5526 return ret, nil
5527 }
5528
5529 type ProjectsLocationsKeyHandlesCreateCall struct {
5530 s *Service
5531 parent string
5532 keyhandle *KeyHandle
5533 urlParams_ gensupport.URLParams
5534 ctx_ context.Context
5535 header_ http.Header
5536 }
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546 func (r *ProjectsLocationsKeyHandlesService) Create(parent string, keyhandle *KeyHandle) *ProjectsLocationsKeyHandlesCreateCall {
5547 c := &ProjectsLocationsKeyHandlesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5548 c.parent = parent
5549 c.keyhandle = keyhandle
5550 return c
5551 }
5552
5553
5554
5555
5556 func (c *ProjectsLocationsKeyHandlesCreateCall) KeyHandleId(keyHandleId string) *ProjectsLocationsKeyHandlesCreateCall {
5557 c.urlParams_.Set("keyHandleId", keyHandleId)
5558 return c
5559 }
5560
5561
5562
5563
5564 func (c *ProjectsLocationsKeyHandlesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyHandlesCreateCall {
5565 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5566 return c
5567 }
5568
5569
5570 func (c *ProjectsLocationsKeyHandlesCreateCall) Context(ctx context.Context) *ProjectsLocationsKeyHandlesCreateCall {
5571 c.ctx_ = ctx
5572 return c
5573 }
5574
5575
5576
5577 func (c *ProjectsLocationsKeyHandlesCreateCall) Header() http.Header {
5578 if c.header_ == nil {
5579 c.header_ = make(http.Header)
5580 }
5581 return c.header_
5582 }
5583
5584 func (c *ProjectsLocationsKeyHandlesCreateCall) doRequest(alt string) (*http.Response, error) {
5585 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5586 var body io.Reader = nil
5587 body, err := googleapi.WithoutDataWrapper.JSONReader(c.keyhandle)
5588 if err != nil {
5589 return nil, err
5590 }
5591 c.urlParams_.Set("alt", alt)
5592 c.urlParams_.Set("prettyPrint", "false")
5593 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keyHandles")
5594 urls += "?" + c.urlParams_.Encode()
5595 req, err := http.NewRequest("POST", urls, body)
5596 if err != nil {
5597 return nil, err
5598 }
5599 req.Header = reqHeaders
5600 googleapi.Expand(req.URL, map[string]string{
5601 "parent": c.parent,
5602 })
5603 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5604 }
5605
5606
5607
5608
5609
5610
5611 func (c *ProjectsLocationsKeyHandlesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5612 gensupport.SetOptions(c.urlParams_, opts...)
5613 res, err := c.doRequest("json")
5614 if res != nil && res.StatusCode == http.StatusNotModified {
5615 if res.Body != nil {
5616 res.Body.Close()
5617 }
5618 return nil, gensupport.WrapError(&googleapi.Error{
5619 Code: res.StatusCode,
5620 Header: res.Header,
5621 })
5622 }
5623 if err != nil {
5624 return nil, err
5625 }
5626 defer googleapi.CloseBody(res)
5627 if err := googleapi.CheckResponse(res); err != nil {
5628 return nil, gensupport.WrapError(err)
5629 }
5630 ret := &Operation{
5631 ServerResponse: googleapi.ServerResponse{
5632 Header: res.Header,
5633 HTTPStatusCode: res.StatusCode,
5634 },
5635 }
5636 target := &ret
5637 if err := gensupport.DecodeResponse(target, res); err != nil {
5638 return nil, err
5639 }
5640 return ret, nil
5641 }
5642
5643 type ProjectsLocationsKeyHandlesGetCall struct {
5644 s *Service
5645 name string
5646 urlParams_ gensupport.URLParams
5647 ifNoneMatch_ string
5648 ctx_ context.Context
5649 header_ http.Header
5650 }
5651
5652
5653
5654
5655
5656 func (r *ProjectsLocationsKeyHandlesService) Get(name string) *ProjectsLocationsKeyHandlesGetCall {
5657 c := &ProjectsLocationsKeyHandlesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5658 c.name = name
5659 return c
5660 }
5661
5662
5663
5664
5665 func (c *ProjectsLocationsKeyHandlesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyHandlesGetCall {
5666 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5667 return c
5668 }
5669
5670
5671
5672
5673 func (c *ProjectsLocationsKeyHandlesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyHandlesGetCall {
5674 c.ifNoneMatch_ = entityTag
5675 return c
5676 }
5677
5678
5679 func (c *ProjectsLocationsKeyHandlesGetCall) Context(ctx context.Context) *ProjectsLocationsKeyHandlesGetCall {
5680 c.ctx_ = ctx
5681 return c
5682 }
5683
5684
5685
5686 func (c *ProjectsLocationsKeyHandlesGetCall) Header() http.Header {
5687 if c.header_ == nil {
5688 c.header_ = make(http.Header)
5689 }
5690 return c.header_
5691 }
5692
5693 func (c *ProjectsLocationsKeyHandlesGetCall) doRequest(alt string) (*http.Response, error) {
5694 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5695 if c.ifNoneMatch_ != "" {
5696 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5697 }
5698 var body io.Reader = nil
5699 c.urlParams_.Set("alt", alt)
5700 c.urlParams_.Set("prettyPrint", "false")
5701 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5702 urls += "?" + c.urlParams_.Encode()
5703 req, err := http.NewRequest("GET", urls, body)
5704 if err != nil {
5705 return nil, err
5706 }
5707 req.Header = reqHeaders
5708 googleapi.Expand(req.URL, map[string]string{
5709 "name": c.name,
5710 })
5711 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5712 }
5713
5714
5715
5716
5717
5718
5719 func (c *ProjectsLocationsKeyHandlesGetCall) Do(opts ...googleapi.CallOption) (*KeyHandle, error) {
5720 gensupport.SetOptions(c.urlParams_, opts...)
5721 res, err := c.doRequest("json")
5722 if res != nil && res.StatusCode == http.StatusNotModified {
5723 if res.Body != nil {
5724 res.Body.Close()
5725 }
5726 return nil, gensupport.WrapError(&googleapi.Error{
5727 Code: res.StatusCode,
5728 Header: res.Header,
5729 })
5730 }
5731 if err != nil {
5732 return nil, err
5733 }
5734 defer googleapi.CloseBody(res)
5735 if err := googleapi.CheckResponse(res); err != nil {
5736 return nil, gensupport.WrapError(err)
5737 }
5738 ret := &KeyHandle{
5739 ServerResponse: googleapi.ServerResponse{
5740 Header: res.Header,
5741 HTTPStatusCode: res.StatusCode,
5742 },
5743 }
5744 target := &ret
5745 if err := gensupport.DecodeResponse(target, res); err != nil {
5746 return nil, err
5747 }
5748 return ret, nil
5749 }
5750
5751 type ProjectsLocationsKeyHandlesListCall struct {
5752 s *Service
5753 parent string
5754 urlParams_ gensupport.URLParams
5755 ifNoneMatch_ string
5756 ctx_ context.Context
5757 header_ http.Header
5758 }
5759
5760
5761
5762
5763
5764 func (r *ProjectsLocationsKeyHandlesService) List(parent string) *ProjectsLocationsKeyHandlesListCall {
5765 c := &ProjectsLocationsKeyHandlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5766 c.parent = parent
5767 return c
5768 }
5769
5770
5771
5772 func (c *ProjectsLocationsKeyHandlesListCall) Filter(filter string) *ProjectsLocationsKeyHandlesListCall {
5773 c.urlParams_.Set("filter", filter)
5774 return c
5775 }
5776
5777
5778
5779
5780 func (c *ProjectsLocationsKeyHandlesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyHandlesListCall {
5781 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5782 return c
5783 }
5784
5785
5786
5787
5788 func (c *ProjectsLocationsKeyHandlesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyHandlesListCall {
5789 c.ifNoneMatch_ = entityTag
5790 return c
5791 }
5792
5793
5794 func (c *ProjectsLocationsKeyHandlesListCall) Context(ctx context.Context) *ProjectsLocationsKeyHandlesListCall {
5795 c.ctx_ = ctx
5796 return c
5797 }
5798
5799
5800
5801 func (c *ProjectsLocationsKeyHandlesListCall) Header() http.Header {
5802 if c.header_ == nil {
5803 c.header_ = make(http.Header)
5804 }
5805 return c.header_
5806 }
5807
5808 func (c *ProjectsLocationsKeyHandlesListCall) doRequest(alt string) (*http.Response, error) {
5809 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5810 if c.ifNoneMatch_ != "" {
5811 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5812 }
5813 var body io.Reader = nil
5814 c.urlParams_.Set("alt", alt)
5815 c.urlParams_.Set("prettyPrint", "false")
5816 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keyHandles")
5817 urls += "?" + c.urlParams_.Encode()
5818 req, err := http.NewRequest("GET", urls, body)
5819 if err != nil {
5820 return nil, err
5821 }
5822 req.Header = reqHeaders
5823 googleapi.Expand(req.URL, map[string]string{
5824 "parent": c.parent,
5825 })
5826 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5827 }
5828
5829
5830
5831
5832
5833
5834
5835 func (c *ProjectsLocationsKeyHandlesListCall) Do(opts ...googleapi.CallOption) (*ListKeyHandlesResponse, error) {
5836 gensupport.SetOptions(c.urlParams_, opts...)
5837 res, err := c.doRequest("json")
5838 if res != nil && res.StatusCode == http.StatusNotModified {
5839 if res.Body != nil {
5840 res.Body.Close()
5841 }
5842 return nil, gensupport.WrapError(&googleapi.Error{
5843 Code: res.StatusCode,
5844 Header: res.Header,
5845 })
5846 }
5847 if err != nil {
5848 return nil, err
5849 }
5850 defer googleapi.CloseBody(res)
5851 if err := googleapi.CheckResponse(res); err != nil {
5852 return nil, gensupport.WrapError(err)
5853 }
5854 ret := &ListKeyHandlesResponse{
5855 ServerResponse: googleapi.ServerResponse{
5856 Header: res.Header,
5857 HTTPStatusCode: res.StatusCode,
5858 },
5859 }
5860 target := &ret
5861 if err := gensupport.DecodeResponse(target, res); err != nil {
5862 return nil, err
5863 }
5864 return ret, nil
5865 }
5866
5867 type ProjectsLocationsKeyRingsCreateCall struct {
5868 s *Service
5869 parent string
5870 keyring *KeyRing
5871 urlParams_ gensupport.URLParams
5872 ctx_ context.Context
5873 header_ http.Header
5874 }
5875
5876
5877
5878
5879
5880 func (r *ProjectsLocationsKeyRingsService) Create(parent string, keyring *KeyRing) *ProjectsLocationsKeyRingsCreateCall {
5881 c := &ProjectsLocationsKeyRingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5882 c.parent = parent
5883 c.keyring = keyring
5884 return c
5885 }
5886
5887
5888
5889
5890 func (c *ProjectsLocationsKeyRingsCreateCall) KeyRingId(keyRingId string) *ProjectsLocationsKeyRingsCreateCall {
5891 c.urlParams_.Set("keyRingId", keyRingId)
5892 return c
5893 }
5894
5895
5896
5897
5898 func (c *ProjectsLocationsKeyRingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCreateCall {
5899 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5900 return c
5901 }
5902
5903
5904 func (c *ProjectsLocationsKeyRingsCreateCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCreateCall {
5905 c.ctx_ = ctx
5906 return c
5907 }
5908
5909
5910
5911 func (c *ProjectsLocationsKeyRingsCreateCall) Header() http.Header {
5912 if c.header_ == nil {
5913 c.header_ = make(http.Header)
5914 }
5915 return c.header_
5916 }
5917
5918 func (c *ProjectsLocationsKeyRingsCreateCall) doRequest(alt string) (*http.Response, error) {
5919 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5920 var body io.Reader = nil
5921 body, err := googleapi.WithoutDataWrapper.JSONReader(c.keyring)
5922 if err != nil {
5923 return nil, err
5924 }
5925 c.urlParams_.Set("alt", alt)
5926 c.urlParams_.Set("prettyPrint", "false")
5927 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keyRings")
5928 urls += "?" + c.urlParams_.Encode()
5929 req, err := http.NewRequest("POST", urls, body)
5930 if err != nil {
5931 return nil, err
5932 }
5933 req.Header = reqHeaders
5934 googleapi.Expand(req.URL, map[string]string{
5935 "parent": c.parent,
5936 })
5937 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5938 }
5939
5940
5941
5942
5943
5944
5945 func (c *ProjectsLocationsKeyRingsCreateCall) Do(opts ...googleapi.CallOption) (*KeyRing, error) {
5946 gensupport.SetOptions(c.urlParams_, opts...)
5947 res, err := c.doRequest("json")
5948 if res != nil && res.StatusCode == http.StatusNotModified {
5949 if res.Body != nil {
5950 res.Body.Close()
5951 }
5952 return nil, gensupport.WrapError(&googleapi.Error{
5953 Code: res.StatusCode,
5954 Header: res.Header,
5955 })
5956 }
5957 if err != nil {
5958 return nil, err
5959 }
5960 defer googleapi.CloseBody(res)
5961 if err := googleapi.CheckResponse(res); err != nil {
5962 return nil, gensupport.WrapError(err)
5963 }
5964 ret := &KeyRing{
5965 ServerResponse: googleapi.ServerResponse{
5966 Header: res.Header,
5967 HTTPStatusCode: res.StatusCode,
5968 },
5969 }
5970 target := &ret
5971 if err := gensupport.DecodeResponse(target, res); err != nil {
5972 return nil, err
5973 }
5974 return ret, nil
5975 }
5976
5977 type ProjectsLocationsKeyRingsGetCall struct {
5978 s *Service
5979 name string
5980 urlParams_ gensupport.URLParams
5981 ifNoneMatch_ string
5982 ctx_ context.Context
5983 header_ http.Header
5984 }
5985
5986
5987
5988
5989 func (r *ProjectsLocationsKeyRingsService) Get(name string) *ProjectsLocationsKeyRingsGetCall {
5990 c := &ProjectsLocationsKeyRingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5991 c.name = name
5992 return c
5993 }
5994
5995
5996
5997
5998 func (c *ProjectsLocationsKeyRingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsGetCall {
5999 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6000 return c
6001 }
6002
6003
6004
6005
6006 func (c *ProjectsLocationsKeyRingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsGetCall {
6007 c.ifNoneMatch_ = entityTag
6008 return c
6009 }
6010
6011
6012 func (c *ProjectsLocationsKeyRingsGetCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsGetCall {
6013 c.ctx_ = ctx
6014 return c
6015 }
6016
6017
6018
6019 func (c *ProjectsLocationsKeyRingsGetCall) Header() http.Header {
6020 if c.header_ == nil {
6021 c.header_ = make(http.Header)
6022 }
6023 return c.header_
6024 }
6025
6026 func (c *ProjectsLocationsKeyRingsGetCall) doRequest(alt string) (*http.Response, error) {
6027 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6028 if c.ifNoneMatch_ != "" {
6029 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6030 }
6031 var body io.Reader = nil
6032 c.urlParams_.Set("alt", alt)
6033 c.urlParams_.Set("prettyPrint", "false")
6034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6035 urls += "?" + c.urlParams_.Encode()
6036 req, err := http.NewRequest("GET", urls, body)
6037 if err != nil {
6038 return nil, err
6039 }
6040 req.Header = reqHeaders
6041 googleapi.Expand(req.URL, map[string]string{
6042 "name": c.name,
6043 })
6044 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6045 }
6046
6047
6048
6049
6050
6051
6052 func (c *ProjectsLocationsKeyRingsGetCall) Do(opts ...googleapi.CallOption) (*KeyRing, error) {
6053 gensupport.SetOptions(c.urlParams_, opts...)
6054 res, err := c.doRequest("json")
6055 if res != nil && res.StatusCode == http.StatusNotModified {
6056 if res.Body != nil {
6057 res.Body.Close()
6058 }
6059 return nil, gensupport.WrapError(&googleapi.Error{
6060 Code: res.StatusCode,
6061 Header: res.Header,
6062 })
6063 }
6064 if err != nil {
6065 return nil, err
6066 }
6067 defer googleapi.CloseBody(res)
6068 if err := googleapi.CheckResponse(res); err != nil {
6069 return nil, gensupport.WrapError(err)
6070 }
6071 ret := &KeyRing{
6072 ServerResponse: googleapi.ServerResponse{
6073 Header: res.Header,
6074 HTTPStatusCode: res.StatusCode,
6075 },
6076 }
6077 target := &ret
6078 if err := gensupport.DecodeResponse(target, res); err != nil {
6079 return nil, err
6080 }
6081 return ret, nil
6082 }
6083
6084 type ProjectsLocationsKeyRingsGetIamPolicyCall struct {
6085 s *Service
6086 resource string
6087 urlParams_ gensupport.URLParams
6088 ifNoneMatch_ string
6089 ctx_ context.Context
6090 header_ http.Header
6091 }
6092
6093
6094
6095
6096
6097
6098
6099 func (r *ProjectsLocationsKeyRingsService) GetIamPolicy(resource string) *ProjectsLocationsKeyRingsGetIamPolicyCall {
6100 c := &ProjectsLocationsKeyRingsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6101 c.resource = resource
6102 return c
6103 }
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsKeyRingsGetIamPolicyCall {
6118 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
6119 return c
6120 }
6121
6122
6123
6124
6125 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsGetIamPolicyCall {
6126 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6127 return c
6128 }
6129
6130
6131
6132
6133 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsGetIamPolicyCall {
6134 c.ifNoneMatch_ = entityTag
6135 return c
6136 }
6137
6138
6139 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsGetIamPolicyCall {
6140 c.ctx_ = ctx
6141 return c
6142 }
6143
6144
6145
6146 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) Header() http.Header {
6147 if c.header_ == nil {
6148 c.header_ = make(http.Header)
6149 }
6150 return c.header_
6151 }
6152
6153 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6154 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6155 if c.ifNoneMatch_ != "" {
6156 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6157 }
6158 var body io.Reader = nil
6159 c.urlParams_.Set("alt", alt)
6160 c.urlParams_.Set("prettyPrint", "false")
6161 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
6162 urls += "?" + c.urlParams_.Encode()
6163 req, err := http.NewRequest("GET", urls, body)
6164 if err != nil {
6165 return nil, err
6166 }
6167 req.Header = reqHeaders
6168 googleapi.Expand(req.URL, map[string]string{
6169 "resource": c.resource,
6170 })
6171 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6172 }
6173
6174
6175
6176
6177
6178
6179 func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6180 gensupport.SetOptions(c.urlParams_, opts...)
6181 res, err := c.doRequest("json")
6182 if res != nil && res.StatusCode == http.StatusNotModified {
6183 if res.Body != nil {
6184 res.Body.Close()
6185 }
6186 return nil, gensupport.WrapError(&googleapi.Error{
6187 Code: res.StatusCode,
6188 Header: res.Header,
6189 })
6190 }
6191 if err != nil {
6192 return nil, err
6193 }
6194 defer googleapi.CloseBody(res)
6195 if err := googleapi.CheckResponse(res); err != nil {
6196 return nil, gensupport.WrapError(err)
6197 }
6198 ret := &Policy{
6199 ServerResponse: googleapi.ServerResponse{
6200 Header: res.Header,
6201 HTTPStatusCode: res.StatusCode,
6202 },
6203 }
6204 target := &ret
6205 if err := gensupport.DecodeResponse(target, res); err != nil {
6206 return nil, err
6207 }
6208 return ret, nil
6209 }
6210
6211 type ProjectsLocationsKeyRingsListCall struct {
6212 s *Service
6213 parent string
6214 urlParams_ gensupport.URLParams
6215 ifNoneMatch_ string
6216 ctx_ context.Context
6217 header_ http.Header
6218 }
6219
6220
6221
6222
6223
6224 func (r *ProjectsLocationsKeyRingsService) List(parent string) *ProjectsLocationsKeyRingsListCall {
6225 c := &ProjectsLocationsKeyRingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6226 c.parent = parent
6227 return c
6228 }
6229
6230
6231
6232
6233
6234 func (c *ProjectsLocationsKeyRingsListCall) Filter(filter string) *ProjectsLocationsKeyRingsListCall {
6235 c.urlParams_.Set("filter", filter)
6236 return c
6237 }
6238
6239
6240
6241
6242
6243 func (c *ProjectsLocationsKeyRingsListCall) OrderBy(orderBy string) *ProjectsLocationsKeyRingsListCall {
6244 c.urlParams_.Set("orderBy", orderBy)
6245 return c
6246 }
6247
6248
6249
6250
6251
6252
6253 func (c *ProjectsLocationsKeyRingsListCall) PageSize(pageSize int64) *ProjectsLocationsKeyRingsListCall {
6254 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6255 return c
6256 }
6257
6258
6259
6260 func (c *ProjectsLocationsKeyRingsListCall) PageToken(pageToken string) *ProjectsLocationsKeyRingsListCall {
6261 c.urlParams_.Set("pageToken", pageToken)
6262 return c
6263 }
6264
6265
6266
6267
6268 func (c *ProjectsLocationsKeyRingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsListCall {
6269 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6270 return c
6271 }
6272
6273
6274
6275
6276 func (c *ProjectsLocationsKeyRingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsListCall {
6277 c.ifNoneMatch_ = entityTag
6278 return c
6279 }
6280
6281
6282 func (c *ProjectsLocationsKeyRingsListCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsListCall {
6283 c.ctx_ = ctx
6284 return c
6285 }
6286
6287
6288
6289 func (c *ProjectsLocationsKeyRingsListCall) Header() http.Header {
6290 if c.header_ == nil {
6291 c.header_ = make(http.Header)
6292 }
6293 return c.header_
6294 }
6295
6296 func (c *ProjectsLocationsKeyRingsListCall) doRequest(alt string) (*http.Response, error) {
6297 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6298 if c.ifNoneMatch_ != "" {
6299 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6300 }
6301 var body io.Reader = nil
6302 c.urlParams_.Set("alt", alt)
6303 c.urlParams_.Set("prettyPrint", "false")
6304 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/keyRings")
6305 urls += "?" + c.urlParams_.Encode()
6306 req, err := http.NewRequest("GET", urls, body)
6307 if err != nil {
6308 return nil, err
6309 }
6310 req.Header = reqHeaders
6311 googleapi.Expand(req.URL, map[string]string{
6312 "parent": c.parent,
6313 })
6314 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6315 }
6316
6317
6318
6319
6320
6321
6322
6323 func (c *ProjectsLocationsKeyRingsListCall) Do(opts ...googleapi.CallOption) (*ListKeyRingsResponse, error) {
6324 gensupport.SetOptions(c.urlParams_, opts...)
6325 res, err := c.doRequest("json")
6326 if res != nil && res.StatusCode == http.StatusNotModified {
6327 if res.Body != nil {
6328 res.Body.Close()
6329 }
6330 return nil, gensupport.WrapError(&googleapi.Error{
6331 Code: res.StatusCode,
6332 Header: res.Header,
6333 })
6334 }
6335 if err != nil {
6336 return nil, err
6337 }
6338 defer googleapi.CloseBody(res)
6339 if err := googleapi.CheckResponse(res); err != nil {
6340 return nil, gensupport.WrapError(err)
6341 }
6342 ret := &ListKeyRingsResponse{
6343 ServerResponse: googleapi.ServerResponse{
6344 Header: res.Header,
6345 HTTPStatusCode: res.StatusCode,
6346 },
6347 }
6348 target := &ret
6349 if err := gensupport.DecodeResponse(target, res); err != nil {
6350 return nil, err
6351 }
6352 return ret, nil
6353 }
6354
6355
6356
6357
6358 func (c *ProjectsLocationsKeyRingsListCall) Pages(ctx context.Context, f func(*ListKeyRingsResponse) error) error {
6359 c.ctx_ = ctx
6360 defer c.PageToken(c.urlParams_.Get("pageToken"))
6361 for {
6362 x, err := c.Do()
6363 if err != nil {
6364 return err
6365 }
6366 if err := f(x); err != nil {
6367 return err
6368 }
6369 if x.NextPageToken == "" {
6370 return nil
6371 }
6372 c.PageToken(x.NextPageToken)
6373 }
6374 }
6375
6376 type ProjectsLocationsKeyRingsSetIamPolicyCall struct {
6377 s *Service
6378 resource string
6379 setiampolicyrequest *SetIamPolicyRequest
6380 urlParams_ gensupport.URLParams
6381 ctx_ context.Context
6382 header_ http.Header
6383 }
6384
6385
6386
6387
6388
6389
6390
6391
6392 func (r *ProjectsLocationsKeyRingsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsKeyRingsSetIamPolicyCall {
6393 c := &ProjectsLocationsKeyRingsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6394 c.resource = resource
6395 c.setiampolicyrequest = setiampolicyrequest
6396 return c
6397 }
6398
6399
6400
6401
6402 func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsSetIamPolicyCall {
6403 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6404 return c
6405 }
6406
6407
6408 func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsSetIamPolicyCall {
6409 c.ctx_ = ctx
6410 return c
6411 }
6412
6413
6414
6415 func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) Header() http.Header {
6416 if c.header_ == nil {
6417 c.header_ = make(http.Header)
6418 }
6419 return c.header_
6420 }
6421
6422 func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6423 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6424 var body io.Reader = nil
6425 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
6426 if err != nil {
6427 return nil, err
6428 }
6429 c.urlParams_.Set("alt", alt)
6430 c.urlParams_.Set("prettyPrint", "false")
6431 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
6432 urls += "?" + c.urlParams_.Encode()
6433 req, err := http.NewRequest("POST", urls, body)
6434 if err != nil {
6435 return nil, err
6436 }
6437 req.Header = reqHeaders
6438 googleapi.Expand(req.URL, map[string]string{
6439 "resource": c.resource,
6440 })
6441 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6442 }
6443
6444
6445
6446
6447
6448
6449 func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6450 gensupport.SetOptions(c.urlParams_, opts...)
6451 res, err := c.doRequest("json")
6452 if res != nil && res.StatusCode == http.StatusNotModified {
6453 if res.Body != nil {
6454 res.Body.Close()
6455 }
6456 return nil, gensupport.WrapError(&googleapi.Error{
6457 Code: res.StatusCode,
6458 Header: res.Header,
6459 })
6460 }
6461 if err != nil {
6462 return nil, err
6463 }
6464 defer googleapi.CloseBody(res)
6465 if err := googleapi.CheckResponse(res); err != nil {
6466 return nil, gensupport.WrapError(err)
6467 }
6468 ret := &Policy{
6469 ServerResponse: googleapi.ServerResponse{
6470 Header: res.Header,
6471 HTTPStatusCode: res.StatusCode,
6472 },
6473 }
6474 target := &ret
6475 if err := gensupport.DecodeResponse(target, res); err != nil {
6476 return nil, err
6477 }
6478 return ret, nil
6479 }
6480
6481 type ProjectsLocationsKeyRingsTestIamPermissionsCall struct {
6482 s *Service
6483 resource string
6484 testiampermissionsrequest *TestIamPermissionsRequest
6485 urlParams_ gensupport.URLParams
6486 ctx_ context.Context
6487 header_ http.Header
6488 }
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500 func (r *ProjectsLocationsKeyRingsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsKeyRingsTestIamPermissionsCall {
6501 c := &ProjectsLocationsKeyRingsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6502 c.resource = resource
6503 c.testiampermissionsrequest = testiampermissionsrequest
6504 return c
6505 }
6506
6507
6508
6509
6510 func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsTestIamPermissionsCall {
6511 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6512 return c
6513 }
6514
6515
6516 func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsTestIamPermissionsCall {
6517 c.ctx_ = ctx
6518 return c
6519 }
6520
6521
6522
6523 func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) Header() http.Header {
6524 if c.header_ == nil {
6525 c.header_ = make(http.Header)
6526 }
6527 return c.header_
6528 }
6529
6530 func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6531 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6532 var body io.Reader = nil
6533 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
6534 if err != nil {
6535 return nil, err
6536 }
6537 c.urlParams_.Set("alt", alt)
6538 c.urlParams_.Set("prettyPrint", "false")
6539 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6540 urls += "?" + c.urlParams_.Encode()
6541 req, err := http.NewRequest("POST", urls, body)
6542 if err != nil {
6543 return nil, err
6544 }
6545 req.Header = reqHeaders
6546 googleapi.Expand(req.URL, map[string]string{
6547 "resource": c.resource,
6548 })
6549 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6550 }
6551
6552
6553
6554
6555
6556
6557
6558 func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6559 gensupport.SetOptions(c.urlParams_, opts...)
6560 res, err := c.doRequest("json")
6561 if res != nil && res.StatusCode == http.StatusNotModified {
6562 if res.Body != nil {
6563 res.Body.Close()
6564 }
6565 return nil, gensupport.WrapError(&googleapi.Error{
6566 Code: res.StatusCode,
6567 Header: res.Header,
6568 })
6569 }
6570 if err != nil {
6571 return nil, err
6572 }
6573 defer googleapi.CloseBody(res)
6574 if err := googleapi.CheckResponse(res); err != nil {
6575 return nil, gensupport.WrapError(err)
6576 }
6577 ret := &TestIamPermissionsResponse{
6578 ServerResponse: googleapi.ServerResponse{
6579 Header: res.Header,
6580 HTTPStatusCode: res.StatusCode,
6581 },
6582 }
6583 target := &ret
6584 if err := gensupport.DecodeResponse(target, res); err != nil {
6585 return nil, err
6586 }
6587 return ret, nil
6588 }
6589
6590 type ProjectsLocationsKeyRingsCryptoKeysCreateCall struct {
6591 s *Service
6592 parent string
6593 cryptokey *CryptoKey
6594 urlParams_ gensupport.URLParams
6595 ctx_ context.Context
6596 header_ http.Header
6597 }
6598
6599
6600
6601
6602
6603 func (r *ProjectsLocationsKeyRingsCryptoKeysService) Create(parent string, cryptokey *CryptoKey) *ProjectsLocationsKeyRingsCryptoKeysCreateCall {
6604 c := &ProjectsLocationsKeyRingsCryptoKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6605 c.parent = parent
6606 c.cryptokey = cryptokey
6607 return c
6608 }
6609
6610
6611
6612
6613 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) CryptoKeyId(cryptoKeyId string) *ProjectsLocationsKeyRingsCryptoKeysCreateCall {
6614 c.urlParams_.Set("cryptoKeyId", cryptoKeyId)
6615 return c
6616 }
6617
6618
6619
6620
6621
6622
6623 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) SkipInitialVersionCreation(skipInitialVersionCreation bool) *ProjectsLocationsKeyRingsCryptoKeysCreateCall {
6624 c.urlParams_.Set("skipInitialVersionCreation", fmt.Sprint(skipInitialVersionCreation))
6625 return c
6626 }
6627
6628
6629
6630
6631 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCreateCall {
6632 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6633 return c
6634 }
6635
6636
6637 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCreateCall {
6638 c.ctx_ = ctx
6639 return c
6640 }
6641
6642
6643
6644 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) Header() http.Header {
6645 if c.header_ == nil {
6646 c.header_ = make(http.Header)
6647 }
6648 return c.header_
6649 }
6650
6651 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) doRequest(alt string) (*http.Response, error) {
6652 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6653 var body io.Reader = nil
6654 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokey)
6655 if err != nil {
6656 return nil, err
6657 }
6658 c.urlParams_.Set("alt", alt)
6659 c.urlParams_.Set("prettyPrint", "false")
6660 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeys")
6661 urls += "?" + c.urlParams_.Encode()
6662 req, err := http.NewRequest("POST", urls, body)
6663 if err != nil {
6664 return nil, err
6665 }
6666 req.Header = reqHeaders
6667 googleapi.Expand(req.URL, map[string]string{
6668 "parent": c.parent,
6669 })
6670 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6671 }
6672
6673
6674
6675
6676
6677
6678 func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) Do(opts ...googleapi.CallOption) (*CryptoKey, error) {
6679 gensupport.SetOptions(c.urlParams_, opts...)
6680 res, err := c.doRequest("json")
6681 if res != nil && res.StatusCode == http.StatusNotModified {
6682 if res.Body != nil {
6683 res.Body.Close()
6684 }
6685 return nil, gensupport.WrapError(&googleapi.Error{
6686 Code: res.StatusCode,
6687 Header: res.Header,
6688 })
6689 }
6690 if err != nil {
6691 return nil, err
6692 }
6693 defer googleapi.CloseBody(res)
6694 if err := googleapi.CheckResponse(res); err != nil {
6695 return nil, gensupport.WrapError(err)
6696 }
6697 ret := &CryptoKey{
6698 ServerResponse: googleapi.ServerResponse{
6699 Header: res.Header,
6700 HTTPStatusCode: res.StatusCode,
6701 },
6702 }
6703 target := &ret
6704 if err := gensupport.DecodeResponse(target, res); err != nil {
6705 return nil, err
6706 }
6707 return ret, nil
6708 }
6709
6710 type ProjectsLocationsKeyRingsCryptoKeysDecryptCall struct {
6711 s *Service
6712 name string
6713 decryptrequest *DecryptRequest
6714 urlParams_ gensupport.URLParams
6715 ctx_ context.Context
6716 header_ http.Header
6717 }
6718
6719
6720
6721
6722
6723
6724 func (r *ProjectsLocationsKeyRingsCryptoKeysService) Decrypt(name string, decryptrequest *DecryptRequest) *ProjectsLocationsKeyRingsCryptoKeysDecryptCall {
6725 c := &ProjectsLocationsKeyRingsCryptoKeysDecryptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6726 c.name = name
6727 c.decryptrequest = decryptrequest
6728 return c
6729 }
6730
6731
6732
6733
6734 func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysDecryptCall {
6735 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6736 return c
6737 }
6738
6739
6740 func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysDecryptCall {
6741 c.ctx_ = ctx
6742 return c
6743 }
6744
6745
6746
6747 func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) Header() http.Header {
6748 if c.header_ == nil {
6749 c.header_ = make(http.Header)
6750 }
6751 return c.header_
6752 }
6753
6754 func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) doRequest(alt string) (*http.Response, error) {
6755 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6756 var body io.Reader = nil
6757 body, err := googleapi.WithoutDataWrapper.JSONReader(c.decryptrequest)
6758 if err != nil {
6759 return nil, err
6760 }
6761 c.urlParams_.Set("alt", alt)
6762 c.urlParams_.Set("prettyPrint", "false")
6763 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:decrypt")
6764 urls += "?" + c.urlParams_.Encode()
6765 req, err := http.NewRequest("POST", urls, body)
6766 if err != nil {
6767 return nil, err
6768 }
6769 req.Header = reqHeaders
6770 googleapi.Expand(req.URL, map[string]string{
6771 "name": c.name,
6772 })
6773 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6774 }
6775
6776
6777
6778
6779
6780
6781
6782 func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) Do(opts ...googleapi.CallOption) (*DecryptResponse, error) {
6783 gensupport.SetOptions(c.urlParams_, opts...)
6784 res, err := c.doRequest("json")
6785 if res != nil && res.StatusCode == http.StatusNotModified {
6786 if res.Body != nil {
6787 res.Body.Close()
6788 }
6789 return nil, gensupport.WrapError(&googleapi.Error{
6790 Code: res.StatusCode,
6791 Header: res.Header,
6792 })
6793 }
6794 if err != nil {
6795 return nil, err
6796 }
6797 defer googleapi.CloseBody(res)
6798 if err := googleapi.CheckResponse(res); err != nil {
6799 return nil, gensupport.WrapError(err)
6800 }
6801 ret := &DecryptResponse{
6802 ServerResponse: googleapi.ServerResponse{
6803 Header: res.Header,
6804 HTTPStatusCode: res.StatusCode,
6805 },
6806 }
6807 target := &ret
6808 if err := gensupport.DecodeResponse(target, res); err != nil {
6809 return nil, err
6810 }
6811 return ret, nil
6812 }
6813
6814 type ProjectsLocationsKeyRingsCryptoKeysEncryptCall struct {
6815 s *Service
6816 name string
6817 encryptrequest *EncryptRequest
6818 urlParams_ gensupport.URLParams
6819 ctx_ context.Context
6820 header_ http.Header
6821 }
6822
6823
6824
6825
6826
6827
6828
6829 func (r *ProjectsLocationsKeyRingsCryptoKeysService) Encrypt(name string, encryptrequest *EncryptRequest) *ProjectsLocationsKeyRingsCryptoKeysEncryptCall {
6830 c := &ProjectsLocationsKeyRingsCryptoKeysEncryptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6831 c.name = name
6832 c.encryptrequest = encryptrequest
6833 return c
6834 }
6835
6836
6837
6838
6839 func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysEncryptCall {
6840 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6841 return c
6842 }
6843
6844
6845 func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysEncryptCall {
6846 c.ctx_ = ctx
6847 return c
6848 }
6849
6850
6851
6852 func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) Header() http.Header {
6853 if c.header_ == nil {
6854 c.header_ = make(http.Header)
6855 }
6856 return c.header_
6857 }
6858
6859 func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) doRequest(alt string) (*http.Response, error) {
6860 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6861 var body io.Reader = nil
6862 body, err := googleapi.WithoutDataWrapper.JSONReader(c.encryptrequest)
6863 if err != nil {
6864 return nil, err
6865 }
6866 c.urlParams_.Set("alt", alt)
6867 c.urlParams_.Set("prettyPrint", "false")
6868 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:encrypt")
6869 urls += "?" + c.urlParams_.Encode()
6870 req, err := http.NewRequest("POST", urls, body)
6871 if err != nil {
6872 return nil, err
6873 }
6874 req.Header = reqHeaders
6875 googleapi.Expand(req.URL, map[string]string{
6876 "name": c.name,
6877 })
6878 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6879 }
6880
6881
6882
6883
6884
6885
6886
6887 func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) Do(opts ...googleapi.CallOption) (*EncryptResponse, error) {
6888 gensupport.SetOptions(c.urlParams_, opts...)
6889 res, err := c.doRequest("json")
6890 if res != nil && res.StatusCode == http.StatusNotModified {
6891 if res.Body != nil {
6892 res.Body.Close()
6893 }
6894 return nil, gensupport.WrapError(&googleapi.Error{
6895 Code: res.StatusCode,
6896 Header: res.Header,
6897 })
6898 }
6899 if err != nil {
6900 return nil, err
6901 }
6902 defer googleapi.CloseBody(res)
6903 if err := googleapi.CheckResponse(res); err != nil {
6904 return nil, gensupport.WrapError(err)
6905 }
6906 ret := &EncryptResponse{
6907 ServerResponse: googleapi.ServerResponse{
6908 Header: res.Header,
6909 HTTPStatusCode: res.StatusCode,
6910 },
6911 }
6912 target := &ret
6913 if err := gensupport.DecodeResponse(target, res); err != nil {
6914 return nil, err
6915 }
6916 return ret, nil
6917 }
6918
6919 type ProjectsLocationsKeyRingsCryptoKeysGetCall struct {
6920 s *Service
6921 name string
6922 urlParams_ gensupport.URLParams
6923 ifNoneMatch_ string
6924 ctx_ context.Context
6925 header_ http.Header
6926 }
6927
6928
6929
6930
6931
6932 func (r *ProjectsLocationsKeyRingsCryptoKeysService) Get(name string) *ProjectsLocationsKeyRingsCryptoKeysGetCall {
6933 c := &ProjectsLocationsKeyRingsCryptoKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6934 c.name = name
6935 return c
6936 }
6937
6938
6939
6940
6941 func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysGetCall {
6942 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6943 return c
6944 }
6945
6946
6947
6948
6949 func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysGetCall {
6950 c.ifNoneMatch_ = entityTag
6951 return c
6952 }
6953
6954
6955 func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysGetCall {
6956 c.ctx_ = ctx
6957 return c
6958 }
6959
6960
6961
6962 func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) Header() http.Header {
6963 if c.header_ == nil {
6964 c.header_ = make(http.Header)
6965 }
6966 return c.header_
6967 }
6968
6969 func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) doRequest(alt string) (*http.Response, error) {
6970 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6971 if c.ifNoneMatch_ != "" {
6972 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6973 }
6974 var body io.Reader = nil
6975 c.urlParams_.Set("alt", alt)
6976 c.urlParams_.Set("prettyPrint", "false")
6977 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6978 urls += "?" + c.urlParams_.Encode()
6979 req, err := http.NewRequest("GET", urls, body)
6980 if err != nil {
6981 return nil, err
6982 }
6983 req.Header = reqHeaders
6984 googleapi.Expand(req.URL, map[string]string{
6985 "name": c.name,
6986 })
6987 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6988 }
6989
6990
6991
6992
6993
6994
6995 func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) Do(opts ...googleapi.CallOption) (*CryptoKey, error) {
6996 gensupport.SetOptions(c.urlParams_, opts...)
6997 res, err := c.doRequest("json")
6998 if res != nil && res.StatusCode == http.StatusNotModified {
6999 if res.Body != nil {
7000 res.Body.Close()
7001 }
7002 return nil, gensupport.WrapError(&googleapi.Error{
7003 Code: res.StatusCode,
7004 Header: res.Header,
7005 })
7006 }
7007 if err != nil {
7008 return nil, err
7009 }
7010 defer googleapi.CloseBody(res)
7011 if err := googleapi.CheckResponse(res); err != nil {
7012 return nil, gensupport.WrapError(err)
7013 }
7014 ret := &CryptoKey{
7015 ServerResponse: googleapi.ServerResponse{
7016 Header: res.Header,
7017 HTTPStatusCode: res.StatusCode,
7018 },
7019 }
7020 target := &ret
7021 if err := gensupport.DecodeResponse(target, res); err != nil {
7022 return nil, err
7023 }
7024 return ret, nil
7025 }
7026
7027 type ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall struct {
7028 s *Service
7029 resource string
7030 urlParams_ gensupport.URLParams
7031 ifNoneMatch_ string
7032 ctx_ context.Context
7033 header_ http.Header
7034 }
7035
7036
7037
7038
7039
7040
7041
7042 func (r *ProjectsLocationsKeyRingsCryptoKeysService) GetIamPolicy(resource string) *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall {
7043 c := &ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7044 c.resource = resource
7045 return c
7046 }
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall {
7061 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
7062 return c
7063 }
7064
7065
7066
7067
7068 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall {
7069 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7070 return c
7071 }
7072
7073
7074
7075
7076 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall {
7077 c.ifNoneMatch_ = entityTag
7078 return c
7079 }
7080
7081
7082 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall {
7083 c.ctx_ = ctx
7084 return c
7085 }
7086
7087
7088
7089 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) Header() http.Header {
7090 if c.header_ == nil {
7091 c.header_ = make(http.Header)
7092 }
7093 return c.header_
7094 }
7095
7096 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7097 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7098 if c.ifNoneMatch_ != "" {
7099 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7100 }
7101 var body io.Reader = nil
7102 c.urlParams_.Set("alt", alt)
7103 c.urlParams_.Set("prettyPrint", "false")
7104 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
7105 urls += "?" + c.urlParams_.Encode()
7106 req, err := http.NewRequest("GET", urls, body)
7107 if err != nil {
7108 return nil, err
7109 }
7110 req.Header = reqHeaders
7111 googleapi.Expand(req.URL, map[string]string{
7112 "resource": c.resource,
7113 })
7114 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7115 }
7116
7117
7118
7119
7120
7121
7122 func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7123 gensupport.SetOptions(c.urlParams_, opts...)
7124 res, err := c.doRequest("json")
7125 if res != nil && res.StatusCode == http.StatusNotModified {
7126 if res.Body != nil {
7127 res.Body.Close()
7128 }
7129 return nil, gensupport.WrapError(&googleapi.Error{
7130 Code: res.StatusCode,
7131 Header: res.Header,
7132 })
7133 }
7134 if err != nil {
7135 return nil, err
7136 }
7137 defer googleapi.CloseBody(res)
7138 if err := googleapi.CheckResponse(res); err != nil {
7139 return nil, gensupport.WrapError(err)
7140 }
7141 ret := &Policy{
7142 ServerResponse: googleapi.ServerResponse{
7143 Header: res.Header,
7144 HTTPStatusCode: res.StatusCode,
7145 },
7146 }
7147 target := &ret
7148 if err := gensupport.DecodeResponse(target, res); err != nil {
7149 return nil, err
7150 }
7151 return ret, nil
7152 }
7153
7154 type ProjectsLocationsKeyRingsCryptoKeysListCall struct {
7155 s *Service
7156 parent string
7157 urlParams_ gensupport.URLParams
7158 ifNoneMatch_ string
7159 ctx_ context.Context
7160 header_ http.Header
7161 }
7162
7163
7164
7165
7166
7167 func (r *ProjectsLocationsKeyRingsCryptoKeysService) List(parent string) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7168 c := &ProjectsLocationsKeyRingsCryptoKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7169 c.parent = parent
7170 return c
7171 }
7172
7173
7174
7175
7176
7177 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Filter(filter string) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7178 c.urlParams_.Set("filter", filter)
7179 return c
7180 }
7181
7182
7183
7184
7185
7186 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) OrderBy(orderBy string) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7187 c.urlParams_.Set("orderBy", orderBy)
7188 return c
7189 }
7190
7191
7192
7193
7194
7195
7196 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) PageSize(pageSize int64) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7197 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7198 return c
7199 }
7200
7201
7202
7203 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) PageToken(pageToken string) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7204 c.urlParams_.Set("pageToken", pageToken)
7205 return c
7206 }
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) VersionView(versionView string) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7221 c.urlParams_.Set("versionView", versionView)
7222 return c
7223 }
7224
7225
7226
7227
7228 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7229 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7230 return c
7231 }
7232
7233
7234
7235
7236 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7237 c.ifNoneMatch_ = entityTag
7238 return c
7239 }
7240
7241
7242 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysListCall {
7243 c.ctx_ = ctx
7244 return c
7245 }
7246
7247
7248
7249 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Header() http.Header {
7250 if c.header_ == nil {
7251 c.header_ = make(http.Header)
7252 }
7253 return c.header_
7254 }
7255
7256 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) doRequest(alt string) (*http.Response, error) {
7257 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7258 if c.ifNoneMatch_ != "" {
7259 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7260 }
7261 var body io.Reader = nil
7262 c.urlParams_.Set("alt", alt)
7263 c.urlParams_.Set("prettyPrint", "false")
7264 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeys")
7265 urls += "?" + c.urlParams_.Encode()
7266 req, err := http.NewRequest("GET", urls, body)
7267 if err != nil {
7268 return nil, err
7269 }
7270 req.Header = reqHeaders
7271 googleapi.Expand(req.URL, map[string]string{
7272 "parent": c.parent,
7273 })
7274 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7275 }
7276
7277
7278
7279
7280
7281
7282
7283 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Do(opts ...googleapi.CallOption) (*ListCryptoKeysResponse, error) {
7284 gensupport.SetOptions(c.urlParams_, opts...)
7285 res, err := c.doRequest("json")
7286 if res != nil && res.StatusCode == http.StatusNotModified {
7287 if res.Body != nil {
7288 res.Body.Close()
7289 }
7290 return nil, gensupport.WrapError(&googleapi.Error{
7291 Code: res.StatusCode,
7292 Header: res.Header,
7293 })
7294 }
7295 if err != nil {
7296 return nil, err
7297 }
7298 defer googleapi.CloseBody(res)
7299 if err := googleapi.CheckResponse(res); err != nil {
7300 return nil, gensupport.WrapError(err)
7301 }
7302 ret := &ListCryptoKeysResponse{
7303 ServerResponse: googleapi.ServerResponse{
7304 Header: res.Header,
7305 HTTPStatusCode: res.StatusCode,
7306 },
7307 }
7308 target := &ret
7309 if err := gensupport.DecodeResponse(target, res); err != nil {
7310 return nil, err
7311 }
7312 return ret, nil
7313 }
7314
7315
7316
7317
7318 func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Pages(ctx context.Context, f func(*ListCryptoKeysResponse) error) error {
7319 c.ctx_ = ctx
7320 defer c.PageToken(c.urlParams_.Get("pageToken"))
7321 for {
7322 x, err := c.Do()
7323 if err != nil {
7324 return err
7325 }
7326 if err := f(x); err != nil {
7327 return err
7328 }
7329 if x.NextPageToken == "" {
7330 return nil
7331 }
7332 c.PageToken(x.NextPageToken)
7333 }
7334 }
7335
7336 type ProjectsLocationsKeyRingsCryptoKeysPatchCall struct {
7337 s *Service
7338 name string
7339 cryptokey *CryptoKey
7340 urlParams_ gensupport.URLParams
7341 ctx_ context.Context
7342 header_ http.Header
7343 }
7344
7345
7346
7347
7348
7349 func (r *ProjectsLocationsKeyRingsCryptoKeysService) Patch(name string, cryptokey *CryptoKey) *ProjectsLocationsKeyRingsCryptoKeysPatchCall {
7350 c := &ProjectsLocationsKeyRingsCryptoKeysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7351 c.name = name
7352 c.cryptokey = cryptokey
7353 return c
7354 }
7355
7356
7357
7358 func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) UpdateMask(updateMask string) *ProjectsLocationsKeyRingsCryptoKeysPatchCall {
7359 c.urlParams_.Set("updateMask", updateMask)
7360 return c
7361 }
7362
7363
7364
7365
7366 func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysPatchCall {
7367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7368 return c
7369 }
7370
7371
7372 func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysPatchCall {
7373 c.ctx_ = ctx
7374 return c
7375 }
7376
7377
7378
7379 func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) Header() http.Header {
7380 if c.header_ == nil {
7381 c.header_ = make(http.Header)
7382 }
7383 return c.header_
7384 }
7385
7386 func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) doRequest(alt string) (*http.Response, error) {
7387 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7388 var body io.Reader = nil
7389 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokey)
7390 if err != nil {
7391 return nil, err
7392 }
7393 c.urlParams_.Set("alt", alt)
7394 c.urlParams_.Set("prettyPrint", "false")
7395 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7396 urls += "?" + c.urlParams_.Encode()
7397 req, err := http.NewRequest("PATCH", urls, body)
7398 if err != nil {
7399 return nil, err
7400 }
7401 req.Header = reqHeaders
7402 googleapi.Expand(req.URL, map[string]string{
7403 "name": c.name,
7404 })
7405 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7406 }
7407
7408
7409
7410
7411
7412
7413 func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) Do(opts ...googleapi.CallOption) (*CryptoKey, error) {
7414 gensupport.SetOptions(c.urlParams_, opts...)
7415 res, err := c.doRequest("json")
7416 if res != nil && res.StatusCode == http.StatusNotModified {
7417 if res.Body != nil {
7418 res.Body.Close()
7419 }
7420 return nil, gensupport.WrapError(&googleapi.Error{
7421 Code: res.StatusCode,
7422 Header: res.Header,
7423 })
7424 }
7425 if err != nil {
7426 return nil, err
7427 }
7428 defer googleapi.CloseBody(res)
7429 if err := googleapi.CheckResponse(res); err != nil {
7430 return nil, gensupport.WrapError(err)
7431 }
7432 ret := &CryptoKey{
7433 ServerResponse: googleapi.ServerResponse{
7434 Header: res.Header,
7435 HTTPStatusCode: res.StatusCode,
7436 },
7437 }
7438 target := &ret
7439 if err := gensupport.DecodeResponse(target, res); err != nil {
7440 return nil, err
7441 }
7442 return ret, nil
7443 }
7444
7445 type ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall struct {
7446 s *Service
7447 resource string
7448 setiampolicyrequest *SetIamPolicyRequest
7449 urlParams_ gensupport.URLParams
7450 ctx_ context.Context
7451 header_ http.Header
7452 }
7453
7454
7455
7456
7457
7458
7459
7460
7461 func (r *ProjectsLocationsKeyRingsCryptoKeysService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall {
7462 c := &ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7463 c.resource = resource
7464 c.setiampolicyrequest = setiampolicyrequest
7465 return c
7466 }
7467
7468
7469
7470
7471 func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall {
7472 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7473 return c
7474 }
7475
7476
7477 func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall {
7478 c.ctx_ = ctx
7479 return c
7480 }
7481
7482
7483
7484 func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) Header() http.Header {
7485 if c.header_ == nil {
7486 c.header_ = make(http.Header)
7487 }
7488 return c.header_
7489 }
7490
7491 func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7492 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7493 var body io.Reader = nil
7494 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
7495 if err != nil {
7496 return nil, err
7497 }
7498 c.urlParams_.Set("alt", alt)
7499 c.urlParams_.Set("prettyPrint", "false")
7500 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
7501 urls += "?" + c.urlParams_.Encode()
7502 req, err := http.NewRequest("POST", urls, body)
7503 if err != nil {
7504 return nil, err
7505 }
7506 req.Header = reqHeaders
7507 googleapi.Expand(req.URL, map[string]string{
7508 "resource": c.resource,
7509 })
7510 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7511 }
7512
7513
7514
7515
7516
7517
7518 func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7519 gensupport.SetOptions(c.urlParams_, opts...)
7520 res, err := c.doRequest("json")
7521 if res != nil && res.StatusCode == http.StatusNotModified {
7522 if res.Body != nil {
7523 res.Body.Close()
7524 }
7525 return nil, gensupport.WrapError(&googleapi.Error{
7526 Code: res.StatusCode,
7527 Header: res.Header,
7528 })
7529 }
7530 if err != nil {
7531 return nil, err
7532 }
7533 defer googleapi.CloseBody(res)
7534 if err := googleapi.CheckResponse(res); err != nil {
7535 return nil, gensupport.WrapError(err)
7536 }
7537 ret := &Policy{
7538 ServerResponse: googleapi.ServerResponse{
7539 Header: res.Header,
7540 HTTPStatusCode: res.StatusCode,
7541 },
7542 }
7543 target := &ret
7544 if err := gensupport.DecodeResponse(target, res); err != nil {
7545 return nil, err
7546 }
7547 return ret, nil
7548 }
7549
7550 type ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall struct {
7551 s *Service
7552 resource string
7553 testiampermissionsrequest *TestIamPermissionsRequest
7554 urlParams_ gensupport.URLParams
7555 ctx_ context.Context
7556 header_ http.Header
7557 }
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569 func (r *ProjectsLocationsKeyRingsCryptoKeysService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall {
7570 c := &ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7571 c.resource = resource
7572 c.testiampermissionsrequest = testiampermissionsrequest
7573 return c
7574 }
7575
7576
7577
7578
7579 func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall {
7580 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7581 return c
7582 }
7583
7584
7585 func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall {
7586 c.ctx_ = ctx
7587 return c
7588 }
7589
7590
7591
7592 func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) Header() http.Header {
7593 if c.header_ == nil {
7594 c.header_ = make(http.Header)
7595 }
7596 return c.header_
7597 }
7598
7599 func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
7600 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7601 var body io.Reader = nil
7602 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
7603 if err != nil {
7604 return nil, err
7605 }
7606 c.urlParams_.Set("alt", alt)
7607 c.urlParams_.Set("prettyPrint", "false")
7608 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
7609 urls += "?" + c.urlParams_.Encode()
7610 req, err := http.NewRequest("POST", urls, body)
7611 if err != nil {
7612 return nil, err
7613 }
7614 req.Header = reqHeaders
7615 googleapi.Expand(req.URL, map[string]string{
7616 "resource": c.resource,
7617 })
7618 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7619 }
7620
7621
7622
7623
7624
7625
7626
7627 func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
7628 gensupport.SetOptions(c.urlParams_, opts...)
7629 res, err := c.doRequest("json")
7630 if res != nil && res.StatusCode == http.StatusNotModified {
7631 if res.Body != nil {
7632 res.Body.Close()
7633 }
7634 return nil, gensupport.WrapError(&googleapi.Error{
7635 Code: res.StatusCode,
7636 Header: res.Header,
7637 })
7638 }
7639 if err != nil {
7640 return nil, err
7641 }
7642 defer googleapi.CloseBody(res)
7643 if err := googleapi.CheckResponse(res); err != nil {
7644 return nil, gensupport.WrapError(err)
7645 }
7646 ret := &TestIamPermissionsResponse{
7647 ServerResponse: googleapi.ServerResponse{
7648 Header: res.Header,
7649 HTTPStatusCode: res.StatusCode,
7650 },
7651 }
7652 target := &ret
7653 if err := gensupport.DecodeResponse(target, res); err != nil {
7654 return nil, err
7655 }
7656 return ret, nil
7657 }
7658
7659 type ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall struct {
7660 s *Service
7661 name string
7662 updatecryptokeyprimaryversionrequest *UpdateCryptoKeyPrimaryVersionRequest
7663 urlParams_ gensupport.URLParams
7664 ctx_ context.Context
7665 header_ http.Header
7666 }
7667
7668
7669
7670
7671
7672
7673 func (r *ProjectsLocationsKeyRingsCryptoKeysService) UpdatePrimaryVersion(name string, updatecryptokeyprimaryversionrequest *UpdateCryptoKeyPrimaryVersionRequest) *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall {
7674 c := &ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7675 c.name = name
7676 c.updatecryptokeyprimaryversionrequest = updatecryptokeyprimaryversionrequest
7677 return c
7678 }
7679
7680
7681
7682
7683 func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall {
7684 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7685 return c
7686 }
7687
7688
7689 func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall {
7690 c.ctx_ = ctx
7691 return c
7692 }
7693
7694
7695
7696 func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) Header() http.Header {
7697 if c.header_ == nil {
7698 c.header_ = make(http.Header)
7699 }
7700 return c.header_
7701 }
7702
7703 func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) doRequest(alt string) (*http.Response, error) {
7704 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7705 var body io.Reader = nil
7706 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecryptokeyprimaryversionrequest)
7707 if err != nil {
7708 return nil, err
7709 }
7710 c.urlParams_.Set("alt", alt)
7711 c.urlParams_.Set("prettyPrint", "false")
7712 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:updatePrimaryVersion")
7713 urls += "?" + c.urlParams_.Encode()
7714 req, err := http.NewRequest("POST", urls, body)
7715 if err != nil {
7716 return nil, err
7717 }
7718 req.Header = reqHeaders
7719 googleapi.Expand(req.URL, map[string]string{
7720 "name": c.name,
7721 })
7722 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7723 }
7724
7725
7726
7727
7728
7729
7730 func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) Do(opts ...googleapi.CallOption) (*CryptoKey, error) {
7731 gensupport.SetOptions(c.urlParams_, opts...)
7732 res, err := c.doRequest("json")
7733 if res != nil && res.StatusCode == http.StatusNotModified {
7734 if res.Body != nil {
7735 res.Body.Close()
7736 }
7737 return nil, gensupport.WrapError(&googleapi.Error{
7738 Code: res.StatusCode,
7739 Header: res.Header,
7740 })
7741 }
7742 if err != nil {
7743 return nil, err
7744 }
7745 defer googleapi.CloseBody(res)
7746 if err := googleapi.CheckResponse(res); err != nil {
7747 return nil, gensupport.WrapError(err)
7748 }
7749 ret := &CryptoKey{
7750 ServerResponse: googleapi.ServerResponse{
7751 Header: res.Header,
7752 HTTPStatusCode: res.StatusCode,
7753 },
7754 }
7755 target := &ret
7756 if err := gensupport.DecodeResponse(target, res); err != nil {
7757 return nil, err
7758 }
7759 return ret, nil
7760 }
7761
7762 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall struct {
7763 s *Service
7764 name string
7765 asymmetricdecryptrequest *AsymmetricDecryptRequest
7766 urlParams_ gensupport.URLParams
7767 ctx_ context.Context
7768 header_ http.Header
7769 }
7770
7771
7772
7773
7774
7775
7776 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) AsymmetricDecrypt(name string, asymmetricdecryptrequest *AsymmetricDecryptRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall {
7777 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7778 c.name = name
7779 c.asymmetricdecryptrequest = asymmetricdecryptrequest
7780 return c
7781 }
7782
7783
7784
7785
7786 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall {
7787 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7788 return c
7789 }
7790
7791
7792 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall {
7793 c.ctx_ = ctx
7794 return c
7795 }
7796
7797
7798
7799 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall) Header() http.Header {
7800 if c.header_ == nil {
7801 c.header_ = make(http.Header)
7802 }
7803 return c.header_
7804 }
7805
7806 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall) doRequest(alt string) (*http.Response, error) {
7807 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7808 var body io.Reader = nil
7809 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asymmetricdecryptrequest)
7810 if err != nil {
7811 return nil, err
7812 }
7813 c.urlParams_.Set("alt", alt)
7814 c.urlParams_.Set("prettyPrint", "false")
7815 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:asymmetricDecrypt")
7816 urls += "?" + c.urlParams_.Encode()
7817 req, err := http.NewRequest("POST", urls, body)
7818 if err != nil {
7819 return nil, err
7820 }
7821 req.Header = reqHeaders
7822 googleapi.Expand(req.URL, map[string]string{
7823 "name": c.name,
7824 })
7825 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7826 }
7827
7828
7829
7830
7831
7832
7833
7834 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCall) Do(opts ...googleapi.CallOption) (*AsymmetricDecryptResponse, error) {
7835 gensupport.SetOptions(c.urlParams_, opts...)
7836 res, err := c.doRequest("json")
7837 if res != nil && res.StatusCode == http.StatusNotModified {
7838 if res.Body != nil {
7839 res.Body.Close()
7840 }
7841 return nil, gensupport.WrapError(&googleapi.Error{
7842 Code: res.StatusCode,
7843 Header: res.Header,
7844 })
7845 }
7846 if err != nil {
7847 return nil, err
7848 }
7849 defer googleapi.CloseBody(res)
7850 if err := googleapi.CheckResponse(res); err != nil {
7851 return nil, gensupport.WrapError(err)
7852 }
7853 ret := &AsymmetricDecryptResponse{
7854 ServerResponse: googleapi.ServerResponse{
7855 Header: res.Header,
7856 HTTPStatusCode: res.StatusCode,
7857 },
7858 }
7859 target := &ret
7860 if err := gensupport.DecodeResponse(target, res); err != nil {
7861 return nil, err
7862 }
7863 return ret, nil
7864 }
7865
7866 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall struct {
7867 s *Service
7868 name string
7869 asymmetricsignrequest *AsymmetricSignRequest
7870 urlParams_ gensupport.URLParams
7871 ctx_ context.Context
7872 header_ http.Header
7873 }
7874
7875
7876
7877
7878
7879
7880 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) AsymmetricSign(name string, asymmetricsignrequest *AsymmetricSignRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall {
7881 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7882 c.name = name
7883 c.asymmetricsignrequest = asymmetricsignrequest
7884 return c
7885 }
7886
7887
7888
7889
7890 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall {
7891 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7892 return c
7893 }
7894
7895
7896 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall {
7897 c.ctx_ = ctx
7898 return c
7899 }
7900
7901
7902
7903 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) Header() http.Header {
7904 if c.header_ == nil {
7905 c.header_ = make(http.Header)
7906 }
7907 return c.header_
7908 }
7909
7910 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) doRequest(alt string) (*http.Response, error) {
7911 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7912 var body io.Reader = nil
7913 body, err := googleapi.WithoutDataWrapper.JSONReader(c.asymmetricsignrequest)
7914 if err != nil {
7915 return nil, err
7916 }
7917 c.urlParams_.Set("alt", alt)
7918 c.urlParams_.Set("prettyPrint", "false")
7919 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:asymmetricSign")
7920 urls += "?" + c.urlParams_.Encode()
7921 req, err := http.NewRequest("POST", urls, body)
7922 if err != nil {
7923 return nil, err
7924 }
7925 req.Header = reqHeaders
7926 googleapi.Expand(req.URL, map[string]string{
7927 "name": c.name,
7928 })
7929 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7930 }
7931
7932
7933
7934
7935
7936
7937
7938 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall) Do(opts ...googleapi.CallOption) (*AsymmetricSignResponse, error) {
7939 gensupport.SetOptions(c.urlParams_, opts...)
7940 res, err := c.doRequest("json")
7941 if res != nil && res.StatusCode == http.StatusNotModified {
7942 if res.Body != nil {
7943 res.Body.Close()
7944 }
7945 return nil, gensupport.WrapError(&googleapi.Error{
7946 Code: res.StatusCode,
7947 Header: res.Header,
7948 })
7949 }
7950 if err != nil {
7951 return nil, err
7952 }
7953 defer googleapi.CloseBody(res)
7954 if err := googleapi.CheckResponse(res); err != nil {
7955 return nil, gensupport.WrapError(err)
7956 }
7957 ret := &AsymmetricSignResponse{
7958 ServerResponse: googleapi.ServerResponse{
7959 Header: res.Header,
7960 HTTPStatusCode: res.StatusCode,
7961 },
7962 }
7963 target := &ret
7964 if err := gensupport.DecodeResponse(target, res); err != nil {
7965 return nil, err
7966 }
7967 return ret, nil
7968 }
7969
7970 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall struct {
7971 s *Service
7972 parent string
7973 cryptokeyversion *CryptoKeyVersion
7974 urlParams_ gensupport.URLParams
7975 ctx_ context.Context
7976 header_ http.Header
7977 }
7978
7979
7980
7981
7982
7983 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) Create(parent string, cryptokeyversion *CryptoKeyVersion) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall {
7984 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7985 c.parent = parent
7986 c.cryptokeyversion = cryptokeyversion
7987 return c
7988 }
7989
7990
7991
7992
7993 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall {
7994 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7995 return c
7996 }
7997
7998
7999 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall {
8000 c.ctx_ = ctx
8001 return c
8002 }
8003
8004
8005
8006 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) Header() http.Header {
8007 if c.header_ == nil {
8008 c.header_ = make(http.Header)
8009 }
8010 return c.header_
8011 }
8012
8013 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
8014 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8015 var body io.Reader = nil
8016 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokeyversion)
8017 if err != nil {
8018 return nil, err
8019 }
8020 c.urlParams_.Set("alt", alt)
8021 c.urlParams_.Set("prettyPrint", "false")
8022 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeyVersions")
8023 urls += "?" + c.urlParams_.Encode()
8024 req, err := http.NewRequest("POST", urls, body)
8025 if err != nil {
8026 return nil, err
8027 }
8028 req.Header = reqHeaders
8029 googleapi.Expand(req.URL, map[string]string{
8030 "parent": c.parent,
8031 })
8032 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8033 }
8034
8035
8036
8037
8038
8039
8040
8041 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) Do(opts ...googleapi.CallOption) (*CryptoKeyVersion, error) {
8042 gensupport.SetOptions(c.urlParams_, opts...)
8043 res, err := c.doRequest("json")
8044 if res != nil && res.StatusCode == http.StatusNotModified {
8045 if res.Body != nil {
8046 res.Body.Close()
8047 }
8048 return nil, gensupport.WrapError(&googleapi.Error{
8049 Code: res.StatusCode,
8050 Header: res.Header,
8051 })
8052 }
8053 if err != nil {
8054 return nil, err
8055 }
8056 defer googleapi.CloseBody(res)
8057 if err := googleapi.CheckResponse(res); err != nil {
8058 return nil, gensupport.WrapError(err)
8059 }
8060 ret := &CryptoKeyVersion{
8061 ServerResponse: googleapi.ServerResponse{
8062 Header: res.Header,
8063 HTTPStatusCode: res.StatusCode,
8064 },
8065 }
8066 target := &ret
8067 if err := gensupport.DecodeResponse(target, res); err != nil {
8068 return nil, err
8069 }
8070 return ret, nil
8071 }
8072
8073 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall struct {
8074 s *Service
8075 name string
8076 destroycryptokeyversionrequest *DestroyCryptoKeyVersionRequest
8077 urlParams_ gensupport.URLParams
8078 ctx_ context.Context
8079 header_ http.Header
8080 }
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) Destroy(name string, destroycryptokeyversionrequest *DestroyCryptoKeyVersionRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall {
8091 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8092 c.name = name
8093 c.destroycryptokeyversionrequest = destroycryptokeyversionrequest
8094 return c
8095 }
8096
8097
8098
8099
8100 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall {
8101 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8102 return c
8103 }
8104
8105
8106 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall {
8107 c.ctx_ = ctx
8108 return c
8109 }
8110
8111
8112
8113 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) Header() http.Header {
8114 if c.header_ == nil {
8115 c.header_ = make(http.Header)
8116 }
8117 return c.header_
8118 }
8119
8120 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) doRequest(alt string) (*http.Response, error) {
8121 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8122 var body io.Reader = nil
8123 body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroycryptokeyversionrequest)
8124 if err != nil {
8125 return nil, err
8126 }
8127 c.urlParams_.Set("alt", alt)
8128 c.urlParams_.Set("prettyPrint", "false")
8129 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:destroy")
8130 urls += "?" + c.urlParams_.Encode()
8131 req, err := http.NewRequest("POST", urls, body)
8132 if err != nil {
8133 return nil, err
8134 }
8135 req.Header = reqHeaders
8136 googleapi.Expand(req.URL, map[string]string{
8137 "name": c.name,
8138 })
8139 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8140 }
8141
8142
8143
8144
8145
8146
8147
8148 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) Do(opts ...googleapi.CallOption) (*CryptoKeyVersion, error) {
8149 gensupport.SetOptions(c.urlParams_, opts...)
8150 res, err := c.doRequest("json")
8151 if res != nil && res.StatusCode == http.StatusNotModified {
8152 if res.Body != nil {
8153 res.Body.Close()
8154 }
8155 return nil, gensupport.WrapError(&googleapi.Error{
8156 Code: res.StatusCode,
8157 Header: res.Header,
8158 })
8159 }
8160 if err != nil {
8161 return nil, err
8162 }
8163 defer googleapi.CloseBody(res)
8164 if err := googleapi.CheckResponse(res); err != nil {
8165 return nil, gensupport.WrapError(err)
8166 }
8167 ret := &CryptoKeyVersion{
8168 ServerResponse: googleapi.ServerResponse{
8169 Header: res.Header,
8170 HTTPStatusCode: res.StatusCode,
8171 },
8172 }
8173 target := &ret
8174 if err := gensupport.DecodeResponse(target, res); err != nil {
8175 return nil, err
8176 }
8177 return ret, nil
8178 }
8179
8180 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall struct {
8181 s *Service
8182 name string
8183 urlParams_ gensupport.URLParams
8184 ifNoneMatch_ string
8185 ctx_ context.Context
8186 header_ http.Header
8187 }
8188
8189
8190
8191
8192 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) Get(name string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall {
8193 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8194 c.name = name
8195 return c
8196 }
8197
8198
8199
8200
8201 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall {
8202 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8203 return c
8204 }
8205
8206
8207
8208
8209 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall {
8210 c.ifNoneMatch_ = entityTag
8211 return c
8212 }
8213
8214
8215 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall {
8216 c.ctx_ = ctx
8217 return c
8218 }
8219
8220
8221
8222 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) Header() http.Header {
8223 if c.header_ == nil {
8224 c.header_ = make(http.Header)
8225 }
8226 return c.header_
8227 }
8228
8229 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) doRequest(alt string) (*http.Response, error) {
8230 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8231 if c.ifNoneMatch_ != "" {
8232 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8233 }
8234 var body io.Reader = nil
8235 c.urlParams_.Set("alt", alt)
8236 c.urlParams_.Set("prettyPrint", "false")
8237 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8238 urls += "?" + c.urlParams_.Encode()
8239 req, err := http.NewRequest("GET", urls, body)
8240 if err != nil {
8241 return nil, err
8242 }
8243 req.Header = reqHeaders
8244 googleapi.Expand(req.URL, map[string]string{
8245 "name": c.name,
8246 })
8247 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8248 }
8249
8250
8251
8252
8253
8254
8255
8256 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) Do(opts ...googleapi.CallOption) (*CryptoKeyVersion, error) {
8257 gensupport.SetOptions(c.urlParams_, opts...)
8258 res, err := c.doRequest("json")
8259 if res != nil && res.StatusCode == http.StatusNotModified {
8260 if res.Body != nil {
8261 res.Body.Close()
8262 }
8263 return nil, gensupport.WrapError(&googleapi.Error{
8264 Code: res.StatusCode,
8265 Header: res.Header,
8266 })
8267 }
8268 if err != nil {
8269 return nil, err
8270 }
8271 defer googleapi.CloseBody(res)
8272 if err := googleapi.CheckResponse(res); err != nil {
8273 return nil, gensupport.WrapError(err)
8274 }
8275 ret := &CryptoKeyVersion{
8276 ServerResponse: googleapi.ServerResponse{
8277 Header: res.Header,
8278 HTTPStatusCode: res.StatusCode,
8279 },
8280 }
8281 target := &ret
8282 if err := gensupport.DecodeResponse(target, res); err != nil {
8283 return nil, err
8284 }
8285 return ret, nil
8286 }
8287
8288 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall struct {
8289 s *Service
8290 name string
8291 urlParams_ gensupport.URLParams
8292 ifNoneMatch_ string
8293 ctx_ context.Context
8294 header_ http.Header
8295 }
8296
8297
8298
8299
8300
8301 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) GetPublicKey(name string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall {
8302 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8303 c.name = name
8304 return c
8305 }
8306
8307
8308
8309
8310 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall {
8311 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8312 return c
8313 }
8314
8315
8316
8317
8318 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall {
8319 c.ifNoneMatch_ = entityTag
8320 return c
8321 }
8322
8323
8324 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall {
8325 c.ctx_ = ctx
8326 return c
8327 }
8328
8329
8330
8331 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) Header() http.Header {
8332 if c.header_ == nil {
8333 c.header_ = make(http.Header)
8334 }
8335 return c.header_
8336 }
8337
8338 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) doRequest(alt string) (*http.Response, error) {
8339 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8340 if c.ifNoneMatch_ != "" {
8341 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8342 }
8343 var body io.Reader = nil
8344 c.urlParams_.Set("alt", alt)
8345 c.urlParams_.Set("prettyPrint", "false")
8346 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/publicKey")
8347 urls += "?" + c.urlParams_.Encode()
8348 req, err := http.NewRequest("GET", urls, body)
8349 if err != nil {
8350 return nil, err
8351 }
8352 req.Header = reqHeaders
8353 googleapi.Expand(req.URL, map[string]string{
8354 "name": c.name,
8355 })
8356 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8357 }
8358
8359
8360
8361
8362
8363
8364 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) Do(opts ...googleapi.CallOption) (*PublicKey, error) {
8365 gensupport.SetOptions(c.urlParams_, opts...)
8366 res, err := c.doRequest("json")
8367 if res != nil && res.StatusCode == http.StatusNotModified {
8368 if res.Body != nil {
8369 res.Body.Close()
8370 }
8371 return nil, gensupport.WrapError(&googleapi.Error{
8372 Code: res.StatusCode,
8373 Header: res.Header,
8374 })
8375 }
8376 if err != nil {
8377 return nil, err
8378 }
8379 defer googleapi.CloseBody(res)
8380 if err := googleapi.CheckResponse(res); err != nil {
8381 return nil, gensupport.WrapError(err)
8382 }
8383 ret := &PublicKey{
8384 ServerResponse: googleapi.ServerResponse{
8385 Header: res.Header,
8386 HTTPStatusCode: res.StatusCode,
8387 },
8388 }
8389 target := &ret
8390 if err := gensupport.DecodeResponse(target, res); err != nil {
8391 return nil, err
8392 }
8393 return ret, nil
8394 }
8395
8396 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall struct {
8397 s *Service
8398 parent string
8399 importcryptokeyversionrequest *ImportCryptoKeyVersionRequest
8400 urlParams_ gensupport.URLParams
8401 ctx_ context.Context
8402 header_ http.Header
8403 }
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) Import(parent string, importcryptokeyversionrequest *ImportCryptoKeyVersionRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall {
8415 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8416 c.parent = parent
8417 c.importcryptokeyversionrequest = importcryptokeyversionrequest
8418 return c
8419 }
8420
8421
8422
8423
8424 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall {
8425 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8426 return c
8427 }
8428
8429
8430 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall {
8431 c.ctx_ = ctx
8432 return c
8433 }
8434
8435
8436
8437 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) Header() http.Header {
8438 if c.header_ == nil {
8439 c.header_ = make(http.Header)
8440 }
8441 return c.header_
8442 }
8443
8444 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) doRequest(alt string) (*http.Response, error) {
8445 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8446 var body io.Reader = nil
8447 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importcryptokeyversionrequest)
8448 if err != nil {
8449 return nil, err
8450 }
8451 c.urlParams_.Set("alt", alt)
8452 c.urlParams_.Set("prettyPrint", "false")
8453 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeyVersions:import")
8454 urls += "?" + c.urlParams_.Encode()
8455 req, err := http.NewRequest("POST", urls, body)
8456 if err != nil {
8457 return nil, err
8458 }
8459 req.Header = reqHeaders
8460 googleapi.Expand(req.URL, map[string]string{
8461 "parent": c.parent,
8462 })
8463 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8464 }
8465
8466
8467
8468
8469
8470
8471
8472 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsImportCall) Do(opts ...googleapi.CallOption) (*CryptoKeyVersion, error) {
8473 gensupport.SetOptions(c.urlParams_, opts...)
8474 res, err := c.doRequest("json")
8475 if res != nil && res.StatusCode == http.StatusNotModified {
8476 if res.Body != nil {
8477 res.Body.Close()
8478 }
8479 return nil, gensupport.WrapError(&googleapi.Error{
8480 Code: res.StatusCode,
8481 Header: res.Header,
8482 })
8483 }
8484 if err != nil {
8485 return nil, err
8486 }
8487 defer googleapi.CloseBody(res)
8488 if err := googleapi.CheckResponse(res); err != nil {
8489 return nil, gensupport.WrapError(err)
8490 }
8491 ret := &CryptoKeyVersion{
8492 ServerResponse: googleapi.ServerResponse{
8493 Header: res.Header,
8494 HTTPStatusCode: res.StatusCode,
8495 },
8496 }
8497 target := &ret
8498 if err := gensupport.DecodeResponse(target, res); err != nil {
8499 return nil, err
8500 }
8501 return ret, nil
8502 }
8503
8504 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall struct {
8505 s *Service
8506 parent string
8507 urlParams_ gensupport.URLParams
8508 ifNoneMatch_ string
8509 ctx_ context.Context
8510 header_ http.Header
8511 }
8512
8513
8514
8515
8516
8517 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) List(parent string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8518 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8519 c.parent = parent
8520 return c
8521 }
8522
8523
8524
8525
8526
8527 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Filter(filter string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8528 c.urlParams_.Set("filter", filter)
8529 return c
8530 }
8531
8532
8533
8534
8535
8536 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) OrderBy(orderBy string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8537 c.urlParams_.Set("orderBy", orderBy)
8538 return c
8539 }
8540
8541
8542
8543
8544
8545
8546 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8547 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8548 return c
8549 }
8550
8551
8552
8553 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) PageToken(pageToken string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8554 c.urlParams_.Set("pageToken", pageToken)
8555 return c
8556 }
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) View(view string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8571 c.urlParams_.Set("view", view)
8572 return c
8573 }
8574
8575
8576
8577
8578 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8579 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8580 return c
8581 }
8582
8583
8584
8585
8586 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8587 c.ifNoneMatch_ = entityTag
8588 return c
8589 }
8590
8591
8592 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall {
8593 c.ctx_ = ctx
8594 return c
8595 }
8596
8597
8598
8599 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Header() http.Header {
8600 if c.header_ == nil {
8601 c.header_ = make(http.Header)
8602 }
8603 return c.header_
8604 }
8605
8606 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) doRequest(alt string) (*http.Response, error) {
8607 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8608 if c.ifNoneMatch_ != "" {
8609 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8610 }
8611 var body io.Reader = nil
8612 c.urlParams_.Set("alt", alt)
8613 c.urlParams_.Set("prettyPrint", "false")
8614 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/cryptoKeyVersions")
8615 urls += "?" + c.urlParams_.Encode()
8616 req, err := http.NewRequest("GET", urls, body)
8617 if err != nil {
8618 return nil, err
8619 }
8620 req.Header = reqHeaders
8621 googleapi.Expand(req.URL, map[string]string{
8622 "parent": c.parent,
8623 })
8624 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8625 }
8626
8627
8628
8629
8630
8631
8632
8633 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Do(opts ...googleapi.CallOption) (*ListCryptoKeyVersionsResponse, error) {
8634 gensupport.SetOptions(c.urlParams_, opts...)
8635 res, err := c.doRequest("json")
8636 if res != nil && res.StatusCode == http.StatusNotModified {
8637 if res.Body != nil {
8638 res.Body.Close()
8639 }
8640 return nil, gensupport.WrapError(&googleapi.Error{
8641 Code: res.StatusCode,
8642 Header: res.Header,
8643 })
8644 }
8645 if err != nil {
8646 return nil, err
8647 }
8648 defer googleapi.CloseBody(res)
8649 if err := googleapi.CheckResponse(res); err != nil {
8650 return nil, gensupport.WrapError(err)
8651 }
8652 ret := &ListCryptoKeyVersionsResponse{
8653 ServerResponse: googleapi.ServerResponse{
8654 Header: res.Header,
8655 HTTPStatusCode: res.StatusCode,
8656 },
8657 }
8658 target := &ret
8659 if err := gensupport.DecodeResponse(target, res); err != nil {
8660 return nil, err
8661 }
8662 return ret, nil
8663 }
8664
8665
8666
8667
8668 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Pages(ctx context.Context, f func(*ListCryptoKeyVersionsResponse) error) error {
8669 c.ctx_ = ctx
8670 defer c.PageToken(c.urlParams_.Get("pageToken"))
8671 for {
8672 x, err := c.Do()
8673 if err != nil {
8674 return err
8675 }
8676 if err := f(x); err != nil {
8677 return err
8678 }
8679 if x.NextPageToken == "" {
8680 return nil
8681 }
8682 c.PageToken(x.NextPageToken)
8683 }
8684 }
8685
8686 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall struct {
8687 s *Service
8688 name string
8689 macsignrequest *MacSignRequest
8690 urlParams_ gensupport.URLParams
8691 ctx_ context.Context
8692 header_ http.Header
8693 }
8694
8695
8696
8697
8698
8699 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) MacSign(name string, macsignrequest *MacSignRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall {
8700 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8701 c.name = name
8702 c.macsignrequest = macsignrequest
8703 return c
8704 }
8705
8706
8707
8708
8709 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall {
8710 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8711 return c
8712 }
8713
8714
8715 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall {
8716 c.ctx_ = ctx
8717 return c
8718 }
8719
8720
8721
8722 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) Header() http.Header {
8723 if c.header_ == nil {
8724 c.header_ = make(http.Header)
8725 }
8726 return c.header_
8727 }
8728
8729 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) doRequest(alt string) (*http.Response, error) {
8730 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8731 var body io.Reader = nil
8732 body, err := googleapi.WithoutDataWrapper.JSONReader(c.macsignrequest)
8733 if err != nil {
8734 return nil, err
8735 }
8736 c.urlParams_.Set("alt", alt)
8737 c.urlParams_.Set("prettyPrint", "false")
8738 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:macSign")
8739 urls += "?" + c.urlParams_.Encode()
8740 req, err := http.NewRequest("POST", urls, body)
8741 if err != nil {
8742 return nil, err
8743 }
8744 req.Header = reqHeaders
8745 googleapi.Expand(req.URL, map[string]string{
8746 "name": c.name,
8747 })
8748 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8749 }
8750
8751
8752
8753
8754
8755
8756
8757 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacSignCall) Do(opts ...googleapi.CallOption) (*MacSignResponse, error) {
8758 gensupport.SetOptions(c.urlParams_, opts...)
8759 res, err := c.doRequest("json")
8760 if res != nil && res.StatusCode == http.StatusNotModified {
8761 if res.Body != nil {
8762 res.Body.Close()
8763 }
8764 return nil, gensupport.WrapError(&googleapi.Error{
8765 Code: res.StatusCode,
8766 Header: res.Header,
8767 })
8768 }
8769 if err != nil {
8770 return nil, err
8771 }
8772 defer googleapi.CloseBody(res)
8773 if err := googleapi.CheckResponse(res); err != nil {
8774 return nil, gensupport.WrapError(err)
8775 }
8776 ret := &MacSignResponse{
8777 ServerResponse: googleapi.ServerResponse{
8778 Header: res.Header,
8779 HTTPStatusCode: res.StatusCode,
8780 },
8781 }
8782 target := &ret
8783 if err := gensupport.DecodeResponse(target, res); err != nil {
8784 return nil, err
8785 }
8786 return ret, nil
8787 }
8788
8789 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall struct {
8790 s *Service
8791 name string
8792 macverifyrequest *MacVerifyRequest
8793 urlParams_ gensupport.URLParams
8794 ctx_ context.Context
8795 header_ http.Header
8796 }
8797
8798
8799
8800
8801
8802
8803 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) MacVerify(name string, macverifyrequest *MacVerifyRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall {
8804 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8805 c.name = name
8806 c.macverifyrequest = macverifyrequest
8807 return c
8808 }
8809
8810
8811
8812
8813 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall {
8814 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8815 return c
8816 }
8817
8818
8819 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall {
8820 c.ctx_ = ctx
8821 return c
8822 }
8823
8824
8825
8826 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) Header() http.Header {
8827 if c.header_ == nil {
8828 c.header_ = make(http.Header)
8829 }
8830 return c.header_
8831 }
8832
8833 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) doRequest(alt string) (*http.Response, error) {
8834 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8835 var body io.Reader = nil
8836 body, err := googleapi.WithoutDataWrapper.JSONReader(c.macverifyrequest)
8837 if err != nil {
8838 return nil, err
8839 }
8840 c.urlParams_.Set("alt", alt)
8841 c.urlParams_.Set("prettyPrint", "false")
8842 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:macVerify")
8843 urls += "?" + c.urlParams_.Encode()
8844 req, err := http.NewRequest("POST", urls, body)
8845 if err != nil {
8846 return nil, err
8847 }
8848 req.Header = reqHeaders
8849 googleapi.Expand(req.URL, map[string]string{
8850 "name": c.name,
8851 })
8852 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8853 }
8854
8855
8856
8857
8858
8859
8860
8861 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsMacVerifyCall) Do(opts ...googleapi.CallOption) (*MacVerifyResponse, error) {
8862 gensupport.SetOptions(c.urlParams_, opts...)
8863 res, err := c.doRequest("json")
8864 if res != nil && res.StatusCode == http.StatusNotModified {
8865 if res.Body != nil {
8866 res.Body.Close()
8867 }
8868 return nil, gensupport.WrapError(&googleapi.Error{
8869 Code: res.StatusCode,
8870 Header: res.Header,
8871 })
8872 }
8873 if err != nil {
8874 return nil, err
8875 }
8876 defer googleapi.CloseBody(res)
8877 if err := googleapi.CheckResponse(res); err != nil {
8878 return nil, gensupport.WrapError(err)
8879 }
8880 ret := &MacVerifyResponse{
8881 ServerResponse: googleapi.ServerResponse{
8882 Header: res.Header,
8883 HTTPStatusCode: res.StatusCode,
8884 },
8885 }
8886 target := &ret
8887 if err := gensupport.DecodeResponse(target, res); err != nil {
8888 return nil, err
8889 }
8890 return ret, nil
8891 }
8892
8893 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall struct {
8894 s *Service
8895 name string
8896 cryptokeyversion *CryptoKeyVersion
8897 urlParams_ gensupport.URLParams
8898 ctx_ context.Context
8899 header_ http.Header
8900 }
8901
8902
8903
8904
8905
8906
8907
8908
8909 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) Patch(name string, cryptokeyversion *CryptoKeyVersion) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall {
8910 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8911 c.name = name
8912 c.cryptokeyversion = cryptokeyversion
8913 return c
8914 }
8915
8916
8917
8918 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall {
8919 c.urlParams_.Set("updateMask", updateMask)
8920 return c
8921 }
8922
8923
8924
8925
8926 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall {
8927 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8928 return c
8929 }
8930
8931
8932 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall {
8933 c.ctx_ = ctx
8934 return c
8935 }
8936
8937
8938
8939 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) Header() http.Header {
8940 if c.header_ == nil {
8941 c.header_ = make(http.Header)
8942 }
8943 return c.header_
8944 }
8945
8946 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
8947 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8948 var body io.Reader = nil
8949 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cryptokeyversion)
8950 if err != nil {
8951 return nil, err
8952 }
8953 c.urlParams_.Set("alt", alt)
8954 c.urlParams_.Set("prettyPrint", "false")
8955 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8956 urls += "?" + c.urlParams_.Encode()
8957 req, err := http.NewRequest("PATCH", urls, body)
8958 if err != nil {
8959 return nil, err
8960 }
8961 req.Header = reqHeaders
8962 googleapi.Expand(req.URL, map[string]string{
8963 "name": c.name,
8964 })
8965 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8966 }
8967
8968
8969
8970
8971
8972
8973
8974 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) Do(opts ...googleapi.CallOption) (*CryptoKeyVersion, error) {
8975 gensupport.SetOptions(c.urlParams_, opts...)
8976 res, err := c.doRequest("json")
8977 if res != nil && res.StatusCode == http.StatusNotModified {
8978 if res.Body != nil {
8979 res.Body.Close()
8980 }
8981 return nil, gensupport.WrapError(&googleapi.Error{
8982 Code: res.StatusCode,
8983 Header: res.Header,
8984 })
8985 }
8986 if err != nil {
8987 return nil, err
8988 }
8989 defer googleapi.CloseBody(res)
8990 if err := googleapi.CheckResponse(res); err != nil {
8991 return nil, gensupport.WrapError(err)
8992 }
8993 ret := &CryptoKeyVersion{
8994 ServerResponse: googleapi.ServerResponse{
8995 Header: res.Header,
8996 HTTPStatusCode: res.StatusCode,
8997 },
8998 }
8999 target := &ret
9000 if err := gensupport.DecodeResponse(target, res); err != nil {
9001 return nil, err
9002 }
9003 return ret, nil
9004 }
9005
9006 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall struct {
9007 s *Service
9008 name string
9009 rawdecryptrequest *RawDecryptRequest
9010 urlParams_ gensupport.URLParams
9011 ctx_ context.Context
9012 header_ http.Header
9013 }
9014
9015
9016
9017
9018
9019 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) RawDecrypt(name string, rawdecryptrequest *RawDecryptRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall {
9020 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9021 c.name = name
9022 c.rawdecryptrequest = rawdecryptrequest
9023 return c
9024 }
9025
9026
9027
9028
9029 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall {
9030 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9031 return c
9032 }
9033
9034
9035 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall {
9036 c.ctx_ = ctx
9037 return c
9038 }
9039
9040
9041
9042 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) Header() http.Header {
9043 if c.header_ == nil {
9044 c.header_ = make(http.Header)
9045 }
9046 return c.header_
9047 }
9048
9049 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) doRequest(alt string) (*http.Response, error) {
9050 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9051 var body io.Reader = nil
9052 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rawdecryptrequest)
9053 if err != nil {
9054 return nil, err
9055 }
9056 c.urlParams_.Set("alt", alt)
9057 c.urlParams_.Set("prettyPrint", "false")
9058 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rawDecrypt")
9059 urls += "?" + c.urlParams_.Encode()
9060 req, err := http.NewRequest("POST", urls, body)
9061 if err != nil {
9062 return nil, err
9063 }
9064 req.Header = reqHeaders
9065 googleapi.Expand(req.URL, map[string]string{
9066 "name": c.name,
9067 })
9068 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9069 }
9070
9071
9072
9073
9074
9075
9076
9077 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawDecryptCall) Do(opts ...googleapi.CallOption) (*RawDecryptResponse, error) {
9078 gensupport.SetOptions(c.urlParams_, opts...)
9079 res, err := c.doRequest("json")
9080 if res != nil && res.StatusCode == http.StatusNotModified {
9081 if res.Body != nil {
9082 res.Body.Close()
9083 }
9084 return nil, gensupport.WrapError(&googleapi.Error{
9085 Code: res.StatusCode,
9086 Header: res.Header,
9087 })
9088 }
9089 if err != nil {
9090 return nil, err
9091 }
9092 defer googleapi.CloseBody(res)
9093 if err := googleapi.CheckResponse(res); err != nil {
9094 return nil, gensupport.WrapError(err)
9095 }
9096 ret := &RawDecryptResponse{
9097 ServerResponse: googleapi.ServerResponse{
9098 Header: res.Header,
9099 HTTPStatusCode: res.StatusCode,
9100 },
9101 }
9102 target := &ret
9103 if err := gensupport.DecodeResponse(target, res); err != nil {
9104 return nil, err
9105 }
9106 return ret, nil
9107 }
9108
9109 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall struct {
9110 s *Service
9111 name string
9112 rawencryptrequest *RawEncryptRequest
9113 urlParams_ gensupport.URLParams
9114 ctx_ context.Context
9115 header_ http.Header
9116 }
9117
9118
9119
9120
9121
9122
9123 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) RawEncrypt(name string, rawencryptrequest *RawEncryptRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall {
9124 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9125 c.name = name
9126 c.rawencryptrequest = rawencryptrequest
9127 return c
9128 }
9129
9130
9131
9132
9133 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall {
9134 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9135 return c
9136 }
9137
9138
9139 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall {
9140 c.ctx_ = ctx
9141 return c
9142 }
9143
9144
9145
9146 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) Header() http.Header {
9147 if c.header_ == nil {
9148 c.header_ = make(http.Header)
9149 }
9150 return c.header_
9151 }
9152
9153 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) doRequest(alt string) (*http.Response, error) {
9154 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9155 var body io.Reader = nil
9156 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rawencryptrequest)
9157 if err != nil {
9158 return nil, err
9159 }
9160 c.urlParams_.Set("alt", alt)
9161 c.urlParams_.Set("prettyPrint", "false")
9162 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rawEncrypt")
9163 urls += "?" + c.urlParams_.Encode()
9164 req, err := http.NewRequest("POST", urls, body)
9165 if err != nil {
9166 return nil, err
9167 }
9168 req.Header = reqHeaders
9169 googleapi.Expand(req.URL, map[string]string{
9170 "name": c.name,
9171 })
9172 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9173 }
9174
9175
9176
9177
9178
9179
9180
9181 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRawEncryptCall) Do(opts ...googleapi.CallOption) (*RawEncryptResponse, error) {
9182 gensupport.SetOptions(c.urlParams_, opts...)
9183 res, err := c.doRequest("json")
9184 if res != nil && res.StatusCode == http.StatusNotModified {
9185 if res.Body != nil {
9186 res.Body.Close()
9187 }
9188 return nil, gensupport.WrapError(&googleapi.Error{
9189 Code: res.StatusCode,
9190 Header: res.Header,
9191 })
9192 }
9193 if err != nil {
9194 return nil, err
9195 }
9196 defer googleapi.CloseBody(res)
9197 if err := googleapi.CheckResponse(res); err != nil {
9198 return nil, gensupport.WrapError(err)
9199 }
9200 ret := &RawEncryptResponse{
9201 ServerResponse: googleapi.ServerResponse{
9202 Header: res.Header,
9203 HTTPStatusCode: res.StatusCode,
9204 },
9205 }
9206 target := &ret
9207 if err := gensupport.DecodeResponse(target, res); err != nil {
9208 return nil, err
9209 }
9210 return ret, nil
9211 }
9212
9213 type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall struct {
9214 s *Service
9215 name string
9216 restorecryptokeyversionrequest *RestoreCryptoKeyVersionRequest
9217 urlParams_ gensupport.URLParams
9218 ctx_ context.Context
9219 header_ http.Header
9220 }
9221
9222
9223
9224
9225
9226
9227 func (r *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService) Restore(name string, restorecryptokeyversionrequest *RestoreCryptoKeyVersionRequest) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall {
9228 c := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9229 c.name = name
9230 c.restorecryptokeyversionrequest = restorecryptokeyversionrequest
9231 return c
9232 }
9233
9234
9235
9236
9237 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall {
9238 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9239 return c
9240 }
9241
9242
9243 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall {
9244 c.ctx_ = ctx
9245 return c
9246 }
9247
9248
9249
9250 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) Header() http.Header {
9251 if c.header_ == nil {
9252 c.header_ = make(http.Header)
9253 }
9254 return c.header_
9255 }
9256
9257 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) doRequest(alt string) (*http.Response, error) {
9258 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9259 var body io.Reader = nil
9260 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restorecryptokeyversionrequest)
9261 if err != nil {
9262 return nil, err
9263 }
9264 c.urlParams_.Set("alt", alt)
9265 c.urlParams_.Set("prettyPrint", "false")
9266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restore")
9267 urls += "?" + c.urlParams_.Encode()
9268 req, err := http.NewRequest("POST", urls, body)
9269 if err != nil {
9270 return nil, err
9271 }
9272 req.Header = reqHeaders
9273 googleapi.Expand(req.URL, map[string]string{
9274 "name": c.name,
9275 })
9276 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9277 }
9278
9279
9280
9281
9282
9283
9284
9285 func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) Do(opts ...googleapi.CallOption) (*CryptoKeyVersion, error) {
9286 gensupport.SetOptions(c.urlParams_, opts...)
9287 res, err := c.doRequest("json")
9288 if res != nil && res.StatusCode == http.StatusNotModified {
9289 if res.Body != nil {
9290 res.Body.Close()
9291 }
9292 return nil, gensupport.WrapError(&googleapi.Error{
9293 Code: res.StatusCode,
9294 Header: res.Header,
9295 })
9296 }
9297 if err != nil {
9298 return nil, err
9299 }
9300 defer googleapi.CloseBody(res)
9301 if err := googleapi.CheckResponse(res); err != nil {
9302 return nil, gensupport.WrapError(err)
9303 }
9304 ret := &CryptoKeyVersion{
9305 ServerResponse: googleapi.ServerResponse{
9306 Header: res.Header,
9307 HTTPStatusCode: res.StatusCode,
9308 },
9309 }
9310 target := &ret
9311 if err := gensupport.DecodeResponse(target, res); err != nil {
9312 return nil, err
9313 }
9314 return ret, nil
9315 }
9316
9317 type ProjectsLocationsKeyRingsImportJobsCreateCall struct {
9318 s *Service
9319 parent string
9320 importjob *ImportJob
9321 urlParams_ gensupport.URLParams
9322 ctx_ context.Context
9323 header_ http.Header
9324 }
9325
9326
9327
9328
9329
9330 func (r *ProjectsLocationsKeyRingsImportJobsService) Create(parent string, importjob *ImportJob) *ProjectsLocationsKeyRingsImportJobsCreateCall {
9331 c := &ProjectsLocationsKeyRingsImportJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9332 c.parent = parent
9333 c.importjob = importjob
9334 return c
9335 }
9336
9337
9338
9339
9340 func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) ImportJobId(importJobId string) *ProjectsLocationsKeyRingsImportJobsCreateCall {
9341 c.urlParams_.Set("importJobId", importJobId)
9342 return c
9343 }
9344
9345
9346
9347
9348 func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsImportJobsCreateCall {
9349 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9350 return c
9351 }
9352
9353
9354 func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsImportJobsCreateCall {
9355 c.ctx_ = ctx
9356 return c
9357 }
9358
9359
9360
9361 func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) Header() http.Header {
9362 if c.header_ == nil {
9363 c.header_ = make(http.Header)
9364 }
9365 return c.header_
9366 }
9367
9368 func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) doRequest(alt string) (*http.Response, error) {
9369 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9370 var body io.Reader = nil
9371 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importjob)
9372 if err != nil {
9373 return nil, err
9374 }
9375 c.urlParams_.Set("alt", alt)
9376 c.urlParams_.Set("prettyPrint", "false")
9377 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/importJobs")
9378 urls += "?" + c.urlParams_.Encode()
9379 req, err := http.NewRequest("POST", urls, body)
9380 if err != nil {
9381 return nil, err
9382 }
9383 req.Header = reqHeaders
9384 googleapi.Expand(req.URL, map[string]string{
9385 "parent": c.parent,
9386 })
9387 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9388 }
9389
9390
9391
9392
9393
9394
9395 func (c *ProjectsLocationsKeyRingsImportJobsCreateCall) Do(opts ...googleapi.CallOption) (*ImportJob, error) {
9396 gensupport.SetOptions(c.urlParams_, opts...)
9397 res, err := c.doRequest("json")
9398 if res != nil && res.StatusCode == http.StatusNotModified {
9399 if res.Body != nil {
9400 res.Body.Close()
9401 }
9402 return nil, gensupport.WrapError(&googleapi.Error{
9403 Code: res.StatusCode,
9404 Header: res.Header,
9405 })
9406 }
9407 if err != nil {
9408 return nil, err
9409 }
9410 defer googleapi.CloseBody(res)
9411 if err := googleapi.CheckResponse(res); err != nil {
9412 return nil, gensupport.WrapError(err)
9413 }
9414 ret := &ImportJob{
9415 ServerResponse: googleapi.ServerResponse{
9416 Header: res.Header,
9417 HTTPStatusCode: res.StatusCode,
9418 },
9419 }
9420 target := &ret
9421 if err := gensupport.DecodeResponse(target, res); err != nil {
9422 return nil, err
9423 }
9424 return ret, nil
9425 }
9426
9427 type ProjectsLocationsKeyRingsImportJobsGetCall struct {
9428 s *Service
9429 name string
9430 urlParams_ gensupport.URLParams
9431 ifNoneMatch_ string
9432 ctx_ context.Context
9433 header_ http.Header
9434 }
9435
9436
9437
9438
9439 func (r *ProjectsLocationsKeyRingsImportJobsService) Get(name string) *ProjectsLocationsKeyRingsImportJobsGetCall {
9440 c := &ProjectsLocationsKeyRingsImportJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9441 c.name = name
9442 return c
9443 }
9444
9445
9446
9447
9448 func (c *ProjectsLocationsKeyRingsImportJobsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsImportJobsGetCall {
9449 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9450 return c
9451 }
9452
9453
9454
9455
9456 func (c *ProjectsLocationsKeyRingsImportJobsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsImportJobsGetCall {
9457 c.ifNoneMatch_ = entityTag
9458 return c
9459 }
9460
9461
9462 func (c *ProjectsLocationsKeyRingsImportJobsGetCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsImportJobsGetCall {
9463 c.ctx_ = ctx
9464 return c
9465 }
9466
9467
9468
9469 func (c *ProjectsLocationsKeyRingsImportJobsGetCall) Header() http.Header {
9470 if c.header_ == nil {
9471 c.header_ = make(http.Header)
9472 }
9473 return c.header_
9474 }
9475
9476 func (c *ProjectsLocationsKeyRingsImportJobsGetCall) doRequest(alt string) (*http.Response, error) {
9477 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9478 if c.ifNoneMatch_ != "" {
9479 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9480 }
9481 var body io.Reader = nil
9482 c.urlParams_.Set("alt", alt)
9483 c.urlParams_.Set("prettyPrint", "false")
9484 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9485 urls += "?" + c.urlParams_.Encode()
9486 req, err := http.NewRequest("GET", urls, body)
9487 if err != nil {
9488 return nil, err
9489 }
9490 req.Header = reqHeaders
9491 googleapi.Expand(req.URL, map[string]string{
9492 "name": c.name,
9493 })
9494 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9495 }
9496
9497
9498
9499
9500
9501
9502 func (c *ProjectsLocationsKeyRingsImportJobsGetCall) Do(opts ...googleapi.CallOption) (*ImportJob, error) {
9503 gensupport.SetOptions(c.urlParams_, opts...)
9504 res, err := c.doRequest("json")
9505 if res != nil && res.StatusCode == http.StatusNotModified {
9506 if res.Body != nil {
9507 res.Body.Close()
9508 }
9509 return nil, gensupport.WrapError(&googleapi.Error{
9510 Code: res.StatusCode,
9511 Header: res.Header,
9512 })
9513 }
9514 if err != nil {
9515 return nil, err
9516 }
9517 defer googleapi.CloseBody(res)
9518 if err := googleapi.CheckResponse(res); err != nil {
9519 return nil, gensupport.WrapError(err)
9520 }
9521 ret := &ImportJob{
9522 ServerResponse: googleapi.ServerResponse{
9523 Header: res.Header,
9524 HTTPStatusCode: res.StatusCode,
9525 },
9526 }
9527 target := &ret
9528 if err := gensupport.DecodeResponse(target, res); err != nil {
9529 return nil, err
9530 }
9531 return ret, nil
9532 }
9533
9534 type ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall struct {
9535 s *Service
9536 resource string
9537 urlParams_ gensupport.URLParams
9538 ifNoneMatch_ string
9539 ctx_ context.Context
9540 header_ http.Header
9541 }
9542
9543
9544
9545
9546
9547
9548
9549 func (r *ProjectsLocationsKeyRingsImportJobsService) GetIamPolicy(resource string) *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall {
9550 c := &ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9551 c.resource = resource
9552 return c
9553 }
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall {
9568 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
9569 return c
9570 }
9571
9572
9573
9574
9575 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall {
9576 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9577 return c
9578 }
9579
9580
9581
9582
9583 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall {
9584 c.ifNoneMatch_ = entityTag
9585 return c
9586 }
9587
9588
9589 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall {
9590 c.ctx_ = ctx
9591 return c
9592 }
9593
9594
9595
9596 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) Header() http.Header {
9597 if c.header_ == nil {
9598 c.header_ = make(http.Header)
9599 }
9600 return c.header_
9601 }
9602
9603 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9604 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9605 if c.ifNoneMatch_ != "" {
9606 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9607 }
9608 var body io.Reader = nil
9609 c.urlParams_.Set("alt", alt)
9610 c.urlParams_.Set("prettyPrint", "false")
9611 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
9612 urls += "?" + c.urlParams_.Encode()
9613 req, err := http.NewRequest("GET", urls, body)
9614 if err != nil {
9615 return nil, err
9616 }
9617 req.Header = reqHeaders
9618 googleapi.Expand(req.URL, map[string]string{
9619 "resource": c.resource,
9620 })
9621 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9622 }
9623
9624
9625
9626
9627
9628
9629 func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9630 gensupport.SetOptions(c.urlParams_, opts...)
9631 res, err := c.doRequest("json")
9632 if res != nil && res.StatusCode == http.StatusNotModified {
9633 if res.Body != nil {
9634 res.Body.Close()
9635 }
9636 return nil, gensupport.WrapError(&googleapi.Error{
9637 Code: res.StatusCode,
9638 Header: res.Header,
9639 })
9640 }
9641 if err != nil {
9642 return nil, err
9643 }
9644 defer googleapi.CloseBody(res)
9645 if err := googleapi.CheckResponse(res); err != nil {
9646 return nil, gensupport.WrapError(err)
9647 }
9648 ret := &Policy{
9649 ServerResponse: googleapi.ServerResponse{
9650 Header: res.Header,
9651 HTTPStatusCode: res.StatusCode,
9652 },
9653 }
9654 target := &ret
9655 if err := gensupport.DecodeResponse(target, res); err != nil {
9656 return nil, err
9657 }
9658 return ret, nil
9659 }
9660
9661 type ProjectsLocationsKeyRingsImportJobsListCall struct {
9662 s *Service
9663 parent string
9664 urlParams_ gensupport.URLParams
9665 ifNoneMatch_ string
9666 ctx_ context.Context
9667 header_ http.Header
9668 }
9669
9670
9671
9672
9673
9674 func (r *ProjectsLocationsKeyRingsImportJobsService) List(parent string) *ProjectsLocationsKeyRingsImportJobsListCall {
9675 c := &ProjectsLocationsKeyRingsImportJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9676 c.parent = parent
9677 return c
9678 }
9679
9680
9681
9682
9683
9684 func (c *ProjectsLocationsKeyRingsImportJobsListCall) Filter(filter string) *ProjectsLocationsKeyRingsImportJobsListCall {
9685 c.urlParams_.Set("filter", filter)
9686 return c
9687 }
9688
9689
9690
9691
9692
9693 func (c *ProjectsLocationsKeyRingsImportJobsListCall) OrderBy(orderBy string) *ProjectsLocationsKeyRingsImportJobsListCall {
9694 c.urlParams_.Set("orderBy", orderBy)
9695 return c
9696 }
9697
9698
9699
9700
9701
9702
9703 func (c *ProjectsLocationsKeyRingsImportJobsListCall) PageSize(pageSize int64) *ProjectsLocationsKeyRingsImportJobsListCall {
9704 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9705 return c
9706 }
9707
9708
9709
9710 func (c *ProjectsLocationsKeyRingsImportJobsListCall) PageToken(pageToken string) *ProjectsLocationsKeyRingsImportJobsListCall {
9711 c.urlParams_.Set("pageToken", pageToken)
9712 return c
9713 }
9714
9715
9716
9717
9718 func (c *ProjectsLocationsKeyRingsImportJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsImportJobsListCall {
9719 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9720 return c
9721 }
9722
9723
9724
9725
9726 func (c *ProjectsLocationsKeyRingsImportJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsKeyRingsImportJobsListCall {
9727 c.ifNoneMatch_ = entityTag
9728 return c
9729 }
9730
9731
9732 func (c *ProjectsLocationsKeyRingsImportJobsListCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsImportJobsListCall {
9733 c.ctx_ = ctx
9734 return c
9735 }
9736
9737
9738
9739 func (c *ProjectsLocationsKeyRingsImportJobsListCall) Header() http.Header {
9740 if c.header_ == nil {
9741 c.header_ = make(http.Header)
9742 }
9743 return c.header_
9744 }
9745
9746 func (c *ProjectsLocationsKeyRingsImportJobsListCall) doRequest(alt string) (*http.Response, error) {
9747 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9748 if c.ifNoneMatch_ != "" {
9749 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9750 }
9751 var body io.Reader = nil
9752 c.urlParams_.Set("alt", alt)
9753 c.urlParams_.Set("prettyPrint", "false")
9754 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/importJobs")
9755 urls += "?" + c.urlParams_.Encode()
9756 req, err := http.NewRequest("GET", urls, body)
9757 if err != nil {
9758 return nil, err
9759 }
9760 req.Header = reqHeaders
9761 googleapi.Expand(req.URL, map[string]string{
9762 "parent": c.parent,
9763 })
9764 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9765 }
9766
9767
9768
9769
9770
9771
9772
9773 func (c *ProjectsLocationsKeyRingsImportJobsListCall) Do(opts ...googleapi.CallOption) (*ListImportJobsResponse, error) {
9774 gensupport.SetOptions(c.urlParams_, opts...)
9775 res, err := c.doRequest("json")
9776 if res != nil && res.StatusCode == http.StatusNotModified {
9777 if res.Body != nil {
9778 res.Body.Close()
9779 }
9780 return nil, gensupport.WrapError(&googleapi.Error{
9781 Code: res.StatusCode,
9782 Header: res.Header,
9783 })
9784 }
9785 if err != nil {
9786 return nil, err
9787 }
9788 defer googleapi.CloseBody(res)
9789 if err := googleapi.CheckResponse(res); err != nil {
9790 return nil, gensupport.WrapError(err)
9791 }
9792 ret := &ListImportJobsResponse{
9793 ServerResponse: googleapi.ServerResponse{
9794 Header: res.Header,
9795 HTTPStatusCode: res.StatusCode,
9796 },
9797 }
9798 target := &ret
9799 if err := gensupport.DecodeResponse(target, res); err != nil {
9800 return nil, err
9801 }
9802 return ret, nil
9803 }
9804
9805
9806
9807
9808 func (c *ProjectsLocationsKeyRingsImportJobsListCall) Pages(ctx context.Context, f func(*ListImportJobsResponse) error) error {
9809 c.ctx_ = ctx
9810 defer c.PageToken(c.urlParams_.Get("pageToken"))
9811 for {
9812 x, err := c.Do()
9813 if err != nil {
9814 return err
9815 }
9816 if err := f(x); err != nil {
9817 return err
9818 }
9819 if x.NextPageToken == "" {
9820 return nil
9821 }
9822 c.PageToken(x.NextPageToken)
9823 }
9824 }
9825
9826 type ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall struct {
9827 s *Service
9828 resource string
9829 setiampolicyrequest *SetIamPolicyRequest
9830 urlParams_ gensupport.URLParams
9831 ctx_ context.Context
9832 header_ http.Header
9833 }
9834
9835
9836
9837
9838
9839
9840
9841
9842 func (r *ProjectsLocationsKeyRingsImportJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall {
9843 c := &ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9844 c.resource = resource
9845 c.setiampolicyrequest = setiampolicyrequest
9846 return c
9847 }
9848
9849
9850
9851
9852 func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall {
9853 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9854 return c
9855 }
9856
9857
9858 func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall {
9859 c.ctx_ = ctx
9860 return c
9861 }
9862
9863
9864
9865 func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) Header() http.Header {
9866 if c.header_ == nil {
9867 c.header_ = make(http.Header)
9868 }
9869 return c.header_
9870 }
9871
9872 func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9873 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9874 var body io.Reader = nil
9875 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
9876 if err != nil {
9877 return nil, err
9878 }
9879 c.urlParams_.Set("alt", alt)
9880 c.urlParams_.Set("prettyPrint", "false")
9881 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
9882 urls += "?" + c.urlParams_.Encode()
9883 req, err := http.NewRequest("POST", urls, body)
9884 if err != nil {
9885 return nil, err
9886 }
9887 req.Header = reqHeaders
9888 googleapi.Expand(req.URL, map[string]string{
9889 "resource": c.resource,
9890 })
9891 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9892 }
9893
9894
9895
9896
9897
9898
9899 func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9900 gensupport.SetOptions(c.urlParams_, opts...)
9901 res, err := c.doRequest("json")
9902 if res != nil && res.StatusCode == http.StatusNotModified {
9903 if res.Body != nil {
9904 res.Body.Close()
9905 }
9906 return nil, gensupport.WrapError(&googleapi.Error{
9907 Code: res.StatusCode,
9908 Header: res.Header,
9909 })
9910 }
9911 if err != nil {
9912 return nil, err
9913 }
9914 defer googleapi.CloseBody(res)
9915 if err := googleapi.CheckResponse(res); err != nil {
9916 return nil, gensupport.WrapError(err)
9917 }
9918 ret := &Policy{
9919 ServerResponse: googleapi.ServerResponse{
9920 Header: res.Header,
9921 HTTPStatusCode: res.StatusCode,
9922 },
9923 }
9924 target := &ret
9925 if err := gensupport.DecodeResponse(target, res); err != nil {
9926 return nil, err
9927 }
9928 return ret, nil
9929 }
9930
9931 type ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall struct {
9932 s *Service
9933 resource string
9934 testiampermissionsrequest *TestIamPermissionsRequest
9935 urlParams_ gensupport.URLParams
9936 ctx_ context.Context
9937 header_ http.Header
9938 }
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950 func (r *ProjectsLocationsKeyRingsImportJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall {
9951 c := &ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9952 c.resource = resource
9953 c.testiampermissionsrequest = testiampermissionsrequest
9954 return c
9955 }
9956
9957
9958
9959
9960 func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall {
9961 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9962 return c
9963 }
9964
9965
9966 func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall {
9967 c.ctx_ = ctx
9968 return c
9969 }
9970
9971
9972
9973 func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) Header() http.Header {
9974 if c.header_ == nil {
9975 c.header_ = make(http.Header)
9976 }
9977 return c.header_
9978 }
9979
9980 func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
9981 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9982 var body io.Reader = nil
9983 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
9984 if err != nil {
9985 return nil, err
9986 }
9987 c.urlParams_.Set("alt", alt)
9988 c.urlParams_.Set("prettyPrint", "false")
9989 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
9990 urls += "?" + c.urlParams_.Encode()
9991 req, err := http.NewRequest("POST", urls, body)
9992 if err != nil {
9993 return nil, err
9994 }
9995 req.Header = reqHeaders
9996 googleapi.Expand(req.URL, map[string]string{
9997 "resource": c.resource,
9998 })
9999 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10000 }
10001
10002
10003
10004
10005
10006
10007
10008 func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
10009 gensupport.SetOptions(c.urlParams_, opts...)
10010 res, err := c.doRequest("json")
10011 if res != nil && res.StatusCode == http.StatusNotModified {
10012 if res.Body != nil {
10013 res.Body.Close()
10014 }
10015 return nil, gensupport.WrapError(&googleapi.Error{
10016 Code: res.StatusCode,
10017 Header: res.Header,
10018 })
10019 }
10020 if err != nil {
10021 return nil, err
10022 }
10023 defer googleapi.CloseBody(res)
10024 if err := googleapi.CheckResponse(res); err != nil {
10025 return nil, gensupport.WrapError(err)
10026 }
10027 ret := &TestIamPermissionsResponse{
10028 ServerResponse: googleapi.ServerResponse{
10029 Header: res.Header,
10030 HTTPStatusCode: res.StatusCode,
10031 },
10032 }
10033 target := &ret
10034 if err := gensupport.DecodeResponse(target, res); err != nil {
10035 return nil, err
10036 }
10037 return ret, nil
10038 }
10039
10040 type ProjectsLocationsOperationsGetCall struct {
10041 s *Service
10042 name string
10043 urlParams_ gensupport.URLParams
10044 ifNoneMatch_ string
10045 ctx_ context.Context
10046 header_ http.Header
10047 }
10048
10049
10050
10051
10052
10053
10054 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
10055 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10056 c.name = name
10057 return c
10058 }
10059
10060
10061
10062
10063 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
10064 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10065 return c
10066 }
10067
10068
10069
10070
10071 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
10072 c.ifNoneMatch_ = entityTag
10073 return c
10074 }
10075
10076
10077 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
10078 c.ctx_ = ctx
10079 return c
10080 }
10081
10082
10083
10084 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
10085 if c.header_ == nil {
10086 c.header_ = make(http.Header)
10087 }
10088 return c.header_
10089 }
10090
10091 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
10092 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10093 if c.ifNoneMatch_ != "" {
10094 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10095 }
10096 var body io.Reader = nil
10097 c.urlParams_.Set("alt", alt)
10098 c.urlParams_.Set("prettyPrint", "false")
10099 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10100 urls += "?" + c.urlParams_.Encode()
10101 req, err := http.NewRequest("GET", urls, body)
10102 if err != nil {
10103 return nil, err
10104 }
10105 req.Header = reqHeaders
10106 googleapi.Expand(req.URL, map[string]string{
10107 "name": c.name,
10108 })
10109 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10110 }
10111
10112
10113
10114
10115
10116
10117 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10118 gensupport.SetOptions(c.urlParams_, opts...)
10119 res, err := c.doRequest("json")
10120 if res != nil && res.StatusCode == http.StatusNotModified {
10121 if res.Body != nil {
10122 res.Body.Close()
10123 }
10124 return nil, gensupport.WrapError(&googleapi.Error{
10125 Code: res.StatusCode,
10126 Header: res.Header,
10127 })
10128 }
10129 if err != nil {
10130 return nil, err
10131 }
10132 defer googleapi.CloseBody(res)
10133 if err := googleapi.CheckResponse(res); err != nil {
10134 return nil, gensupport.WrapError(err)
10135 }
10136 ret := &Operation{
10137 ServerResponse: googleapi.ServerResponse{
10138 Header: res.Header,
10139 HTTPStatusCode: res.StatusCode,
10140 },
10141 }
10142 target := &ret
10143 if err := gensupport.DecodeResponse(target, res); err != nil {
10144 return nil, err
10145 }
10146 return ret, nil
10147 }
10148
View as plain text