|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336 |
- // Copyright 2019 Google LLC.
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file.
-
- // Code generated file. DO NOT EDIT.
-
- // Package websecurityscanner provides access to the Web Security Scanner API.
- //
- // For product documentation, see: https://cloud.google.com/security-scanner/
- //
- // Creating a client
- //
- // Usage example:
- //
- // import "google.golang.org/api/websecurityscanner/v1alpha"
- // ...
- // ctx := context.Background()
- // websecurityscannerService, err := websecurityscanner.NewService(ctx)
- //
- // In this example, Google Application Default Credentials are used for authentication.
- //
- // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
- //
- // Other authentication options
- //
- // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
- //
- // websecurityscannerService, err := websecurityscanner.NewService(ctx, option.WithAPIKey("AIza..."))
- //
- // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
- //
- // config := &oauth2.Config{...}
- // // ...
- // token, err := config.Exchange(ctx, ...)
- // websecurityscannerService, err := websecurityscanner.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
- //
- // See https://godoc.org/google.golang.org/api/option/ for details on options.
- package websecurityscanner // import "google.golang.org/api/websecurityscanner/v1alpha"
-
- import (
- "bytes"
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
-
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- option "google.golang.org/api/option"
- htransport "google.golang.org/api/transport/http"
- )
-
- // Always reference these packages, just in case the auto-generated code
- // below doesn't.
- var _ = bytes.NewBuffer
- var _ = strconv.Itoa
- var _ = fmt.Sprintf
- var _ = json.NewDecoder
- var _ = io.Copy
- var _ = url.Parse
- var _ = gensupport.MarshalJSON
- var _ = googleapi.Version
- var _ = errors.New
- var _ = strings.Replace
- var _ = context.Canceled
-
- const apiId = "websecurityscanner:v1alpha"
- const apiName = "websecurityscanner"
- const apiVersion = "v1alpha"
- const basePath = "https://websecurityscanner.googleapis.com/"
-
- // OAuth2 scopes used by this API.
- const (
- // View and manage your data across Google Cloud Platform services
- CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
- )
-
- // NewService creates a new Service.
- func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
- scopesOption := option.WithScopes(
- "https://www.googleapis.com/auth/cloud-platform",
- )
- // NOTE: prepend, so we don't override user-specified scopes.
- opts = append([]option.ClientOption{scopesOption}, opts...)
- client, endpoint, err := htransport.NewClient(ctx, opts...)
- if err != nil {
- return nil, err
- }
- s, err := New(client)
- if err != nil {
- return nil, err
- }
- if endpoint != "" {
- s.BasePath = endpoint
- }
- return s, nil
- }
-
- // New creates a new Service. It uses the provided http.Client for requests.
- //
- // Deprecated: please use NewService instead.
- // To provide a custom HTTP client, use option.WithHTTPClient.
- // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
- func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.Projects = NewProjectsService(s)
- return s, nil
- }
-
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- Projects *ProjectsService
- }
-
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
-
- func NewProjectsService(s *Service) *ProjectsService {
- rs := &ProjectsService{s: s}
- rs.ScanConfigs = NewProjectsScanConfigsService(s)
- return rs
- }
-
- type ProjectsService struct {
- s *Service
-
- ScanConfigs *ProjectsScanConfigsService
- }
-
- func NewProjectsScanConfigsService(s *Service) *ProjectsScanConfigsService {
- rs := &ProjectsScanConfigsService{s: s}
- rs.ScanRuns = NewProjectsScanConfigsScanRunsService(s)
- return rs
- }
-
- type ProjectsScanConfigsService struct {
- s *Service
-
- ScanRuns *ProjectsScanConfigsScanRunsService
- }
-
- func NewProjectsScanConfigsScanRunsService(s *Service) *ProjectsScanConfigsScanRunsService {
- rs := &ProjectsScanConfigsScanRunsService{s: s}
- rs.CrawledUrls = NewProjectsScanConfigsScanRunsCrawledUrlsService(s)
- rs.FindingTypeStats = NewProjectsScanConfigsScanRunsFindingTypeStatsService(s)
- rs.Findings = NewProjectsScanConfigsScanRunsFindingsService(s)
- return rs
- }
-
- type ProjectsScanConfigsScanRunsService struct {
- s *Service
-
- CrawledUrls *ProjectsScanConfigsScanRunsCrawledUrlsService
-
- FindingTypeStats *ProjectsScanConfigsScanRunsFindingTypeStatsService
-
- Findings *ProjectsScanConfigsScanRunsFindingsService
- }
-
- func NewProjectsScanConfigsScanRunsCrawledUrlsService(s *Service) *ProjectsScanConfigsScanRunsCrawledUrlsService {
- rs := &ProjectsScanConfigsScanRunsCrawledUrlsService{s: s}
- return rs
- }
-
- type ProjectsScanConfigsScanRunsCrawledUrlsService struct {
- s *Service
- }
-
- func NewProjectsScanConfigsScanRunsFindingTypeStatsService(s *Service) *ProjectsScanConfigsScanRunsFindingTypeStatsService {
- rs := &ProjectsScanConfigsScanRunsFindingTypeStatsService{s: s}
- return rs
- }
-
- type ProjectsScanConfigsScanRunsFindingTypeStatsService struct {
- s *Service
- }
-
- func NewProjectsScanConfigsScanRunsFindingsService(s *Service) *ProjectsScanConfigsScanRunsFindingsService {
- rs := &ProjectsScanConfigsScanRunsFindingsService{s: s}
- return rs
- }
-
- type ProjectsScanConfigsScanRunsFindingsService struct {
- s *Service
- }
-
- // Authentication: Scan authentication configuration.
- type Authentication struct {
- // CustomAccount: Authentication using a custom account.
- CustomAccount *CustomAccount `json:"customAccount,omitempty"`
-
- // GoogleAccount: Authentication using a Google account.
- GoogleAccount *GoogleAccount `json:"googleAccount,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CustomAccount") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CustomAccount") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Authentication) MarshalJSON() ([]byte, error) {
- type NoMethod Authentication
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // CrawledUrl: A CrawledUrl resource represents a URL that was crawled
- // during a ScanRun. Web
- // Security Scanner Service crawls the web applications, following all
- // links
- // within the scope of sites, to find the URLs to test against.
- type CrawledUrl struct {
- // Body: Output only.
- // The body of the request that was used to visit the URL.
- Body string `json:"body,omitempty"`
-
- // HttpMethod: Output only.
- // The http method of the request that was used to visit the URL,
- // in
- // uppercase.
- HttpMethod string `json:"httpMethod,omitempty"`
-
- // Url: Output only.
- // The URL that was crawled.
- Url string `json:"url,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Body") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Body") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *CrawledUrl) MarshalJSON() ([]byte, error) {
- type NoMethod CrawledUrl
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // CustomAccount: Describes authentication configuration that uses a
- // custom account.
- type CustomAccount struct {
- // LoginUrl: Required.
- // The login form URL of the website.
- LoginUrl string `json:"loginUrl,omitempty"`
-
- // Password: Input only.
- // Required.
- // The password of the custom account. The credential is stored
- // encrypted
- // and not returned in any response nor included in audit logs.
- Password string `json:"password,omitempty"`
-
- // Username: Required.
- // The user name of the custom account.
- Username string `json:"username,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "LoginUrl") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "LoginUrl") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *CustomAccount) MarshalJSON() ([]byte, error) {
- type NoMethod CustomAccount
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Empty: A generic empty message that you can re-use to avoid defining
- // duplicated
- // empty messages in your APIs. A typical example is to use it as the
- // request
- // or the response type of an API method. For instance:
- //
- // service Foo {
- // rpc Bar(google.protobuf.Empty) returns
- // (google.protobuf.Empty);
- // }
- //
- // The JSON representation for `Empty` is empty JSON object `{}`.
- type Empty struct {
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- }
-
- // Finding: A Finding resource represents a vulnerability instance
- // identified during a
- // ScanRun.
- type Finding struct {
- // Body: Output only.
- // The body of the request that triggered the vulnerability.
- Body string `json:"body,omitempty"`
-
- // Description: Output only.
- // The description of the vulnerability.
- Description string `json:"description,omitempty"`
-
- // FinalUrl: Output only.
- // The URL where the browser lands when the vulnerability is detected.
- FinalUrl string `json:"finalUrl,omitempty"`
-
- // FindingType: Output only.
- // The type of the Finding.
- //
- // Possible values:
- // "FINDING_TYPE_UNSPECIFIED" - The invalid finding type.
- // "MIXED_CONTENT" - A page that was served over HTTPS also resources
- // over HTTP. A
- // man-in-the-middle attacker could tamper with the HTTP resource and
- // gain
- // full access to the website that loads the resource or to monitor
- // the
- // actions taken by the user.
- // "OUTDATED_LIBRARY" - The version of an included library is known to
- // contain a security issue.
- // The scanner checks the version of library in use against a known list
- // of
- // vulnerable libraries. False positives are possible if the
- // version
- // detection fails or if the library has been manually patched.
- // "ROSETTA_FLASH" - This type of vulnerability occurs when the value
- // of a request parameter
- // is reflected at the beginning of the response, for example, in
- // requests
- // using JSONP. Under certain circumstances, an attacker may be able
- // to
- // supply an alphanumeric-only Flash file in the vulnerable
- // parameter
- // causing the browser to execute the Flash file as if it originated on
- // the
- // vulnerable server.
- // "XSS_CALLBACK" - A cross-site scripting (XSS) bug is found via
- // JavaScript callback. For
- // detailed explanations on XSS,
- // see
- // https://www.google.com/about/appsecurity/learning/xss/.
- // "XSS_ERROR" - A potential cross-site scripting (XSS) bug due to
- // JavaScript breakage.
- // In some circumstances, the application under test might modify the
- // test
- // string before it is parsed by the browser. When the browser attempts
- // to
- // runs this modified test string, it will likely break and throw
- // a
- // JavaScript execution error, thus an injection issue is
- // occurring.
- // However, it may not be exploitable. Manual verification is needed to
- // see
- // if the test string modifications can be evaded and confirm that the
- // issue
- // is in fact an XSS vulnerability. For detailed explanations on XSS,
- // see
- // https://www.google.com/about/appsecurity/learning/xss/.
- // "CLEAR_TEXT_PASSWORD" - An application appears to be transmitting a
- // password field in clear text.
- // An attacker can eavesdrop network traffic and sniff the password
- // field.
- // "INVALID_CONTENT_TYPE" - An application returns sensitive content
- // with an invalid content type,
- // or without an 'X-Content-Type-Options: nosniff' header.
- // "XSS_ANGULAR_CALLBACK" - A cross-site scripting (XSS) vulnerability
- // in AngularJS module that
- // occurs when a user-provided string is interpolated by Angular.
- // "INVALID_HEADER" - A malformed or invalid valued header.
- // "MISSPELLED_SECURITY_HEADER_NAME" - Misspelled security header
- // name.
- // "MISMATCHING_SECURITY_HEADER_VALUES" - Mismatching values in a
- // duplicate security header.
- FindingType string `json:"findingType,omitempty"`
-
- // FrameUrl: Output only.
- // If the vulnerability was originated from nested IFrame, the
- // immediate
- // parent IFrame is reported.
- FrameUrl string `json:"frameUrl,omitempty"`
-
- // FuzzedUrl: Output only.
- // The URL produced by the server-side fuzzer and used in the request
- // that
- // triggered the vulnerability.
- FuzzedUrl string `json:"fuzzedUrl,omitempty"`
-
- // HttpMethod: Output only.
- // The http method of the request that triggered the vulnerability,
- // in
- // uppercase.
- HttpMethod string `json:"httpMethod,omitempty"`
-
- // Name: Output only.
- // The resource name of the Finding. The name follows the format
- // of
- // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunI
- // d}/findings/{findingId}'.
- // The finding IDs are generated by the system.
- Name string `json:"name,omitempty"`
-
- // OutdatedLibrary: Output only.
- // An addon containing information about outdated libraries.
- OutdatedLibrary *OutdatedLibrary `json:"outdatedLibrary,omitempty"`
-
- // ReproductionUrl: Output only.
- // The URL containing human-readable payload that user can leverage
- // to
- // reproduce the vulnerability.
- ReproductionUrl string `json:"reproductionUrl,omitempty"`
-
- // TrackingId: Output only.
- // The tracking ID uniquely identifies a vulnerability instance
- // across
- // multiple ScanRuns.
- TrackingId string `json:"trackingId,omitempty"`
-
- // ViolatingResource: Output only.
- // An addon containing detailed information regarding any resource
- // causing the
- // vulnerability such as JavaScript sources, image, audio files, etc.
- ViolatingResource *ViolatingResource `json:"violatingResource,omitempty"`
-
- // VulnerableHeaders: Output only.
- // An addon containing information about vulnerable or missing HTTP
- // headers.
- VulnerableHeaders *VulnerableHeaders `json:"vulnerableHeaders,omitempty"`
-
- // VulnerableParameters: Output only.
- // An addon containing information about request parameters which were
- // found
- // to be vulnerable.
- VulnerableParameters *VulnerableParameters `json:"vulnerableParameters,omitempty"`
-
- // Xss: Output only.
- // An addon containing information reported for an XSS, if any.
- Xss *Xss `json:"xss,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Body") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Body") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Finding) MarshalJSON() ([]byte, error) {
- type NoMethod Finding
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // FindingTypeStats: A FindingTypeStats resource represents stats
- // regarding a specific FindingType
- // of Findings under a given ScanRun.
- type FindingTypeStats struct {
- // FindingCount: Output only.
- // The count of findings belonging to this finding type.
- FindingCount int64 `json:"findingCount,omitempty"`
-
- // FindingType: Output only.
- // The finding type associated with the stats.
- //
- // Possible values:
- // "FINDING_TYPE_UNSPECIFIED" - The invalid finding type.
- // "MIXED_CONTENT" - A page that was served over HTTPS also resources
- // over HTTP. A
- // man-in-the-middle attacker could tamper with the HTTP resource and
- // gain
- // full access to the website that loads the resource or to monitor
- // the
- // actions taken by the user.
- // "OUTDATED_LIBRARY" - The version of an included library is known to
- // contain a security issue.
- // The scanner checks the version of library in use against a known list
- // of
- // vulnerable libraries. False positives are possible if the
- // version
- // detection fails or if the library has been manually patched.
- // "ROSETTA_FLASH" - This type of vulnerability occurs when the value
- // of a request parameter
- // is reflected at the beginning of the response, for example, in
- // requests
- // using JSONP. Under certain circumstances, an attacker may be able
- // to
- // supply an alphanumeric-only Flash file in the vulnerable
- // parameter
- // causing the browser to execute the Flash file as if it originated on
- // the
- // vulnerable server.
- // "XSS_CALLBACK" - A cross-site scripting (XSS) bug is found via
- // JavaScript callback. For
- // detailed explanations on XSS,
- // see
- // https://www.google.com/about/appsecurity/learning/xss/.
- // "XSS_ERROR" - A potential cross-site scripting (XSS) bug due to
- // JavaScript breakage.
- // In some circumstances, the application under test might modify the
- // test
- // string before it is parsed by the browser. When the browser attempts
- // to
- // runs this modified test string, it will likely break and throw
- // a
- // JavaScript execution error, thus an injection issue is
- // occurring.
- // However, it may not be exploitable. Manual verification is needed to
- // see
- // if the test string modifications can be evaded and confirm that the
- // issue
- // is in fact an XSS vulnerability. For detailed explanations on XSS,
- // see
- // https://www.google.com/about/appsecurity/learning/xss/.
- // "CLEAR_TEXT_PASSWORD" - An application appears to be transmitting a
- // password field in clear text.
- // An attacker can eavesdrop network traffic and sniff the password
- // field.
- // "INVALID_CONTENT_TYPE" - An application returns sensitive content
- // with an invalid content type,
- // or without an 'X-Content-Type-Options: nosniff' header.
- // "XSS_ANGULAR_CALLBACK" - A cross-site scripting (XSS) vulnerability
- // in AngularJS module that
- // occurs when a user-provided string is interpolated by Angular.
- // "INVALID_HEADER" - A malformed or invalid valued header.
- // "MISSPELLED_SECURITY_HEADER_NAME" - Misspelled security header
- // name.
- // "MISMATCHING_SECURITY_HEADER_VALUES" - Mismatching values in a
- // duplicate security header.
- FindingType string `json:"findingType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "FindingCount") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FindingCount") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *FindingTypeStats) MarshalJSON() ([]byte, error) {
- type NoMethod FindingTypeStats
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GoogleAccount: Describes authentication configuration that uses a
- // Google account.
- type GoogleAccount struct {
- // Password: Input only.
- // Required.
- // The password of the Google account. The credential is stored
- // encrypted
- // and not returned in any response nor included in audit logs.
- Password string `json:"password,omitempty"`
-
- // Username: Required.
- // The user name of the Google account.
- Username string `json:"username,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Password") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Password") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *GoogleAccount) MarshalJSON() ([]byte, error) {
- type NoMethod GoogleAccount
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Header: Describes a HTTP Header.
- type Header struct {
- // Name: Header name.
- Name string `json:"name,omitempty"`
-
- // Value: Header value.
- Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Name") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Header) MarshalJSON() ([]byte, error) {
- type NoMethod Header
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListCrawledUrlsResponse: Response for the `ListCrawledUrls` method.
- type ListCrawledUrlsResponse struct {
- // CrawledUrls: The list of CrawledUrls returned.
- CrawledUrls []*CrawledUrl `json:"crawledUrls,omitempty"`
-
- // NextPageToken: Token to retrieve the next page of results, or empty
- // if there are no
- // more results in the list.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CrawledUrls") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CrawledUrls") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ListCrawledUrlsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListCrawledUrlsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListFindingTypeStatsResponse: Response for the `ListFindingTypeStats`
- // method.
- type ListFindingTypeStatsResponse struct {
- // FindingTypeStats: The list of FindingTypeStats returned.
- FindingTypeStats []*FindingTypeStats `json:"findingTypeStats,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "FindingTypeStats") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FindingTypeStats") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ListFindingTypeStatsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListFindingTypeStatsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListFindingsResponse: Response for the `ListFindings` method.
- type ListFindingsResponse struct {
- // Findings: The list of Findings returned.
- Findings []*Finding `json:"findings,omitempty"`
-
- // NextPageToken: Token to retrieve the next page of results, or empty
- // if there are no
- // more results in the list.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Findings") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Findings") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ListFindingsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListFindingsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListScanConfigsResponse: Response for the `ListScanConfigs` method.
- type ListScanConfigsResponse struct {
- // NextPageToken: Token to retrieve the next page of results, or empty
- // if there are no
- // more results in the list.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ScanConfigs: The list of ScanConfigs returned.
- ScanConfigs []*ScanConfig `json:"scanConfigs,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "NextPageToken") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NextPageToken") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ListScanConfigsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListScanConfigsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListScanRunsResponse: Response for the `ListScanRuns` method.
- type ListScanRunsResponse struct {
- // NextPageToken: Token to retrieve the next page of results, or empty
- // if there are no
- // more results in the list.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ScanRuns: The list of ScanRuns returned.
- ScanRuns []*ScanRun `json:"scanRuns,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "NextPageToken") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NextPageToken") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ListScanRunsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListScanRunsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // OutdatedLibrary: Information reported for an outdated library.
- type OutdatedLibrary struct {
- // LearnMoreUrls: URLs to learn more information about the
- // vulnerabilities in the library.
- LearnMoreUrls []string `json:"learnMoreUrls,omitempty"`
-
- // LibraryName: The name of the outdated library.
- LibraryName string `json:"libraryName,omitempty"`
-
- // Version: The version number.
- Version string `json:"version,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "LearnMoreUrls") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "LearnMoreUrls") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *OutdatedLibrary) MarshalJSON() ([]byte, error) {
- type NoMethod OutdatedLibrary
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ScanConfig: A ScanConfig resource contains the configurations to
- // launch a scan.
- // next id: 12
- type ScanConfig struct {
- // Authentication: The authentication configuration. If specified,
- // service will use the
- // authentication configuration during scanning.
- Authentication *Authentication `json:"authentication,omitempty"`
-
- // BlacklistPatterns: The blacklist URL patterns as described
- // in
- // https://cloud.google.com/security-scanner/docs/excluded-urls
- BlacklistPatterns []string `json:"blacklistPatterns,omitempty"`
-
- // DisplayName: Required.
- // The user provided display name of the ScanConfig.
- DisplayName string `json:"displayName,omitempty"`
-
- // LatestRun: Latest ScanRun if available.
- LatestRun *ScanRun `json:"latestRun,omitempty"`
-
- // MaxQps: The maximum QPS during scanning. A valid value ranges from 5
- // to 20
- // inclusively. If the field is unspecified or its value is set 0,
- // server will
- // default to 15. Other values outside of [5, 20] range will be rejected
- // with
- // INVALID_ARGUMENT error.
- MaxQps int64 `json:"maxQps,omitempty"`
-
- // Name: The resource name of the ScanConfig. The name follows the
- // format of
- // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs
- // are
- // generated by the system.
- Name string `json:"name,omitempty"`
-
- // Schedule: The schedule of the ScanConfig.
- Schedule *Schedule `json:"schedule,omitempty"`
-
- // StartingUrls: Required.
- // The starting URLs from which the scanner finds site pages.
- StartingUrls []string `json:"startingUrls,omitempty"`
-
- // TargetPlatforms: Set of Cloud Platforms targeted by the scan. If
- // empty, APP_ENGINE will be
- // used as a default.
- //
- // Possible values:
- // "TARGET_PLATFORM_UNSPECIFIED" - The target platform is unknown.
- // Requests with this enum value will be
- // rejected with INVALID_ARGUMENT error.
- // "APP_ENGINE" - Google App Engine service.
- // "COMPUTE" - Google Compute Engine service.
- TargetPlatforms []string `json:"targetPlatforms,omitempty"`
-
- // UserAgent: The user agent used during scanning.
- //
- // Possible values:
- // "USER_AGENT_UNSPECIFIED" - The user agent is unknown. Service will
- // default to CHROME_LINUX.
- // "CHROME_LINUX" - Chrome on Linux. This is the service default if
- // unspecified.
- // "CHROME_ANDROID" - Chrome on Android.
- // "SAFARI_IPHONE" - Safari on IPhone.
- UserAgent string `json:"userAgent,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Authentication") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Authentication") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ScanConfig) MarshalJSON() ([]byte, error) {
- type NoMethod ScanConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ScanRun: A ScanRun is a output-only resource representing an actual
- // run of the scan.
- type ScanRun struct {
- // EndTime: Output only.
- // The time at which the ScanRun reached termination state - that the
- // ScanRun
- // is either finished or stopped by user.
- EndTime string `json:"endTime,omitempty"`
-
- // ExecutionState: Output only.
- // The execution state of the ScanRun.
- //
- // Possible values:
- // "EXECUTION_STATE_UNSPECIFIED" - Represents an invalid state caused
- // by internal server error. This value
- // should never be returned.
- // "QUEUED" - The scan is waiting in the queue.
- // "SCANNING" - The scan is in progress.
- // "FINISHED" - The scan is either finished or stopped by user.
- ExecutionState string `json:"executionState,omitempty"`
-
- // HasVulnerabilities: Output only.
- // Whether the scan run has found any vulnerabilities.
- HasVulnerabilities bool `json:"hasVulnerabilities,omitempty"`
-
- // Name: Output only.
- // The resource name of the ScanRun. The name follows the format
- // of
- // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunI
- // d}'.
- // The ScanRun IDs are generated by the system.
- Name string `json:"name,omitempty"`
-
- // ProgressPercent: Output only.
- // The percentage of total completion ranging from 0 to 100.
- // If the scan is in queue, the value is 0.
- // If the scan is running, the value ranges from 0 to 100.
- // If the scan is finished, the value is 100.
- ProgressPercent int64 `json:"progressPercent,omitempty"`
-
- // ResultState: Output only.
- // The result state of the ScanRun. This field is only available after
- // the
- // execution state reaches "FINISHED".
- //
- // Possible values:
- // "RESULT_STATE_UNSPECIFIED" - Default value. This value is returned
- // when the ScanRun is not yet
- // finished.
- // "SUCCESS" - The scan finished without errors.
- // "ERROR" - The scan finished with errors.
- // "KILLED" - The scan was terminated by user.
- ResultState string `json:"resultState,omitempty"`
-
- // StartTime: Output only.
- // The time at which the ScanRun started.
- StartTime string `json:"startTime,omitempty"`
-
- // UrlsCrawledCount: Output only.
- // The number of URLs crawled during this ScanRun. If the scan is in
- // progress,
- // the value represents the number of URLs crawled up to now.
- UrlsCrawledCount int64 `json:"urlsCrawledCount,omitempty,string"`
-
- // UrlsTestedCount: Output only.
- // The number of URLs tested during this ScanRun. If the scan is in
- // progress,
- // the value represents the number of URLs tested up to now. The number
- // of
- // URLs tested is usually larger than the number URLS crawled
- // because
- // typically a crawled URL is tested with multiple test payloads.
- UrlsTestedCount int64 `json:"urlsTestedCount,omitempty,string"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "EndTime") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "EndTime") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ScanRun) MarshalJSON() ([]byte, error) {
- type NoMethod ScanRun
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Schedule: Scan schedule configuration.
- type Schedule struct {
- // IntervalDurationDays: Required.
- // The duration of time between executions in days.
- IntervalDurationDays int64 `json:"intervalDurationDays,omitempty"`
-
- // ScheduleTime: A timestamp indicates when the next run will be
- // scheduled. The value is
- // refreshed by the server after each run. If unspecified, it will
- // default
- // to current server time, which means the scan will be scheduled to
- // start
- // immediately.
- ScheduleTime string `json:"scheduleTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "IntervalDurationDays") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IntervalDurationDays") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Schedule) MarshalJSON() ([]byte, error) {
- type NoMethod Schedule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // StartScanRunRequest: Request for the `StartScanRun` method.
- type StartScanRunRequest struct {
- }
-
- // StopScanRunRequest: Request for the `StopScanRun` method.
- type StopScanRunRequest struct {
- }
-
- // ViolatingResource: Information regarding any resource causing the
- // vulnerability such
- // as JavaScript sources, image, audio files, etc.
- type ViolatingResource struct {
- // ContentType: The MIME type of this resource.
- ContentType string `json:"contentType,omitempty"`
-
- // ResourceUrl: URL of this violating resource.
- ResourceUrl string `json:"resourceUrl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ContentType") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ContentType") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *ViolatingResource) MarshalJSON() ([]byte, error) {
- type NoMethod ViolatingResource
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // VulnerableHeaders: Information about vulnerable or missing HTTP
- // Headers.
- type VulnerableHeaders struct {
- // Headers: List of vulnerable headers.
- Headers []*Header `json:"headers,omitempty"`
-
- // MissingHeaders: List of missing headers.
- MissingHeaders []*Header `json:"missingHeaders,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Headers") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Headers") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *VulnerableHeaders) MarshalJSON() ([]byte, error) {
- type NoMethod VulnerableHeaders
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // VulnerableParameters: Information about vulnerable request
- // parameters.
- type VulnerableParameters struct {
- // ParameterNames: The vulnerable parameter names.
- ParameterNames []string `json:"parameterNames,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ParameterNames") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ParameterNames") to
- // include in API requests with the JSON null value. By default, fields
- // with empty values are omitted from API requests. However, any field
- // with an empty value appearing in NullFields will be sent to the
- // server as null. It is an error if a field in this list has a
- // non-empty value. This may be used to include null fields in Patch
- // requests.
- NullFields []string `json:"-"`
- }
-
- func (s *VulnerableParameters) MarshalJSON() ([]byte, error) {
- type NoMethod VulnerableParameters
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Xss: Information reported for an XSS.
- type Xss struct {
- // ErrorMessage: An error message generated by a javascript breakage.
- ErrorMessage string `json:"errorMessage,omitempty"`
-
- // StackTraces: Stack traces leading to the point where the XSS
- // occurred.
- StackTraces []string `json:"stackTraces,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ErrorMessage") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ErrorMessage") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Xss) MarshalJSON() ([]byte, error) {
- type NoMethod Xss
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // method id "websecurityscanner.projects.scanConfigs.create":
-
- type ProjectsScanConfigsCreateCall struct {
- s *Service
- parent string
- scanconfig *ScanConfig
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Create: Creates a new ScanConfig.
- func (r *ProjectsScanConfigsService) Create(parent string, scanconfig *ScanConfig) *ProjectsScanConfigsCreateCall {
- c := &ProjectsScanConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- c.scanconfig = scanconfig
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsCreateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsCreateCall) Context(ctx context.Context) *ProjectsScanConfigsCreateCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsCreateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.create" call.
- // Exactly one of *ScanConfig or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *ScanConfig.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsCreateCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ScanConfig{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new ScanConfig.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs",
- // "httpMethod": "POST",
- // "id": "websecurityscanner.projects.scanConfigs.create",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "parent": {
- // "description": "Required.\nThe parent resource name where the scan is created, which should be a\nproject resource name in the format 'projects/{projectId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+parent}/scanConfigs",
- // "request": {
- // "$ref": "ScanConfig"
- // },
- // "response": {
- // "$ref": "ScanConfig"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.delete":
-
- type ProjectsScanConfigsDeleteCall struct {
- s *Service
- name string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes an existing ScanConfig and its child resources.
- func (r *ProjectsScanConfigsService) Delete(name string) *ProjectsScanConfigsDeleteCall {
- c := &ProjectsScanConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsDeleteCall) Context(ctx context.Context) *ProjectsScanConfigsDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.delete" call.
- // Exactly one of *Empty or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Empty.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *ProjectsScanConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Empty{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes an existing ScanConfig and its child resources.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}",
- // "httpMethod": "DELETE",
- // "id": "websecurityscanner.projects.scanConfigs.delete",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "Required.\nThe resource name of the ScanConfig to be deleted. The name follows the\nformat of 'projects/{projectId}/scanConfigs/{scanConfigId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.get":
-
- type ProjectsScanConfigsGetCall struct {
- s *Service
- name string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets a ScanConfig.
- func (r *ProjectsScanConfigsService) Get(name string) *ProjectsScanConfigsGetCall {
- c := &ProjectsScanConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsGetCall) Context(ctx context.Context) *ProjectsScanConfigsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.get" call.
- // Exactly one of *ScanConfig or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *ScanConfig.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsGetCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ScanConfig{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets a ScanConfig.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.get",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "Required.\nThe resource name of the ScanConfig to be returned. The name follows the\nformat of 'projects/{projectId}/scanConfigs/{scanConfigId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}",
- // "response": {
- // "$ref": "ScanConfig"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.list":
-
- type ProjectsScanConfigsListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists ScanConfigs under a given project.
- func (r *ProjectsScanConfigsService) List(parent string) *ProjectsScanConfigsListCall {
- c := &ProjectsScanConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of ScanConfigs to return, can be limited by server.
- // If not specified or not positive, the implementation will select
- // a
- // reasonable value.
- func (c *ProjectsScanConfigsListCall) PageSize(pageSize int64) *ProjectsScanConfigsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results to be returned. This should be
- // a
- // `next_page_token` value returned from a previous List request.
- // If unspecified, the first page of results is returned.
- func (c *ProjectsScanConfigsListCall) PageToken(pageToken string) *ProjectsScanConfigsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsListCall) Context(ctx context.Context) *ProjectsScanConfigsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.list" call.
- // Exactly one of *ListScanConfigsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListScanConfigsResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsListCall) Do(opts ...googleapi.CallOption) (*ListScanConfigsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListScanConfigsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists ScanConfigs under a given project.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "The maximum number of ScanConfigs to return, can be limited by server.\nIf not specified or not positive, the implementation will select a\nreasonable value.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results to be returned. This should be a\n`next_page_token` value returned from a previous List request.\nIf unspecified, the first page of results is returned.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "Required.\nThe parent resource name, which should be a project resource name in the\nformat 'projects/{projectId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+parent}/scanConfigs",
- // "response": {
- // "$ref": "ListScanConfigsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *ProjectsScanConfigsListCall) Pages(ctx context.Context, f func(*ListScanConfigsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "websecurityscanner.projects.scanConfigs.patch":
-
- type ProjectsScanConfigsPatchCall struct {
- s *Service
- name string
- scanconfig *ScanConfig
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Patch: Updates a ScanConfig. This method support partial update of a
- // ScanConfig.
- func (r *ProjectsScanConfigsService) Patch(name string, scanconfig *ScanConfig) *ProjectsScanConfigsPatchCall {
- c := &ProjectsScanConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- c.scanconfig = scanconfig
- return c
- }
-
- // UpdateMask sets the optional parameter "updateMask": Required.
- // The update mask applies to the resource. For the `FieldMask`
- // definition,
- // see
- // https://developers.google.com/protocol-buffers/docs/re
- // ference/google.protobuf#fieldmask
- func (c *ProjectsScanConfigsPatchCall) UpdateMask(updateMask string) *ProjectsScanConfigsPatchCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsPatchCall) Context(ctx context.Context) *ProjectsScanConfigsPatchCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.patch" call.
- // Exactly one of *ScanConfig or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *ScanConfig.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsPatchCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ScanConfig{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a ScanConfig. This method support partial update of a ScanConfig.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}",
- // "httpMethod": "PATCH",
- // "id": "websecurityscanner.projects.scanConfigs.patch",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "The resource name of the ScanConfig. The name follows the format of\n'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are\ngenerated by the system.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Required.\nThe update mask applies to the resource. For the `FieldMask` definition,\nsee\nhttps://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}",
- // "request": {
- // "$ref": "ScanConfig"
- // },
- // "response": {
- // "$ref": "ScanConfig"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.start":
-
- type ProjectsScanConfigsStartCall struct {
- s *Service
- name string
- startscanrunrequest *StartScanRunRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Start: Start a ScanRun according to the given ScanConfig.
- func (r *ProjectsScanConfigsService) Start(name string, startscanrunrequest *StartScanRunRequest) *ProjectsScanConfigsStartCall {
- c := &ProjectsScanConfigsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- c.startscanrunrequest = startscanrunrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsStartCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsStartCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsStartCall) Context(ctx context.Context) *ProjectsScanConfigsStartCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsStartCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:start")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.start" call.
- // Exactly one of *ScanRun or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *ScanRun.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *ProjectsScanConfigsStartCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ScanRun{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Start a ScanRun according to the given ScanConfig.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}:start",
- // "httpMethod": "POST",
- // "id": "websecurityscanner.projects.scanConfigs.start",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "Required.\nThe resource name of the ScanConfig to be used. The name follows the\nformat of 'projects/{projectId}/scanConfigs/{scanConfigId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}:start",
- // "request": {
- // "$ref": "StartScanRunRequest"
- // },
- // "response": {
- // "$ref": "ScanRun"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.get":
-
- type ProjectsScanConfigsScanRunsGetCall struct {
- s *Service
- name string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets a ScanRun.
- func (r *ProjectsScanConfigsScanRunsService) Get(name string) *ProjectsScanConfigsScanRunsGetCall {
- c := &ProjectsScanConfigsScanRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsScanRunsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.get" call.
- // Exactly one of *ScanRun or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *ScanRun.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *ProjectsScanConfigsScanRunsGetCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ScanRun{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets a ScanRun.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns/{scanRunsId}",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.get",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "Required.\nThe resource name of the ScanRun to be returned. The name follows the\nformat of\n'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}",
- // "response": {
- // "$ref": "ScanRun"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.list":
-
- type ProjectsScanConfigsScanRunsListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists ScanRuns under a given ScanConfig, in descending order of
- // ScanRun
- // stop time.
- func (r *ProjectsScanConfigsScanRunsService) List(parent string) *ProjectsScanConfigsScanRunsListCall {
- c := &ProjectsScanConfigsScanRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of ScanRuns to return, can be limited by server.
- // If not specified or not positive, the implementation will select
- // a
- // reasonable value.
- func (c *ProjectsScanConfigsScanRunsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results to be returned. This should be
- // a
- // `next_page_token` value returned from a previous List request.
- // If unspecified, the first page of results is returned.
- func (c *ProjectsScanConfigsScanRunsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsScanRunsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanRuns")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.list" call.
- // Exactly one of *ListScanRunsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListScanRunsResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsScanRunsListCall) Do(opts ...googleapi.CallOption) (*ListScanRunsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListScanRunsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists ScanRuns under a given ScanConfig, in descending order of ScanRun\nstop time.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "The maximum number of ScanRuns to return, can be limited by server.\nIf not specified or not positive, the implementation will select a\nreasonable value.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results to be returned. This should be a\n`next_page_token` value returned from a previous List request.\nIf unspecified, the first page of results is returned.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "Required.\nThe parent resource name, which should be a scan resource name in the\nformat 'projects/{projectId}/scanConfigs/{scanConfigId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+parent}/scanRuns",
- // "response": {
- // "$ref": "ListScanRunsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *ProjectsScanConfigsScanRunsListCall) Pages(ctx context.Context, f func(*ListScanRunsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.stop":
-
- type ProjectsScanConfigsScanRunsStopCall struct {
- s *Service
- name string
- stopscanrunrequest *StopScanRunRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Stop: Stops a ScanRun. The stopped ScanRun is returned.
- func (r *ProjectsScanConfigsScanRunsService) Stop(name string, stopscanrunrequest *StopScanRunRequest) *ProjectsScanConfigsScanRunsStopCall {
- c := &ProjectsScanConfigsScanRunsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- c.stopscanrunrequest = stopscanrunrequest
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsStopCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsStopCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsStopCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsStopCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:stop")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.stop" call.
- // Exactly one of *ScanRun or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *ScanRun.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *ProjectsScanConfigsScanRunsStopCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ScanRun{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Stops a ScanRun. The stopped ScanRun is returned.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns/{scanRunsId}:stop",
- // "httpMethod": "POST",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.stop",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "Required.\nThe resource name of the ScanRun to be stopped. The name follows the\nformat of\n'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}:stop",
- // "request": {
- // "$ref": "StopScanRunRequest"
- // },
- // "response": {
- // "$ref": "ScanRun"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list":
-
- type ProjectsScanConfigsScanRunsCrawledUrlsListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: List CrawledUrls under a given ScanRun.
- func (r *ProjectsScanConfigsScanRunsCrawledUrlsService) List(parent string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
- c := &ProjectsScanConfigsScanRunsCrawledUrlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of CrawledUrls to return, can be limited by server.
- // If not specified or not positive, the implementation will select
- // a
- // reasonable value.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results to be returned. This should be
- // a
- // `next_page_token` value returned from a previous List request.
- // If unspecified, the first page of results is returned.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/crawledUrls")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list" call.
- // Exactly one of *ListCrawledUrlsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListCrawledUrlsResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Do(opts ...googleapi.CallOption) (*ListCrawledUrlsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListCrawledUrlsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "List CrawledUrls under a given ScanRun.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns/{scanRunsId}/crawledUrls",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "The maximum number of CrawledUrls to return, can be limited by server.\nIf not specified or not positive, the implementation will select a\nreasonable value.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results to be returned. This should be a\n`next_page_token` value returned from a previous List request.\nIf unspecified, the first page of results is returned.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "Required.\nThe parent resource name, which should be a scan run resource name in the\nformat\n'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+parent}/crawledUrls",
- // "response": {
- // "$ref": "ListCrawledUrlsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Pages(ctx context.Context, f func(*ListCrawledUrlsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list":
-
- type ProjectsScanConfigsScanRunsFindingTypeStatsListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: List all FindingTypeStats under a given ScanRun.
- func (r *ProjectsScanConfigsScanRunsFindingTypeStatsService) List(parent string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
- c := &ProjectsScanConfigsScanRunsFindingTypeStatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/findingTypeStats")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list" call.
- // Exactly one of *ListFindingTypeStatsResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *ListFindingTypeStatsResponse.ServerResponse.Header or (if a
- // response was returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Do(opts ...googleapi.CallOption) (*ListFindingTypeStatsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListFindingTypeStatsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "List all FindingTypeStats under a given ScanRun.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns/{scanRunsId}/findingTypeStats",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "parent": {
- // "description": "Required.\nThe parent resource name, which should be a scan run resource name in the\nformat\n'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+parent}/findingTypeStats",
- // "response": {
- // "$ref": "ListFindingTypeStatsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.findings.get":
-
- type ProjectsScanConfigsScanRunsFindingsGetCall struct {
- s *Service
- name string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets a Finding.
- func (r *ProjectsScanConfigsScanRunsFindingsService) Get(name string) *ProjectsScanConfigsScanRunsFindingsGetCall {
- c := &ProjectsScanConfigsScanRunsFindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.name = name
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsScanRunsFindingsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "name": c.name,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findings.get" call.
- // Exactly one of *Finding or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Finding.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Do(opts ...googleapi.CallOption) (*Finding, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Finding{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets a Finding.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns/{scanRunsId}/findings/{findingsId}",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.findings.get",
- // "parameterOrder": [
- // "name"
- // ],
- // "parameters": {
- // "name": {
- // "description": "Required.\nThe resource name of the Finding to be returned. The name follows the\nformat of\n'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/findings/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+name}",
- // "response": {
- // "$ref": "Finding"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "websecurityscanner.projects.scanConfigs.scanRuns.findings.list":
-
- type ProjectsScanConfigsScanRunsFindingsListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: List Findings under a given ScanRun.
- func (r *ProjectsScanConfigsScanRunsFindingsService) List(parent string) *ProjectsScanConfigsScanRunsFindingsListCall {
- c := &ProjectsScanConfigsScanRunsFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
- }
-
- // Filter sets the optional parameter "filter": The filter expression.
- // The expression must be in the format: <field>
- // <operator> <value>.
- // Supported field: 'finding_type'.
- // Supported operator: '='.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) Filter(filter string) *ProjectsScanConfigsScanRunsFindingsListCall {
- c.urlParams_.Set("filter", filter)
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of Findings to return, can be limited by server.
- // If not specified or not positive, the implementation will select
- // a
- // reasonable value.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsFindingsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results to be returned. This should be
- // a
- // `next_page_token` value returned from a previous List request.
- // If unspecified, the first page of results is returned.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsFindingsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/findings")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findings.list" call.
- // Exactly one of *ListFindingsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListFindingsResponse.ServerResponse.Header or (if a response was
- // returned at all) in error.(*googleapi.Error).Header. Use
- // googleapi.IsNotModified to check whether the returned error was
- // because http.StatusNotModified was returned.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListFindingsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "List Findings under a given ScanRun.",
- // "flatPath": "v1alpha/projects/{projectsId}/scanConfigs/{scanConfigsId}/scanRuns/{scanRunsId}/findings",
- // "httpMethod": "GET",
- // "id": "websecurityscanner.projects.scanConfigs.scanRuns.findings.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "The filter expression. The expression must be in the format: \u003cfield\u003e\n\u003coperator\u003e \u003cvalue\u003e.\nSupported field: 'finding_type'.\nSupported operator: '='.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageSize": {
- // "description": "The maximum number of Findings to return, can be limited by server.\nIf not specified or not positive, the implementation will select a\nreasonable value.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results to be returned. This should be a\n`next_page_token` value returned from a previous List request.\nIf unspecified, the first page of results is returned.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "Required.\nThe parent resource name, which should be a scan run resource name in the\nformat\n'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1alpha/{+parent}/findings",
- // "response": {
- // "$ref": "ListFindingsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *ProjectsScanConfigsScanRunsFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
|