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