1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 package websecurityscanner
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "websecurityscanner:v1"
90 const apiName = "websecurityscanner"
91 const apiVersion = "v1"
92 const basePath = "https://websecurityscanner.googleapis.com/"
93 const basePathTemplate = "https://websecurityscanner.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://websecurityscanner.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.ScanConfigs = NewProjectsScanConfigsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 ScanConfigs *ProjectsScanConfigsService
167 }
168
169 func NewProjectsScanConfigsService(s *Service) *ProjectsScanConfigsService {
170 rs := &ProjectsScanConfigsService{s: s}
171 rs.ScanRuns = NewProjectsScanConfigsScanRunsService(s)
172 return rs
173 }
174
175 type ProjectsScanConfigsService struct {
176 s *Service
177
178 ScanRuns *ProjectsScanConfigsScanRunsService
179 }
180
181 func NewProjectsScanConfigsScanRunsService(s *Service) *ProjectsScanConfigsScanRunsService {
182 rs := &ProjectsScanConfigsScanRunsService{s: s}
183 rs.CrawledUrls = NewProjectsScanConfigsScanRunsCrawledUrlsService(s)
184 rs.FindingTypeStats = NewProjectsScanConfigsScanRunsFindingTypeStatsService(s)
185 rs.Findings = NewProjectsScanConfigsScanRunsFindingsService(s)
186 return rs
187 }
188
189 type ProjectsScanConfigsScanRunsService struct {
190 s *Service
191
192 CrawledUrls *ProjectsScanConfigsScanRunsCrawledUrlsService
193
194 FindingTypeStats *ProjectsScanConfigsScanRunsFindingTypeStatsService
195
196 Findings *ProjectsScanConfigsScanRunsFindingsService
197 }
198
199 func NewProjectsScanConfigsScanRunsCrawledUrlsService(s *Service) *ProjectsScanConfigsScanRunsCrawledUrlsService {
200 rs := &ProjectsScanConfigsScanRunsCrawledUrlsService{s: s}
201 return rs
202 }
203
204 type ProjectsScanConfigsScanRunsCrawledUrlsService struct {
205 s *Service
206 }
207
208 func NewProjectsScanConfigsScanRunsFindingTypeStatsService(s *Service) *ProjectsScanConfigsScanRunsFindingTypeStatsService {
209 rs := &ProjectsScanConfigsScanRunsFindingTypeStatsService{s: s}
210 return rs
211 }
212
213 type ProjectsScanConfigsScanRunsFindingTypeStatsService struct {
214 s *Service
215 }
216
217 func NewProjectsScanConfigsScanRunsFindingsService(s *Service) *ProjectsScanConfigsScanRunsFindingsService {
218 rs := &ProjectsScanConfigsScanRunsFindingsService{s: s}
219 return rs
220 }
221
222 type ProjectsScanConfigsScanRunsFindingsService struct {
223 s *Service
224 }
225
226
227 type Authentication struct {
228
229 CustomAccount *CustomAccount `json:"customAccount,omitempty"`
230
231 GoogleAccount *GoogleAccount `json:"googleAccount,omitempty"`
232
233 IapCredential *IapCredential `json:"iapCredential,omitempty"`
234
235
236
237
238
239 ForceSendFields []string `json:"-"`
240
241
242
243
244 NullFields []string `json:"-"`
245 }
246
247 func (s *Authentication) MarshalJSON() ([]byte, error) {
248 type NoMethod Authentication
249 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
250 }
251
252
253
254
255 type CrawledUrl struct {
256
257 Body string `json:"body,omitempty"`
258
259
260 HttpMethod string `json:"httpMethod,omitempty"`
261
262 Url string `json:"url,omitempty"`
263
264
265
266
267
268 ForceSendFields []string `json:"-"`
269
270
271
272
273 NullFields []string `json:"-"`
274 }
275
276 func (s *CrawledUrl) MarshalJSON() ([]byte, error) {
277 type NoMethod CrawledUrl
278 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
279 }
280
281
282
283 type CustomAccount struct {
284
285 LoginUrl string `json:"loginUrl,omitempty"`
286
287
288
289 Password string `json:"password,omitempty"`
290
291 Username string `json:"username,omitempty"`
292
293
294
295
296
297 ForceSendFields []string `json:"-"`
298
299
300
301
302 NullFields []string `json:"-"`
303 }
304
305 func (s *CustomAccount) MarshalJSON() ([]byte, error) {
306 type NoMethod CustomAccount
307 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
308 }
309
310
311
312
313
314 type Empty struct {
315
316 googleapi.ServerResponse `json:"-"`
317 }
318
319
320
321 type Finding struct {
322
323 Body string `json:"body,omitempty"`
324
325 Description string `json:"description,omitempty"`
326
327
328 FinalUrl string `json:"finalUrl,omitempty"`
329
330
331
332 FindingType string `json:"findingType,omitempty"`
333
334
335 Form *Form `json:"form,omitempty"`
336
337
338 FrameUrl string `json:"frameUrl,omitempty"`
339
340
341 FuzzedUrl string `json:"fuzzedUrl,omitempty"`
342
343
344 HttpMethod string `json:"httpMethod,omitempty"`
345
346
347
348
349 Name string `json:"name,omitempty"`
350
351
352 OutdatedLibrary *OutdatedLibrary `json:"outdatedLibrary,omitempty"`
353
354
355 ReproductionUrl string `json:"reproductionUrl,omitempty"`
356
357
358
359
360
361
362
363
364 Severity string `json:"severity,omitempty"`
365
366
367 TrackingId string `json:"trackingId,omitempty"`
368
369
370
371 ViolatingResource *ViolatingResource `json:"violatingResource,omitempty"`
372
373
374 VulnerableHeaders *VulnerableHeaders `json:"vulnerableHeaders,omitempty"`
375
376
377 VulnerableParameters *VulnerableParameters `json:"vulnerableParameters,omitempty"`
378
379
380 Xss *Xss `json:"xss,omitempty"`
381
382
383 Xxe *Xxe `json:"xxe,omitempty"`
384
385
386 googleapi.ServerResponse `json:"-"`
387
388
389
390
391
392 ForceSendFields []string `json:"-"`
393
394
395
396
397 NullFields []string `json:"-"`
398 }
399
400 func (s *Finding) MarshalJSON() ([]byte, error) {
401 type NoMethod Finding
402 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
403 }
404
405
406
407 type FindingTypeStats struct {
408
409
410 FindingCount int64 `json:"findingCount,omitempty"`
411
412 FindingType string `json:"findingType,omitempty"`
413
414
415
416
417
418 ForceSendFields []string `json:"-"`
419
420
421
422
423 NullFields []string `json:"-"`
424 }
425
426 func (s *FindingTypeStats) MarshalJSON() ([]byte, error) {
427 type NoMethod FindingTypeStats
428 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
429 }
430
431
432 type Form struct {
433
434 ActionUri string `json:"actionUri,omitempty"`
435
436 Fields []string `json:"fields,omitempty"`
437
438
439
440
441
442 ForceSendFields []string `json:"-"`
443
444
445
446
447 NullFields []string `json:"-"`
448 }
449
450 func (s *Form) MarshalJSON() ([]byte, error) {
451 type NoMethod Form
452 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
453 }
454
455
456
457 type GoogleAccount struct {
458
459
460
461 Password string `json:"password,omitempty"`
462
463 Username string `json:"username,omitempty"`
464
465
466
467
468
469 ForceSendFields []string `json:"-"`
470
471
472
473
474 NullFields []string `json:"-"`
475 }
476
477 func (s *GoogleAccount) MarshalJSON() ([]byte, error) {
478 type NoMethod GoogleAccount
479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
480 }
481
482
483 type Header struct {
484
485 Name string `json:"name,omitempty"`
486
487 Value string `json:"value,omitempty"`
488
489
490
491
492
493 ForceSendFields []string `json:"-"`
494
495
496
497
498 NullFields []string `json:"-"`
499 }
500
501 func (s *Header) MarshalJSON() ([]byte, error) {
502 type NoMethod Header
503 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
504 }
505
506
507
508 type IapCredential struct {
509
510
511
512 IapTestServiceAccountInfo *IapTestServiceAccountInfo `json:"iapTestServiceAccountInfo,omitempty"`
513
514
515
516
517
518 ForceSendFields []string `json:"-"`
519
520
521
522
523 NullFields []string `json:"-"`
524 }
525
526 func (s *IapCredential) MarshalJSON() ([]byte, error) {
527 type NoMethod IapCredential
528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
529 }
530
531
532
533
534 type IapTestServiceAccountInfo struct {
535
536
537 TargetAudienceClientId string `json:"targetAudienceClientId,omitempty"`
538
539
540
541
542
543 ForceSendFields []string `json:"-"`
544
545
546
547
548 NullFields []string `json:"-"`
549 }
550
551 func (s *IapTestServiceAccountInfo) MarshalJSON() ([]byte, error) {
552 type NoMethod IapTestServiceAccountInfo
553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
554 }
555
556
557 type ListCrawledUrlsResponse struct {
558
559 CrawledUrls []*CrawledUrl `json:"crawledUrls,omitempty"`
560
561
562 NextPageToken string `json:"nextPageToken,omitempty"`
563
564
565 googleapi.ServerResponse `json:"-"`
566
567
568
569
570
571 ForceSendFields []string `json:"-"`
572
573
574
575
576 NullFields []string `json:"-"`
577 }
578
579 func (s *ListCrawledUrlsResponse) MarshalJSON() ([]byte, error) {
580 type NoMethod ListCrawledUrlsResponse
581 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
582 }
583
584
585
586 type ListFindingTypeStatsResponse struct {
587
588 FindingTypeStats []*FindingTypeStats `json:"findingTypeStats,omitempty"`
589
590
591 googleapi.ServerResponse `json:"-"`
592
593
594
595
596
597 ForceSendFields []string `json:"-"`
598
599
600
601
602 NullFields []string `json:"-"`
603 }
604
605 func (s *ListFindingTypeStatsResponse) MarshalJSON() ([]byte, error) {
606 type NoMethod ListFindingTypeStatsResponse
607 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
608 }
609
610
611 type ListFindingsResponse struct {
612
613 Findings []*Finding `json:"findings,omitempty"`
614
615
616 NextPageToken string `json:"nextPageToken,omitempty"`
617
618
619 googleapi.ServerResponse `json:"-"`
620
621
622
623
624
625 ForceSendFields []string `json:"-"`
626
627
628
629
630 NullFields []string `json:"-"`
631 }
632
633 func (s *ListFindingsResponse) MarshalJSON() ([]byte, error) {
634 type NoMethod ListFindingsResponse
635 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
636 }
637
638
639 type ListScanConfigsResponse struct {
640
641
642 NextPageToken string `json:"nextPageToken,omitempty"`
643
644 ScanConfigs []*ScanConfig `json:"scanConfigs,omitempty"`
645
646
647 googleapi.ServerResponse `json:"-"`
648
649
650
651
652
653 ForceSendFields []string `json:"-"`
654
655
656
657
658 NullFields []string `json:"-"`
659 }
660
661 func (s *ListScanConfigsResponse) MarshalJSON() ([]byte, error) {
662 type NoMethod ListScanConfigsResponse
663 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
664 }
665
666
667 type ListScanRunsResponse struct {
668
669
670 NextPageToken string `json:"nextPageToken,omitempty"`
671
672 ScanRuns []*ScanRun `json:"scanRuns,omitempty"`
673
674
675 googleapi.ServerResponse `json:"-"`
676
677
678
679
680
681 ForceSendFields []string `json:"-"`
682
683
684
685
686 NullFields []string `json:"-"`
687 }
688
689 func (s *ListScanRunsResponse) MarshalJSON() ([]byte, error) {
690 type NoMethod ListScanRunsResponse
691 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
692 }
693
694
695 type OutdatedLibrary struct {
696
697
698 LearnMoreUrls []string `json:"learnMoreUrls,omitempty"`
699
700 LibraryName string `json:"libraryName,omitempty"`
701
702 Version string `json:"version,omitempty"`
703
704
705
706
707
708 ForceSendFields []string `json:"-"`
709
710
711
712
713 NullFields []string `json:"-"`
714 }
715
716 func (s *OutdatedLibrary) MarshalJSON() ([]byte, error) {
717 type NoMethod OutdatedLibrary
718 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
719 }
720
721
722
723 type ScanConfig struct {
724
725
726 Authentication *Authentication `json:"authentication,omitempty"`
727
728
729 BlacklistPatterns []string `json:"blacklistPatterns,omitempty"`
730
731 DisplayName string `json:"displayName,omitempty"`
732
733
734
735
736
737
738
739
740
741 ExportToSecurityCommandCenter string `json:"exportToSecurityCommandCenter,omitempty"`
742
743
744 IgnoreHttpStatusErrors bool `json:"ignoreHttpStatusErrors,omitempty"`
745
746
747 ManagedScan bool `json:"managedScan,omitempty"`
748
749
750
751
752 MaxQps int64 `json:"maxQps,omitempty"`
753
754
755
756 Name string `json:"name,omitempty"`
757
758
759
760
761
762
763 RiskLevel string `json:"riskLevel,omitempty"`
764
765 Schedule *Schedule `json:"schedule,omitempty"`
766
767
768 StartingUrls []string `json:"startingUrls,omitempty"`
769
770
771
772 StaticIpScan bool `json:"staticIpScan,omitempty"`
773
774
775
776
777
778
779
780
781
782 UserAgent string `json:"userAgent,omitempty"`
783
784
785 googleapi.ServerResponse `json:"-"`
786
787
788
789
790
791 ForceSendFields []string `json:"-"`
792
793
794
795
796 NullFields []string `json:"-"`
797 }
798
799 func (s *ScanConfig) MarshalJSON() ([]byte, error) {
800 type NoMethod ScanConfig
801 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
802 }
803
804
805
806
807
808 type ScanConfigError struct {
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891 Code string `json:"code,omitempty"`
892
893
894
895
896 FieldName string `json:"fieldName,omitempty"`
897
898
899
900
901
902 ForceSendFields []string `json:"-"`
903
904
905
906
907 NullFields []string `json:"-"`
908 }
909
910 func (s *ScanConfigError) MarshalJSON() ([]byte, error) {
911 type NoMethod ScanConfigError
912 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
913 }
914
915
916
917 type ScanRun struct {
918
919
920 EndTime string `json:"endTime,omitempty"`
921
922
923
924 ErrorTrace *ScanRunErrorTrace `json:"errorTrace,omitempty"`
925
926
927
928
929
930
931
932
933 ExecutionState string `json:"executionState,omitempty"`
934
935
936 HasVulnerabilities bool `json:"hasVulnerabilities,omitempty"`
937
938
939
940
941 Name string `json:"name,omitempty"`
942
943
944
945
946 ProgressPercent int64 `json:"progressPercent,omitempty"`
947
948
949
950
951
952
953
954
955
956 ResultState string `json:"resultState,omitempty"`
957
958 StartTime string `json:"startTime,omitempty"`
959
960
961
962 UrlsCrawledCount int64 `json:"urlsCrawledCount,omitempty,string"`
963
964
965
966
967
968 UrlsTestedCount int64 `json:"urlsTestedCount,omitempty,string"`
969
970
971 WarningTraces []*ScanRunWarningTrace `json:"warningTraces,omitempty"`
972
973
974 googleapi.ServerResponse `json:"-"`
975
976
977
978
979
980 ForceSendFields []string `json:"-"`
981
982
983
984
985 NullFields []string `json:"-"`
986 }
987
988 func (s *ScanRun) MarshalJSON() ([]byte, error) {
989 type NoMethod ScanRun
990 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
991 }
992
993
994
995 type ScanRunErrorTrace struct {
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017 Code string `json:"code,omitempty"`
1018
1019
1020
1021
1022 MostCommonHttpErrorCode int64 `json:"mostCommonHttpErrorCode,omitempty"`
1023
1024
1025
1026 ScanConfigError *ScanConfigError `json:"scanConfigError,omitempty"`
1027
1028
1029
1030
1031
1032 ForceSendFields []string `json:"-"`
1033
1034
1035
1036
1037 NullFields []string `json:"-"`
1038 }
1039
1040 func (s *ScanRunErrorTrace) MarshalJSON() ([]byte, error) {
1041 type NoMethod ScanRunErrorTrace
1042 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1043 }
1044
1045
1046
1047
1048 type ScanRunWarningTrace struct {
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065 Code string `json:"code,omitempty"`
1066
1067
1068
1069
1070
1071 ForceSendFields []string `json:"-"`
1072
1073
1074
1075
1076 NullFields []string `json:"-"`
1077 }
1078
1079 func (s *ScanRunWarningTrace) MarshalJSON() ([]byte, error) {
1080 type NoMethod ScanRunWarningTrace
1081 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1082 }
1083
1084
1085 type Schedule struct {
1086
1087
1088 IntervalDurationDays int64 `json:"intervalDurationDays,omitempty"`
1089
1090
1091
1092
1093 ScheduleTime string `json:"scheduleTime,omitempty"`
1094
1095
1096
1097
1098
1099 ForceSendFields []string `json:"-"`
1100
1101
1102
1103
1104 NullFields []string `json:"-"`
1105 }
1106
1107 func (s *Schedule) MarshalJSON() ([]byte, error) {
1108 type NoMethod Schedule
1109 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1110 }
1111
1112
1113 type StartScanRunRequest struct {
1114 }
1115
1116
1117 type StopScanRunRequest struct {
1118 }
1119
1120
1121
1122 type ViolatingResource struct {
1123
1124 ContentType string `json:"contentType,omitempty"`
1125
1126 ResourceUrl string `json:"resourceUrl,omitempty"`
1127
1128
1129
1130
1131
1132 ForceSendFields []string `json:"-"`
1133
1134
1135
1136
1137 NullFields []string `json:"-"`
1138 }
1139
1140 func (s *ViolatingResource) MarshalJSON() ([]byte, error) {
1141 type NoMethod ViolatingResource
1142 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1143 }
1144
1145
1146 type VulnerableHeaders struct {
1147
1148 Headers []*Header `json:"headers,omitempty"`
1149
1150 MissingHeaders []*Header `json:"missingHeaders,omitempty"`
1151
1152
1153
1154
1155
1156 ForceSendFields []string `json:"-"`
1157
1158
1159
1160
1161 NullFields []string `json:"-"`
1162 }
1163
1164 func (s *VulnerableHeaders) MarshalJSON() ([]byte, error) {
1165 type NoMethod VulnerableHeaders
1166 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1167 }
1168
1169
1170 type VulnerableParameters struct {
1171
1172 ParameterNames []string `json:"parameterNames,omitempty"`
1173
1174
1175
1176
1177
1178 ForceSendFields []string `json:"-"`
1179
1180
1181
1182
1183 NullFields []string `json:"-"`
1184 }
1185
1186 func (s *VulnerableParameters) MarshalJSON() ([]byte, error) {
1187 type NoMethod VulnerableParameters
1188 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1189 }
1190
1191
1192 type Xss struct {
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217 AttackVector string `json:"attackVector,omitempty"`
1218
1219 ErrorMessage string `json:"errorMessage,omitempty"`
1220
1221 StackTraces []string `json:"stackTraces,omitempty"`
1222
1223
1224 StoredXssSeedingUrl string `json:"storedXssSeedingUrl,omitempty"`
1225
1226
1227
1228
1229
1230 ForceSendFields []string `json:"-"`
1231
1232
1233
1234
1235 NullFields []string `json:"-"`
1236 }
1237
1238 func (s *Xss) MarshalJSON() ([]byte, error) {
1239 type NoMethod Xss
1240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1241 }
1242
1243
1244 type Xxe struct {
1245
1246
1247
1248
1249
1250
1251 PayloadLocation string `json:"payloadLocation,omitempty"`
1252
1253
1254 PayloadValue string `json:"payloadValue,omitempty"`
1255
1256
1257
1258
1259
1260 ForceSendFields []string `json:"-"`
1261
1262
1263
1264
1265 NullFields []string `json:"-"`
1266 }
1267
1268 func (s *Xxe) MarshalJSON() ([]byte, error) {
1269 type NoMethod Xxe
1270 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1271 }
1272
1273 type ProjectsScanConfigsCreateCall struct {
1274 s *Service
1275 parent string
1276 scanconfig *ScanConfig
1277 urlParams_ gensupport.URLParams
1278 ctx_ context.Context
1279 header_ http.Header
1280 }
1281
1282
1283
1284
1285
1286 func (r *ProjectsScanConfigsService) Create(parent string, scanconfig *ScanConfig) *ProjectsScanConfigsCreateCall {
1287 c := &ProjectsScanConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1288 c.parent = parent
1289 c.scanconfig = scanconfig
1290 return c
1291 }
1292
1293
1294
1295
1296 func (c *ProjectsScanConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsCreateCall {
1297 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1298 return c
1299 }
1300
1301
1302 func (c *ProjectsScanConfigsCreateCall) Context(ctx context.Context) *ProjectsScanConfigsCreateCall {
1303 c.ctx_ = ctx
1304 return c
1305 }
1306
1307
1308
1309 func (c *ProjectsScanConfigsCreateCall) Header() http.Header {
1310 if c.header_ == nil {
1311 c.header_ = make(http.Header)
1312 }
1313 return c.header_
1314 }
1315
1316 func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
1317 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1318 var body io.Reader = nil
1319 body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
1320 if err != nil {
1321 return nil, err
1322 }
1323 c.urlParams_.Set("alt", alt)
1324 c.urlParams_.Set("prettyPrint", "false")
1325 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scanConfigs")
1326 urls += "?" + c.urlParams_.Encode()
1327 req, err := http.NewRequest("POST", urls, body)
1328 if err != nil {
1329 return nil, err
1330 }
1331 req.Header = reqHeaders
1332 googleapi.Expand(req.URL, map[string]string{
1333 "parent": c.parent,
1334 })
1335 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1336 }
1337
1338
1339
1340
1341
1342
1343 func (c *ProjectsScanConfigsCreateCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
1344 gensupport.SetOptions(c.urlParams_, opts...)
1345 res, err := c.doRequest("json")
1346 if res != nil && res.StatusCode == http.StatusNotModified {
1347 if res.Body != nil {
1348 res.Body.Close()
1349 }
1350 return nil, gensupport.WrapError(&googleapi.Error{
1351 Code: res.StatusCode,
1352 Header: res.Header,
1353 })
1354 }
1355 if err != nil {
1356 return nil, err
1357 }
1358 defer googleapi.CloseBody(res)
1359 if err := googleapi.CheckResponse(res); err != nil {
1360 return nil, gensupport.WrapError(err)
1361 }
1362 ret := &ScanConfig{
1363 ServerResponse: googleapi.ServerResponse{
1364 Header: res.Header,
1365 HTTPStatusCode: res.StatusCode,
1366 },
1367 }
1368 target := &ret
1369 if err := gensupport.DecodeResponse(target, res); err != nil {
1370 return nil, err
1371 }
1372 return ret, nil
1373 }
1374
1375 type ProjectsScanConfigsDeleteCall struct {
1376 s *Service
1377 name string
1378 urlParams_ gensupport.URLParams
1379 ctx_ context.Context
1380 header_ http.Header
1381 }
1382
1383
1384
1385
1386
1387 func (r *ProjectsScanConfigsService) Delete(name string) *ProjectsScanConfigsDeleteCall {
1388 c := &ProjectsScanConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1389 c.name = name
1390 return c
1391 }
1392
1393
1394
1395
1396 func (c *ProjectsScanConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsDeleteCall {
1397 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1398 return c
1399 }
1400
1401
1402 func (c *ProjectsScanConfigsDeleteCall) Context(ctx context.Context) *ProjectsScanConfigsDeleteCall {
1403 c.ctx_ = ctx
1404 return c
1405 }
1406
1407
1408
1409 func (c *ProjectsScanConfigsDeleteCall) Header() http.Header {
1410 if c.header_ == nil {
1411 c.header_ = make(http.Header)
1412 }
1413 return c.header_
1414 }
1415
1416 func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
1417 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1418 var body io.Reader = nil
1419 c.urlParams_.Set("alt", alt)
1420 c.urlParams_.Set("prettyPrint", "false")
1421 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1422 urls += "?" + c.urlParams_.Encode()
1423 req, err := http.NewRequest("DELETE", urls, body)
1424 if err != nil {
1425 return nil, err
1426 }
1427 req.Header = reqHeaders
1428 googleapi.Expand(req.URL, map[string]string{
1429 "name": c.name,
1430 })
1431 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1432 }
1433
1434
1435
1436
1437
1438
1439 func (c *ProjectsScanConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1440 gensupport.SetOptions(c.urlParams_, opts...)
1441 res, err := c.doRequest("json")
1442 if res != nil && res.StatusCode == http.StatusNotModified {
1443 if res.Body != nil {
1444 res.Body.Close()
1445 }
1446 return nil, gensupport.WrapError(&googleapi.Error{
1447 Code: res.StatusCode,
1448 Header: res.Header,
1449 })
1450 }
1451 if err != nil {
1452 return nil, err
1453 }
1454 defer googleapi.CloseBody(res)
1455 if err := googleapi.CheckResponse(res); err != nil {
1456 return nil, gensupport.WrapError(err)
1457 }
1458 ret := &Empty{
1459 ServerResponse: googleapi.ServerResponse{
1460 Header: res.Header,
1461 HTTPStatusCode: res.StatusCode,
1462 },
1463 }
1464 target := &ret
1465 if err := gensupport.DecodeResponse(target, res); err != nil {
1466 return nil, err
1467 }
1468 return ret, nil
1469 }
1470
1471 type ProjectsScanConfigsGetCall struct {
1472 s *Service
1473 name string
1474 urlParams_ gensupport.URLParams
1475 ifNoneMatch_ string
1476 ctx_ context.Context
1477 header_ http.Header
1478 }
1479
1480
1481
1482
1483
1484 func (r *ProjectsScanConfigsService) Get(name string) *ProjectsScanConfigsGetCall {
1485 c := &ProjectsScanConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1486 c.name = name
1487 return c
1488 }
1489
1490
1491
1492
1493 func (c *ProjectsScanConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsGetCall {
1494 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1495 return c
1496 }
1497
1498
1499
1500
1501 func (c *ProjectsScanConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsGetCall {
1502 c.ifNoneMatch_ = entityTag
1503 return c
1504 }
1505
1506
1507 func (c *ProjectsScanConfigsGetCall) Context(ctx context.Context) *ProjectsScanConfigsGetCall {
1508 c.ctx_ = ctx
1509 return c
1510 }
1511
1512
1513
1514 func (c *ProjectsScanConfigsGetCall) Header() http.Header {
1515 if c.header_ == nil {
1516 c.header_ = make(http.Header)
1517 }
1518 return c.header_
1519 }
1520
1521 func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, error) {
1522 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1523 if c.ifNoneMatch_ != "" {
1524 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1525 }
1526 var body io.Reader = nil
1527 c.urlParams_.Set("alt", alt)
1528 c.urlParams_.Set("prettyPrint", "false")
1529 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1530 urls += "?" + c.urlParams_.Encode()
1531 req, err := http.NewRequest("GET", urls, body)
1532 if err != nil {
1533 return nil, err
1534 }
1535 req.Header = reqHeaders
1536 googleapi.Expand(req.URL, map[string]string{
1537 "name": c.name,
1538 })
1539 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1540 }
1541
1542
1543
1544
1545
1546
1547 func (c *ProjectsScanConfigsGetCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
1548 gensupport.SetOptions(c.urlParams_, opts...)
1549 res, err := c.doRequest("json")
1550 if res != nil && res.StatusCode == http.StatusNotModified {
1551 if res.Body != nil {
1552 res.Body.Close()
1553 }
1554 return nil, gensupport.WrapError(&googleapi.Error{
1555 Code: res.StatusCode,
1556 Header: res.Header,
1557 })
1558 }
1559 if err != nil {
1560 return nil, err
1561 }
1562 defer googleapi.CloseBody(res)
1563 if err := googleapi.CheckResponse(res); err != nil {
1564 return nil, gensupport.WrapError(err)
1565 }
1566 ret := &ScanConfig{
1567 ServerResponse: googleapi.ServerResponse{
1568 Header: res.Header,
1569 HTTPStatusCode: res.StatusCode,
1570 },
1571 }
1572 target := &ret
1573 if err := gensupport.DecodeResponse(target, res); err != nil {
1574 return nil, err
1575 }
1576 return ret, nil
1577 }
1578
1579 type ProjectsScanConfigsListCall struct {
1580 s *Service
1581 parent string
1582 urlParams_ gensupport.URLParams
1583 ifNoneMatch_ string
1584 ctx_ context.Context
1585 header_ http.Header
1586 }
1587
1588
1589
1590
1591
1592 func (r *ProjectsScanConfigsService) List(parent string) *ProjectsScanConfigsListCall {
1593 c := &ProjectsScanConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1594 c.parent = parent
1595 return c
1596 }
1597
1598
1599
1600
1601 func (c *ProjectsScanConfigsListCall) PageSize(pageSize int64) *ProjectsScanConfigsListCall {
1602 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1603 return c
1604 }
1605
1606
1607
1608
1609
1610 func (c *ProjectsScanConfigsListCall) PageToken(pageToken string) *ProjectsScanConfigsListCall {
1611 c.urlParams_.Set("pageToken", pageToken)
1612 return c
1613 }
1614
1615
1616
1617
1618 func (c *ProjectsScanConfigsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsListCall {
1619 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1620 return c
1621 }
1622
1623
1624
1625
1626 func (c *ProjectsScanConfigsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsListCall {
1627 c.ifNoneMatch_ = entityTag
1628 return c
1629 }
1630
1631
1632 func (c *ProjectsScanConfigsListCall) Context(ctx context.Context) *ProjectsScanConfigsListCall {
1633 c.ctx_ = ctx
1634 return c
1635 }
1636
1637
1638
1639 func (c *ProjectsScanConfigsListCall) Header() http.Header {
1640 if c.header_ == nil {
1641 c.header_ = make(http.Header)
1642 }
1643 return c.header_
1644 }
1645
1646 func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, error) {
1647 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1648 if c.ifNoneMatch_ != "" {
1649 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1650 }
1651 var body io.Reader = nil
1652 c.urlParams_.Set("alt", alt)
1653 c.urlParams_.Set("prettyPrint", "false")
1654 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scanConfigs")
1655 urls += "?" + c.urlParams_.Encode()
1656 req, err := http.NewRequest("GET", urls, body)
1657 if err != nil {
1658 return nil, err
1659 }
1660 req.Header = reqHeaders
1661 googleapi.Expand(req.URL, map[string]string{
1662 "parent": c.parent,
1663 })
1664 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1665 }
1666
1667
1668
1669
1670
1671
1672
1673 func (c *ProjectsScanConfigsListCall) Do(opts ...googleapi.CallOption) (*ListScanConfigsResponse, error) {
1674 gensupport.SetOptions(c.urlParams_, opts...)
1675 res, err := c.doRequest("json")
1676 if res != nil && res.StatusCode == http.StatusNotModified {
1677 if res.Body != nil {
1678 res.Body.Close()
1679 }
1680 return nil, gensupport.WrapError(&googleapi.Error{
1681 Code: res.StatusCode,
1682 Header: res.Header,
1683 })
1684 }
1685 if err != nil {
1686 return nil, err
1687 }
1688 defer googleapi.CloseBody(res)
1689 if err := googleapi.CheckResponse(res); err != nil {
1690 return nil, gensupport.WrapError(err)
1691 }
1692 ret := &ListScanConfigsResponse{
1693 ServerResponse: googleapi.ServerResponse{
1694 Header: res.Header,
1695 HTTPStatusCode: res.StatusCode,
1696 },
1697 }
1698 target := &ret
1699 if err := gensupport.DecodeResponse(target, res); err != nil {
1700 return nil, err
1701 }
1702 return ret, nil
1703 }
1704
1705
1706
1707
1708 func (c *ProjectsScanConfigsListCall) Pages(ctx context.Context, f func(*ListScanConfigsResponse) error) error {
1709 c.ctx_ = ctx
1710 defer c.PageToken(c.urlParams_.Get("pageToken"))
1711 for {
1712 x, err := c.Do()
1713 if err != nil {
1714 return err
1715 }
1716 if err := f(x); err != nil {
1717 return err
1718 }
1719 if x.NextPageToken == "" {
1720 return nil
1721 }
1722 c.PageToken(x.NextPageToken)
1723 }
1724 }
1725
1726 type ProjectsScanConfigsPatchCall struct {
1727 s *Service
1728 name string
1729 scanconfig *ScanConfig
1730 urlParams_ gensupport.URLParams
1731 ctx_ context.Context
1732 header_ http.Header
1733 }
1734
1735
1736
1737
1738
1739
1740
1741 func (r *ProjectsScanConfigsService) Patch(name string, scanconfig *ScanConfig) *ProjectsScanConfigsPatchCall {
1742 c := &ProjectsScanConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1743 c.name = name
1744 c.scanconfig = scanconfig
1745 return c
1746 }
1747
1748
1749
1750
1751 func (c *ProjectsScanConfigsPatchCall) UpdateMask(updateMask string) *ProjectsScanConfigsPatchCall {
1752 c.urlParams_.Set("updateMask", updateMask)
1753 return c
1754 }
1755
1756
1757
1758
1759 func (c *ProjectsScanConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsPatchCall {
1760 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1761 return c
1762 }
1763
1764
1765 func (c *ProjectsScanConfigsPatchCall) Context(ctx context.Context) *ProjectsScanConfigsPatchCall {
1766 c.ctx_ = ctx
1767 return c
1768 }
1769
1770
1771
1772 func (c *ProjectsScanConfigsPatchCall) Header() http.Header {
1773 if c.header_ == nil {
1774 c.header_ = make(http.Header)
1775 }
1776 return c.header_
1777 }
1778
1779 func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) {
1780 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1781 var body io.Reader = nil
1782 body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
1783 if err != nil {
1784 return nil, err
1785 }
1786 c.urlParams_.Set("alt", alt)
1787 c.urlParams_.Set("prettyPrint", "false")
1788 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1789 urls += "?" + c.urlParams_.Encode()
1790 req, err := http.NewRequest("PATCH", urls, body)
1791 if err != nil {
1792 return nil, err
1793 }
1794 req.Header = reqHeaders
1795 googleapi.Expand(req.URL, map[string]string{
1796 "name": c.name,
1797 })
1798 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1799 }
1800
1801
1802
1803
1804
1805
1806 func (c *ProjectsScanConfigsPatchCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
1807 gensupport.SetOptions(c.urlParams_, opts...)
1808 res, err := c.doRequest("json")
1809 if res != nil && res.StatusCode == http.StatusNotModified {
1810 if res.Body != nil {
1811 res.Body.Close()
1812 }
1813 return nil, gensupport.WrapError(&googleapi.Error{
1814 Code: res.StatusCode,
1815 Header: res.Header,
1816 })
1817 }
1818 if err != nil {
1819 return nil, err
1820 }
1821 defer googleapi.CloseBody(res)
1822 if err := googleapi.CheckResponse(res); err != nil {
1823 return nil, gensupport.WrapError(err)
1824 }
1825 ret := &ScanConfig{
1826 ServerResponse: googleapi.ServerResponse{
1827 Header: res.Header,
1828 HTTPStatusCode: res.StatusCode,
1829 },
1830 }
1831 target := &ret
1832 if err := gensupport.DecodeResponse(target, res); err != nil {
1833 return nil, err
1834 }
1835 return ret, nil
1836 }
1837
1838 type ProjectsScanConfigsStartCall struct {
1839 s *Service
1840 name string
1841 startscanrunrequest *StartScanRunRequest
1842 urlParams_ gensupport.URLParams
1843 ctx_ context.Context
1844 header_ http.Header
1845 }
1846
1847
1848
1849
1850
1851 func (r *ProjectsScanConfigsService) Start(name string, startscanrunrequest *StartScanRunRequest) *ProjectsScanConfigsStartCall {
1852 c := &ProjectsScanConfigsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1853 c.name = name
1854 c.startscanrunrequest = startscanrunrequest
1855 return c
1856 }
1857
1858
1859
1860
1861 func (c *ProjectsScanConfigsStartCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsStartCall {
1862 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1863 return c
1864 }
1865
1866
1867 func (c *ProjectsScanConfigsStartCall) Context(ctx context.Context) *ProjectsScanConfigsStartCall {
1868 c.ctx_ = ctx
1869 return c
1870 }
1871
1872
1873
1874 func (c *ProjectsScanConfigsStartCall) Header() http.Header {
1875 if c.header_ == nil {
1876 c.header_ = make(http.Header)
1877 }
1878 return c.header_
1879 }
1880
1881 func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) {
1882 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1883 var body io.Reader = nil
1884 body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest)
1885 if err != nil {
1886 return nil, err
1887 }
1888 c.urlParams_.Set("alt", alt)
1889 c.urlParams_.Set("prettyPrint", "false")
1890 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:start")
1891 urls += "?" + c.urlParams_.Encode()
1892 req, err := http.NewRequest("POST", urls, body)
1893 if err != nil {
1894 return nil, err
1895 }
1896 req.Header = reqHeaders
1897 googleapi.Expand(req.URL, map[string]string{
1898 "name": c.name,
1899 })
1900 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1901 }
1902
1903
1904
1905
1906
1907
1908 func (c *ProjectsScanConfigsStartCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
1909 gensupport.SetOptions(c.urlParams_, opts...)
1910 res, err := c.doRequest("json")
1911 if res != nil && res.StatusCode == http.StatusNotModified {
1912 if res.Body != nil {
1913 res.Body.Close()
1914 }
1915 return nil, gensupport.WrapError(&googleapi.Error{
1916 Code: res.StatusCode,
1917 Header: res.Header,
1918 })
1919 }
1920 if err != nil {
1921 return nil, err
1922 }
1923 defer googleapi.CloseBody(res)
1924 if err := googleapi.CheckResponse(res); err != nil {
1925 return nil, gensupport.WrapError(err)
1926 }
1927 ret := &ScanRun{
1928 ServerResponse: googleapi.ServerResponse{
1929 Header: res.Header,
1930 HTTPStatusCode: res.StatusCode,
1931 },
1932 }
1933 target := &ret
1934 if err := gensupport.DecodeResponse(target, res); err != nil {
1935 return nil, err
1936 }
1937 return ret, nil
1938 }
1939
1940 type ProjectsScanConfigsScanRunsGetCall struct {
1941 s *Service
1942 name string
1943 urlParams_ gensupport.URLParams
1944 ifNoneMatch_ string
1945 ctx_ context.Context
1946 header_ http.Header
1947 }
1948
1949
1950
1951
1952
1953
1954 func (r *ProjectsScanConfigsScanRunsService) Get(name string) *ProjectsScanConfigsScanRunsGetCall {
1955 c := &ProjectsScanConfigsScanRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1956 c.name = name
1957 return c
1958 }
1959
1960
1961
1962
1963 func (c *ProjectsScanConfigsScanRunsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsGetCall {
1964 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1965 return c
1966 }
1967
1968
1969
1970
1971 func (c *ProjectsScanConfigsScanRunsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsGetCall {
1972 c.ifNoneMatch_ = entityTag
1973 return c
1974 }
1975
1976
1977 func (c *ProjectsScanConfigsScanRunsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsGetCall {
1978 c.ctx_ = ctx
1979 return c
1980 }
1981
1982
1983
1984 func (c *ProjectsScanConfigsScanRunsGetCall) Header() http.Header {
1985 if c.header_ == nil {
1986 c.header_ = make(http.Header)
1987 }
1988 return c.header_
1989 }
1990
1991 func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Response, error) {
1992 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1993 if c.ifNoneMatch_ != "" {
1994 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1995 }
1996 var body io.Reader = nil
1997 c.urlParams_.Set("alt", alt)
1998 c.urlParams_.Set("prettyPrint", "false")
1999 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2000 urls += "?" + c.urlParams_.Encode()
2001 req, err := http.NewRequest("GET", urls, body)
2002 if err != nil {
2003 return nil, err
2004 }
2005 req.Header = reqHeaders
2006 googleapi.Expand(req.URL, map[string]string{
2007 "name": c.name,
2008 })
2009 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2010 }
2011
2012
2013
2014
2015
2016
2017 func (c *ProjectsScanConfigsScanRunsGetCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
2018 gensupport.SetOptions(c.urlParams_, opts...)
2019 res, err := c.doRequest("json")
2020 if res != nil && res.StatusCode == http.StatusNotModified {
2021 if res.Body != nil {
2022 res.Body.Close()
2023 }
2024 return nil, gensupport.WrapError(&googleapi.Error{
2025 Code: res.StatusCode,
2026 Header: res.Header,
2027 })
2028 }
2029 if err != nil {
2030 return nil, err
2031 }
2032 defer googleapi.CloseBody(res)
2033 if err := googleapi.CheckResponse(res); err != nil {
2034 return nil, gensupport.WrapError(err)
2035 }
2036 ret := &ScanRun{
2037 ServerResponse: googleapi.ServerResponse{
2038 Header: res.Header,
2039 HTTPStatusCode: res.StatusCode,
2040 },
2041 }
2042 target := &ret
2043 if err := gensupport.DecodeResponse(target, res); err != nil {
2044 return nil, err
2045 }
2046 return ret, nil
2047 }
2048
2049 type ProjectsScanConfigsScanRunsListCall struct {
2050 s *Service
2051 parent string
2052 urlParams_ gensupport.URLParams
2053 ifNoneMatch_ string
2054 ctx_ context.Context
2055 header_ http.Header
2056 }
2057
2058
2059
2060
2061
2062
2063 func (r *ProjectsScanConfigsScanRunsService) List(parent string) *ProjectsScanConfigsScanRunsListCall {
2064 c := &ProjectsScanConfigsScanRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2065 c.parent = parent
2066 return c
2067 }
2068
2069
2070
2071
2072 func (c *ProjectsScanConfigsScanRunsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsListCall {
2073 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2074 return c
2075 }
2076
2077
2078
2079
2080
2081 func (c *ProjectsScanConfigsScanRunsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsListCall {
2082 c.urlParams_.Set("pageToken", pageToken)
2083 return c
2084 }
2085
2086
2087
2088
2089 func (c *ProjectsScanConfigsScanRunsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsListCall {
2090 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2091 return c
2092 }
2093
2094
2095
2096
2097 func (c *ProjectsScanConfigsScanRunsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsListCall {
2098 c.ifNoneMatch_ = entityTag
2099 return c
2100 }
2101
2102
2103 func (c *ProjectsScanConfigsScanRunsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsListCall {
2104 c.ctx_ = ctx
2105 return c
2106 }
2107
2108
2109
2110 func (c *ProjectsScanConfigsScanRunsListCall) Header() http.Header {
2111 if c.header_ == nil {
2112 c.header_ = make(http.Header)
2113 }
2114 return c.header_
2115 }
2116
2117 func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Response, error) {
2118 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2119 if c.ifNoneMatch_ != "" {
2120 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2121 }
2122 var body io.Reader = nil
2123 c.urlParams_.Set("alt", alt)
2124 c.urlParams_.Set("prettyPrint", "false")
2125 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/scanRuns")
2126 urls += "?" + c.urlParams_.Encode()
2127 req, err := http.NewRequest("GET", urls, body)
2128 if err != nil {
2129 return nil, err
2130 }
2131 req.Header = reqHeaders
2132 googleapi.Expand(req.URL, map[string]string{
2133 "parent": c.parent,
2134 })
2135 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2136 }
2137
2138
2139
2140
2141
2142
2143
2144 func (c *ProjectsScanConfigsScanRunsListCall) Do(opts ...googleapi.CallOption) (*ListScanRunsResponse, error) {
2145 gensupport.SetOptions(c.urlParams_, opts...)
2146 res, err := c.doRequest("json")
2147 if res != nil && res.StatusCode == http.StatusNotModified {
2148 if res.Body != nil {
2149 res.Body.Close()
2150 }
2151 return nil, gensupport.WrapError(&googleapi.Error{
2152 Code: res.StatusCode,
2153 Header: res.Header,
2154 })
2155 }
2156 if err != nil {
2157 return nil, err
2158 }
2159 defer googleapi.CloseBody(res)
2160 if err := googleapi.CheckResponse(res); err != nil {
2161 return nil, gensupport.WrapError(err)
2162 }
2163 ret := &ListScanRunsResponse{
2164 ServerResponse: googleapi.ServerResponse{
2165 Header: res.Header,
2166 HTTPStatusCode: res.StatusCode,
2167 },
2168 }
2169 target := &ret
2170 if err := gensupport.DecodeResponse(target, res); err != nil {
2171 return nil, err
2172 }
2173 return ret, nil
2174 }
2175
2176
2177
2178
2179 func (c *ProjectsScanConfigsScanRunsListCall) Pages(ctx context.Context, f func(*ListScanRunsResponse) error) error {
2180 c.ctx_ = ctx
2181 defer c.PageToken(c.urlParams_.Get("pageToken"))
2182 for {
2183 x, err := c.Do()
2184 if err != nil {
2185 return err
2186 }
2187 if err := f(x); err != nil {
2188 return err
2189 }
2190 if x.NextPageToken == "" {
2191 return nil
2192 }
2193 c.PageToken(x.NextPageToken)
2194 }
2195 }
2196
2197 type ProjectsScanConfigsScanRunsStopCall struct {
2198 s *Service
2199 name string
2200 stopscanrunrequest *StopScanRunRequest
2201 urlParams_ gensupport.URLParams
2202 ctx_ context.Context
2203 header_ http.Header
2204 }
2205
2206
2207
2208
2209
2210
2211 func (r *ProjectsScanConfigsScanRunsService) Stop(name string, stopscanrunrequest *StopScanRunRequest) *ProjectsScanConfigsScanRunsStopCall {
2212 c := &ProjectsScanConfigsScanRunsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2213 c.name = name
2214 c.stopscanrunrequest = stopscanrunrequest
2215 return c
2216 }
2217
2218
2219
2220
2221 func (c *ProjectsScanConfigsScanRunsStopCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsStopCall {
2222 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2223 return c
2224 }
2225
2226
2227 func (c *ProjectsScanConfigsScanRunsStopCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsStopCall {
2228 c.ctx_ = ctx
2229 return c
2230 }
2231
2232
2233
2234 func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header {
2235 if c.header_ == nil {
2236 c.header_ = make(http.Header)
2237 }
2238 return c.header_
2239 }
2240
2241 func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) {
2242 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2243 var body io.Reader = nil
2244 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest)
2245 if err != nil {
2246 return nil, err
2247 }
2248 c.urlParams_.Set("alt", alt)
2249 c.urlParams_.Set("prettyPrint", "false")
2250 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:stop")
2251 urls += "?" + c.urlParams_.Encode()
2252 req, err := http.NewRequest("POST", urls, body)
2253 if err != nil {
2254 return nil, err
2255 }
2256 req.Header = reqHeaders
2257 googleapi.Expand(req.URL, map[string]string{
2258 "name": c.name,
2259 })
2260 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2261 }
2262
2263
2264
2265
2266
2267
2268 func (c *ProjectsScanConfigsScanRunsStopCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
2269 gensupport.SetOptions(c.urlParams_, opts...)
2270 res, err := c.doRequest("json")
2271 if res != nil && res.StatusCode == http.StatusNotModified {
2272 if res.Body != nil {
2273 res.Body.Close()
2274 }
2275 return nil, gensupport.WrapError(&googleapi.Error{
2276 Code: res.StatusCode,
2277 Header: res.Header,
2278 })
2279 }
2280 if err != nil {
2281 return nil, err
2282 }
2283 defer googleapi.CloseBody(res)
2284 if err := googleapi.CheckResponse(res); err != nil {
2285 return nil, gensupport.WrapError(err)
2286 }
2287 ret := &ScanRun{
2288 ServerResponse: googleapi.ServerResponse{
2289 Header: res.Header,
2290 HTTPStatusCode: res.StatusCode,
2291 },
2292 }
2293 target := &ret
2294 if err := gensupport.DecodeResponse(target, res); err != nil {
2295 return nil, err
2296 }
2297 return ret, nil
2298 }
2299
2300 type ProjectsScanConfigsScanRunsCrawledUrlsListCall struct {
2301 s *Service
2302 parent string
2303 urlParams_ gensupport.URLParams
2304 ifNoneMatch_ string
2305 ctx_ context.Context
2306 header_ http.Header
2307 }
2308
2309
2310
2311
2312
2313
2314 func (r *ProjectsScanConfigsScanRunsCrawledUrlsService) List(parent string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
2315 c := &ProjectsScanConfigsScanRunsCrawledUrlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2316 c.parent = parent
2317 return c
2318 }
2319
2320
2321
2322
2323 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
2324 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2325 return c
2326 }
2327
2328
2329
2330
2331
2332 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
2333 c.urlParams_.Set("pageToken", pageToken)
2334 return c
2335 }
2336
2337
2338
2339
2340 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
2341 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2342 return c
2343 }
2344
2345
2346
2347
2348 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
2349 c.ifNoneMatch_ = entityTag
2350 return c
2351 }
2352
2353
2354 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
2355 c.ctx_ = ctx
2356 return c
2357 }
2358
2359
2360
2361 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Header() http.Header {
2362 if c.header_ == nil {
2363 c.header_ = make(http.Header)
2364 }
2365 return c.header_
2366 }
2367
2368 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) (*http.Response, error) {
2369 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2370 if c.ifNoneMatch_ != "" {
2371 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2372 }
2373 var body io.Reader = nil
2374 c.urlParams_.Set("alt", alt)
2375 c.urlParams_.Set("prettyPrint", "false")
2376 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/crawledUrls")
2377 urls += "?" + c.urlParams_.Encode()
2378 req, err := http.NewRequest("GET", urls, body)
2379 if err != nil {
2380 return nil, err
2381 }
2382 req.Header = reqHeaders
2383 googleapi.Expand(req.URL, map[string]string{
2384 "parent": c.parent,
2385 })
2386 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2387 }
2388
2389
2390
2391
2392
2393
2394
2395 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Do(opts ...googleapi.CallOption) (*ListCrawledUrlsResponse, error) {
2396 gensupport.SetOptions(c.urlParams_, opts...)
2397 res, err := c.doRequest("json")
2398 if res != nil && res.StatusCode == http.StatusNotModified {
2399 if res.Body != nil {
2400 res.Body.Close()
2401 }
2402 return nil, gensupport.WrapError(&googleapi.Error{
2403 Code: res.StatusCode,
2404 Header: res.Header,
2405 })
2406 }
2407 if err != nil {
2408 return nil, err
2409 }
2410 defer googleapi.CloseBody(res)
2411 if err := googleapi.CheckResponse(res); err != nil {
2412 return nil, gensupport.WrapError(err)
2413 }
2414 ret := &ListCrawledUrlsResponse{
2415 ServerResponse: googleapi.ServerResponse{
2416 Header: res.Header,
2417 HTTPStatusCode: res.StatusCode,
2418 },
2419 }
2420 target := &ret
2421 if err := gensupport.DecodeResponse(target, res); err != nil {
2422 return nil, err
2423 }
2424 return ret, nil
2425 }
2426
2427
2428
2429
2430 func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Pages(ctx context.Context, f func(*ListCrawledUrlsResponse) error) error {
2431 c.ctx_ = ctx
2432 defer c.PageToken(c.urlParams_.Get("pageToken"))
2433 for {
2434 x, err := c.Do()
2435 if err != nil {
2436 return err
2437 }
2438 if err := f(x); err != nil {
2439 return err
2440 }
2441 if x.NextPageToken == "" {
2442 return nil
2443 }
2444 c.PageToken(x.NextPageToken)
2445 }
2446 }
2447
2448 type ProjectsScanConfigsScanRunsFindingTypeStatsListCall struct {
2449 s *Service
2450 parent string
2451 urlParams_ gensupport.URLParams
2452 ifNoneMatch_ string
2453 ctx_ context.Context
2454 header_ http.Header
2455 }
2456
2457
2458
2459
2460
2461
2462 func (r *ProjectsScanConfigsScanRunsFindingTypeStatsService) List(parent string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
2463 c := &ProjectsScanConfigsScanRunsFindingTypeStatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2464 c.parent = parent
2465 return c
2466 }
2467
2468
2469
2470
2471 func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
2472 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2473 return c
2474 }
2475
2476
2477
2478
2479 func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
2480 c.ifNoneMatch_ = entityTag
2481 return c
2482 }
2483
2484
2485 func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
2486 c.ctx_ = ctx
2487 return c
2488 }
2489
2490
2491
2492 func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Header() http.Header {
2493 if c.header_ == nil {
2494 c.header_ = make(http.Header)
2495 }
2496 return c.header_
2497 }
2498
2499 func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt string) (*http.Response, error) {
2500 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2501 if c.ifNoneMatch_ != "" {
2502 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2503 }
2504 var body io.Reader = nil
2505 c.urlParams_.Set("alt", alt)
2506 c.urlParams_.Set("prettyPrint", "false")
2507 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findingTypeStats")
2508 urls += "?" + c.urlParams_.Encode()
2509 req, err := http.NewRequest("GET", urls, body)
2510 if err != nil {
2511 return nil, err
2512 }
2513 req.Header = reqHeaders
2514 googleapi.Expand(req.URL, map[string]string{
2515 "parent": c.parent,
2516 })
2517 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2518 }
2519
2520
2521
2522
2523
2524
2525
2526 func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Do(opts ...googleapi.CallOption) (*ListFindingTypeStatsResponse, error) {
2527 gensupport.SetOptions(c.urlParams_, opts...)
2528 res, err := c.doRequest("json")
2529 if res != nil && res.StatusCode == http.StatusNotModified {
2530 if res.Body != nil {
2531 res.Body.Close()
2532 }
2533 return nil, gensupport.WrapError(&googleapi.Error{
2534 Code: res.StatusCode,
2535 Header: res.Header,
2536 })
2537 }
2538 if err != nil {
2539 return nil, err
2540 }
2541 defer googleapi.CloseBody(res)
2542 if err := googleapi.CheckResponse(res); err != nil {
2543 return nil, gensupport.WrapError(err)
2544 }
2545 ret := &ListFindingTypeStatsResponse{
2546 ServerResponse: googleapi.ServerResponse{
2547 Header: res.Header,
2548 HTTPStatusCode: res.StatusCode,
2549 },
2550 }
2551 target := &ret
2552 if err := gensupport.DecodeResponse(target, res); err != nil {
2553 return nil, err
2554 }
2555 return ret, nil
2556 }
2557
2558 type ProjectsScanConfigsScanRunsFindingsGetCall struct {
2559 s *Service
2560 name string
2561 urlParams_ gensupport.URLParams
2562 ifNoneMatch_ string
2563 ctx_ context.Context
2564 header_ http.Header
2565 }
2566
2567
2568
2569
2570
2571
2572
2573 func (r *ProjectsScanConfigsScanRunsFindingsService) Get(name string) *ProjectsScanConfigsScanRunsFindingsGetCall {
2574 c := &ProjectsScanConfigsScanRunsFindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2575 c.name = name
2576 return c
2577 }
2578
2579
2580
2581
2582 func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsGetCall {
2583 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2584 return c
2585 }
2586
2587
2588
2589
2590 func (c *ProjectsScanConfigsScanRunsFindingsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsGetCall {
2591 c.ifNoneMatch_ = entityTag
2592 return c
2593 }
2594
2595
2596 func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsGetCall {
2597 c.ctx_ = ctx
2598 return c
2599 }
2600
2601
2602
2603 func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Header() http.Header {
2604 if c.header_ == nil {
2605 c.header_ = make(http.Header)
2606 }
2607 return c.header_
2608 }
2609
2610 func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*http.Response, error) {
2611 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2612 if c.ifNoneMatch_ != "" {
2613 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2614 }
2615 var body io.Reader = nil
2616 c.urlParams_.Set("alt", alt)
2617 c.urlParams_.Set("prettyPrint", "false")
2618 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2619 urls += "?" + c.urlParams_.Encode()
2620 req, err := http.NewRequest("GET", urls, body)
2621 if err != nil {
2622 return nil, err
2623 }
2624 req.Header = reqHeaders
2625 googleapi.Expand(req.URL, map[string]string{
2626 "name": c.name,
2627 })
2628 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2629 }
2630
2631
2632
2633
2634
2635
2636 func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Do(opts ...googleapi.CallOption) (*Finding, error) {
2637 gensupport.SetOptions(c.urlParams_, opts...)
2638 res, err := c.doRequest("json")
2639 if res != nil && res.StatusCode == http.StatusNotModified {
2640 if res.Body != nil {
2641 res.Body.Close()
2642 }
2643 return nil, gensupport.WrapError(&googleapi.Error{
2644 Code: res.StatusCode,
2645 Header: res.Header,
2646 })
2647 }
2648 if err != nil {
2649 return nil, err
2650 }
2651 defer googleapi.CloseBody(res)
2652 if err := googleapi.CheckResponse(res); err != nil {
2653 return nil, gensupport.WrapError(err)
2654 }
2655 ret := &Finding{
2656 ServerResponse: googleapi.ServerResponse{
2657 Header: res.Header,
2658 HTTPStatusCode: res.StatusCode,
2659 },
2660 }
2661 target := &ret
2662 if err := gensupport.DecodeResponse(target, res); err != nil {
2663 return nil, err
2664 }
2665 return ret, nil
2666 }
2667
2668 type ProjectsScanConfigsScanRunsFindingsListCall struct {
2669 s *Service
2670 parent string
2671 urlParams_ gensupport.URLParams
2672 ifNoneMatch_ string
2673 ctx_ context.Context
2674 header_ http.Header
2675 }
2676
2677
2678
2679
2680
2681
2682 func (r *ProjectsScanConfigsScanRunsFindingsService) List(parent string) *ProjectsScanConfigsScanRunsFindingsListCall {
2683 c := &ProjectsScanConfigsScanRunsFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2684 c.parent = parent
2685 return c
2686 }
2687
2688
2689
2690
2691 func (c *ProjectsScanConfigsScanRunsFindingsListCall) Filter(filter string) *ProjectsScanConfigsScanRunsFindingsListCall {
2692 c.urlParams_.Set("filter", filter)
2693 return c
2694 }
2695
2696
2697
2698
2699 func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsFindingsListCall {
2700 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2701 return c
2702 }
2703
2704
2705
2706
2707
2708 func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsFindingsListCall {
2709 c.urlParams_.Set("pageToken", pageToken)
2710 return c
2711 }
2712
2713
2714
2715
2716 func (c *ProjectsScanConfigsScanRunsFindingsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsListCall {
2717 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2718 return c
2719 }
2720
2721
2722
2723
2724 func (c *ProjectsScanConfigsScanRunsFindingsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsListCall {
2725 c.ifNoneMatch_ = entityTag
2726 return c
2727 }
2728
2729
2730 func (c *ProjectsScanConfigsScanRunsFindingsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsListCall {
2731 c.ctx_ = ctx
2732 return c
2733 }
2734
2735
2736
2737 func (c *ProjectsScanConfigsScanRunsFindingsListCall) Header() http.Header {
2738 if c.header_ == nil {
2739 c.header_ = make(http.Header)
2740 }
2741 return c.header_
2742 }
2743
2744 func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*http.Response, error) {
2745 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2746 if c.ifNoneMatch_ != "" {
2747 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2748 }
2749 var body io.Reader = nil
2750 c.urlParams_.Set("alt", alt)
2751 c.urlParams_.Set("prettyPrint", "false")
2752 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings")
2753 urls += "?" + c.urlParams_.Encode()
2754 req, err := http.NewRequest("GET", urls, body)
2755 if err != nil {
2756 return nil, err
2757 }
2758 req.Header = reqHeaders
2759 googleapi.Expand(req.URL, map[string]string{
2760 "parent": c.parent,
2761 })
2762 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2763 }
2764
2765
2766
2767
2768
2769
2770
2771 func (c *ProjectsScanConfigsScanRunsFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) {
2772 gensupport.SetOptions(c.urlParams_, opts...)
2773 res, err := c.doRequest("json")
2774 if res != nil && res.StatusCode == http.StatusNotModified {
2775 if res.Body != nil {
2776 res.Body.Close()
2777 }
2778 return nil, gensupport.WrapError(&googleapi.Error{
2779 Code: res.StatusCode,
2780 Header: res.Header,
2781 })
2782 }
2783 if err != nil {
2784 return nil, err
2785 }
2786 defer googleapi.CloseBody(res)
2787 if err := googleapi.CheckResponse(res); err != nil {
2788 return nil, gensupport.WrapError(err)
2789 }
2790 ret := &ListFindingsResponse{
2791 ServerResponse: googleapi.ServerResponse{
2792 Header: res.Header,
2793 HTTPStatusCode: res.StatusCode,
2794 },
2795 }
2796 target := &ret
2797 if err := gensupport.DecodeResponse(target, res); err != nil {
2798 return nil, err
2799 }
2800 return ret, nil
2801 }
2802
2803
2804
2805
2806 func (c *ProjectsScanConfigsScanRunsFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error {
2807 c.ctx_ = ctx
2808 defer c.PageToken(c.urlParams_.Get("pageToken"))
2809 for {
2810 x, err := c.Do()
2811 if err != nil {
2812 return err
2813 }
2814 if err := f(x); err != nil {
2815 return err
2816 }
2817 if x.NextPageToken == "" {
2818 return nil
2819 }
2820 c.PageToken(x.NextPageToken)
2821 }
2822 }
2823
View as plain text