...

Source file src/google.golang.org/api/websecurityscanner/v1alpha/websecurityscanner-gen.go

Documentation: google.golang.org/api/websecurityscanner/v1alpha

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package websecurityscanner provides access to the Web Security Scanner API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/websecurityscanner/v1alpha"
    27  //	...
    28  //	ctx := context.Background()
    29  //	websecurityscannerService, err := websecurityscanner.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	websecurityscannerService, err := websecurityscanner.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	websecurityscannerService, err := websecurityscanner.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package websecurityscanner // import "google.golang.org/api/websecurityscanner/v1alpha"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "websecurityscanner:v1alpha"
    90  const apiName = "websecurityscanner"
    91  const apiVersion = "v1alpha"
    92  const basePath = "https://websecurityscanner.googleapis.com/"
    93  const basePathTemplate = "https://websecurityscanner.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://websecurityscanner.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Projects = NewProjectsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	Projects *ProjectsService
   148  }
   149  
   150  func (s *Service) userAgent() string {
   151  	if s.UserAgent == "" {
   152  		return googleapi.UserAgent
   153  	}
   154  	return googleapi.UserAgent + " " + s.UserAgent
   155  }
   156  
   157  func NewProjectsService(s *Service) *ProjectsService {
   158  	rs := &ProjectsService{s: s}
   159  	rs.ScanConfigs = NewProjectsScanConfigsService(s)
   160  	return rs
   161  }
   162  
   163  type ProjectsService struct {
   164  	s *Service
   165  
   166  	ScanConfigs *ProjectsScanConfigsService
   167  }
   168  
   169  func NewProjectsScanConfigsService(s *Service) *ProjectsScanConfigsService {
   170  	rs := &ProjectsScanConfigsService{s: s}
   171  	rs.ScanRuns = NewProjectsScanConfigsScanRunsService(s)
   172  	return rs
   173  }
   174  
   175  type ProjectsScanConfigsService struct {
   176  	s *Service
   177  
   178  	ScanRuns *ProjectsScanConfigsScanRunsService
   179  }
   180  
   181  func NewProjectsScanConfigsScanRunsService(s *Service) *ProjectsScanConfigsScanRunsService {
   182  	rs := &ProjectsScanConfigsScanRunsService{s: s}
   183  	rs.CrawledUrls = NewProjectsScanConfigsScanRunsCrawledUrlsService(s)
   184  	rs.FindingTypeStats = NewProjectsScanConfigsScanRunsFindingTypeStatsService(s)
   185  	rs.Findings = NewProjectsScanConfigsScanRunsFindingsService(s)
   186  	return rs
   187  }
   188  
   189  type ProjectsScanConfigsScanRunsService struct {
   190  	s *Service
   191  
   192  	CrawledUrls *ProjectsScanConfigsScanRunsCrawledUrlsService
   193  
   194  	FindingTypeStats *ProjectsScanConfigsScanRunsFindingTypeStatsService
   195  
   196  	Findings *ProjectsScanConfigsScanRunsFindingsService
   197  }
   198  
   199  func NewProjectsScanConfigsScanRunsCrawledUrlsService(s *Service) *ProjectsScanConfigsScanRunsCrawledUrlsService {
   200  	rs := &ProjectsScanConfigsScanRunsCrawledUrlsService{s: s}
   201  	return rs
   202  }
   203  
   204  type ProjectsScanConfigsScanRunsCrawledUrlsService struct {
   205  	s *Service
   206  }
   207  
   208  func NewProjectsScanConfigsScanRunsFindingTypeStatsService(s *Service) *ProjectsScanConfigsScanRunsFindingTypeStatsService {
   209  	rs := &ProjectsScanConfigsScanRunsFindingTypeStatsService{s: s}
   210  	return rs
   211  }
   212  
   213  type ProjectsScanConfigsScanRunsFindingTypeStatsService struct {
   214  	s *Service
   215  }
   216  
   217  func NewProjectsScanConfigsScanRunsFindingsService(s *Service) *ProjectsScanConfigsScanRunsFindingsService {
   218  	rs := &ProjectsScanConfigsScanRunsFindingsService{s: s}
   219  	return rs
   220  }
   221  
   222  type ProjectsScanConfigsScanRunsFindingsService struct {
   223  	s *Service
   224  }
   225  
   226  // Authentication: Scan authentication configuration.
   227  type Authentication struct {
   228  	// CustomAccount: Authentication using a custom account.
   229  	CustomAccount *CustomAccount `json:"customAccount,omitempty"`
   230  	// GoogleAccount: Authentication using a Google account.
   231  	GoogleAccount *GoogleAccount `json:"googleAccount,omitempty"`
   232  	// ForceSendFields is a list of field names (e.g. "CustomAccount") to
   233  	// unconditionally include in API requests. By default, fields with empty or
   234  	// default values are omitted from API requests. See
   235  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   236  	// details.
   237  	ForceSendFields []string `json:"-"`
   238  	// NullFields is a list of field names (e.g. "CustomAccount") to include in API
   239  	// requests with the JSON null value. By default, fields with empty values are
   240  	// omitted from API requests. See
   241  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   242  	NullFields []string `json:"-"`
   243  }
   244  
   245  func (s *Authentication) MarshalJSON() ([]byte, error) {
   246  	type NoMethod Authentication
   247  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   248  }
   249  
   250  // CrawledUrl: A CrawledUrl resource represents a URL that was crawled during a
   251  // ScanRun. Web Security Scanner Service crawls the web applications, following
   252  // all links within the scope of sites, to find the URLs to test against.
   253  type CrawledUrl struct {
   254  	// Body: Output only. The body of the request that was used to visit the URL.
   255  	Body string `json:"body,omitempty"`
   256  	// HttpMethod: Output only. The http method of the request that was used to
   257  	// visit the URL, in uppercase.
   258  	HttpMethod string `json:"httpMethod,omitempty"`
   259  	// Url: Output only. The URL that was crawled.
   260  	Url string `json:"url,omitempty"`
   261  	// ForceSendFields is a list of field names (e.g. "Body") to unconditionally
   262  	// include in API requests. By default, fields with empty or default values are
   263  	// omitted from API requests. See
   264  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   265  	// details.
   266  	ForceSendFields []string `json:"-"`
   267  	// NullFields is a list of field names (e.g. "Body") to include in API requests
   268  	// with the JSON null value. By default, fields with empty values are omitted
   269  	// from API requests. See
   270  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   271  	NullFields []string `json:"-"`
   272  }
   273  
   274  func (s *CrawledUrl) MarshalJSON() ([]byte, error) {
   275  	type NoMethod CrawledUrl
   276  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   277  }
   278  
   279  // CustomAccount: Describes authentication configuration that uses a custom
   280  // account.
   281  type CustomAccount struct {
   282  	// LoginUrl: Required. The login form URL of the website.
   283  	LoginUrl string `json:"loginUrl,omitempty"`
   284  	// Password: Required. Input only. The password of the custom account. The
   285  	// credential is stored encrypted and not returned in any response nor included
   286  	// in audit logs.
   287  	Password string `json:"password,omitempty"`
   288  	// Username: Required. The user name of the custom account.
   289  	Username string `json:"username,omitempty"`
   290  	// ForceSendFields is a list of field names (e.g. "LoginUrl") to
   291  	// unconditionally include in API requests. By default, fields with empty or
   292  	// default values are omitted from API requests. See
   293  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   294  	// details.
   295  	ForceSendFields []string `json:"-"`
   296  	// NullFields is a list of field names (e.g. "LoginUrl") to include in API
   297  	// requests with the JSON null value. By default, fields with empty values are
   298  	// omitted from API requests. See
   299  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   300  	NullFields []string `json:"-"`
   301  }
   302  
   303  func (s *CustomAccount) MarshalJSON() ([]byte, error) {
   304  	type NoMethod CustomAccount
   305  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   306  }
   307  
   308  // Empty: A generic empty message that you can re-use to avoid defining
   309  // duplicated empty messages in your APIs. A typical example is to use it as
   310  // the request or the response type of an API method. For instance: service Foo
   311  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   312  type Empty struct {
   313  	// ServerResponse contains the HTTP response code and headers from the server.
   314  	googleapi.ServerResponse `json:"-"`
   315  }
   316  
   317  // Finding: A Finding resource represents a vulnerability instance identified
   318  // during a ScanRun.
   319  type Finding struct {
   320  	// Body: The body of the request that triggered the vulnerability.
   321  	Body string `json:"body,omitempty"`
   322  	// Description: The description of the vulnerability.
   323  	Description string `json:"description,omitempty"`
   324  	// FinalUrl: The URL where the browser lands when the vulnerability is
   325  	// detected.
   326  	FinalUrl string `json:"finalUrl,omitempty"`
   327  	// FindingType: The type of the Finding.
   328  	//
   329  	// Possible values:
   330  	//   "FINDING_TYPE_UNSPECIFIED" - The invalid finding type.
   331  	//   "MIXED_CONTENT" - A page that was served over HTTPS also resources over
   332  	// HTTP. A man-in-the-middle attacker could tamper with the HTTP resource and
   333  	// gain full access to the website that loads the resource or to monitor the
   334  	// actions taken by the user.
   335  	//   "OUTDATED_LIBRARY" - The version of an included library is known to
   336  	// contain a security issue. The scanner checks the version of library in use
   337  	// against a known list of vulnerable libraries. False positives are possible
   338  	// if the version detection fails or if the library has been manually patched.
   339  	//   "ROSETTA_FLASH" - This type of vulnerability occurs when the value of a
   340  	// request parameter is reflected at the beginning of the response, for
   341  	// example, in requests using JSONP. Under certain circumstances, an attacker
   342  	// may be able to supply an alphanumeric-only Flash file in the vulnerable
   343  	// parameter causing the browser to execute the Flash file as if it originated
   344  	// on the vulnerable server.
   345  	//   "XSS_CALLBACK" - A cross-site scripting (XSS) bug is found via JavaScript
   346  	// callback. For detailed explanations on XSS, see
   347  	// https://www.google.com/about/appsecurity/learning/xss/.
   348  	//   "XSS_ERROR" - A potential cross-site scripting (XSS) bug due to JavaScript
   349  	// breakage. In some circumstances, the application under test might modify the
   350  	// test string before it is parsed by the browser. When the browser attempts to
   351  	// runs this modified test string, it will likely break and throw a JavaScript
   352  	// execution error, thus an injection issue is occurring. However, it may not
   353  	// be exploitable. Manual verification is needed to see if the test string
   354  	// modifications can be evaded and confirm that the issue is in fact an XSS
   355  	// vulnerability. For detailed explanations on XSS, see
   356  	// https://www.google.com/about/appsecurity/learning/xss/.
   357  	//   "CLEAR_TEXT_PASSWORD" - An application appears to be transmitting a
   358  	// password field in clear text. An attacker can eavesdrop network traffic and
   359  	// sniff the password field.
   360  	//   "INVALID_CONTENT_TYPE" - An application returns sensitive content with an
   361  	// invalid content type, or without an 'X-Content-Type-Options: nosniff'
   362  	// header.
   363  	//   "XSS_ANGULAR_CALLBACK" - A cross-site scripting (XSS) vulnerability in
   364  	// AngularJS module that occurs when a user-provided string is interpolated by
   365  	// Angular.
   366  	//   "INVALID_HEADER" - A malformed or invalid valued header.
   367  	//   "MISSPELLED_SECURITY_HEADER_NAME" - Misspelled security header name.
   368  	//   "MISMATCHING_SECURITY_HEADER_VALUES" - Mismatching values in a duplicate
   369  	// security header.
   370  	//   "ACCESSIBLE_GIT_REPOSITORY" - A world-readable git repository that
   371  	// potentially leaks source code, commit history or sensitive information such
   372  	// as credentials.
   373  	//   "ACCESSIBLE_SVN_REPOSITORY" - A world-readable subversion repository that
   374  	// potentially leaks source code, commit history or sensitive information such
   375  	// as credentials.
   376  	//   "ACCESSIBLE_ENV_FILE" - A world-readable env file that potentially leaks
   377  	// source code, commit history or sensitive information such as credentials.
   378  	FindingType string `json:"findingType,omitempty"`
   379  	// FrameUrl: If the vulnerability was originated from nested IFrame, the
   380  	// immediate parent IFrame is reported.
   381  	FrameUrl string `json:"frameUrl,omitempty"`
   382  	// FuzzedUrl: The URL produced by the server-side fuzzer and used in the
   383  	// request that triggered the vulnerability.
   384  	FuzzedUrl string `json:"fuzzedUrl,omitempty"`
   385  	// HttpMethod: The http method of the request that triggered the vulnerability,
   386  	// in uppercase.
   387  	HttpMethod string `json:"httpMethod,omitempty"`
   388  	// Name: The resource name of the Finding. The name follows the format of
   389  	// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/finding
   390  	// s/{findingId}'. The finding IDs are generated by the system.
   391  	Name string `json:"name,omitempty"`
   392  	// OutdatedLibrary: An addon containing information about outdated libraries.
   393  	OutdatedLibrary *OutdatedLibrary `json:"outdatedLibrary,omitempty"`
   394  	// ReproductionUrl: The URL containing human-readable payload that user can
   395  	// leverage to reproduce the vulnerability.
   396  	ReproductionUrl string `json:"reproductionUrl,omitempty"`
   397  	// TrackingId: The tracking ID uniquely identifies a vulnerability instance
   398  	// across multiple ScanRuns.
   399  	TrackingId string `json:"trackingId,omitempty"`
   400  	// ViolatingResource: An addon containing detailed information regarding any
   401  	// resource causing the vulnerability such as JavaScript sources, image, audio
   402  	// files, etc.
   403  	ViolatingResource *ViolatingResource `json:"violatingResource,omitempty"`
   404  	// VulnerableHeaders: An addon containing information about vulnerable or
   405  	// missing HTTP headers.
   406  	VulnerableHeaders *VulnerableHeaders `json:"vulnerableHeaders,omitempty"`
   407  	// VulnerableParameters: An addon containing information about request
   408  	// parameters which were found to be vulnerable.
   409  	VulnerableParameters *VulnerableParameters `json:"vulnerableParameters,omitempty"`
   410  	// Xss: An addon containing information reported for an XSS, if any.
   411  	Xss *Xss `json:"xss,omitempty"`
   412  
   413  	// ServerResponse contains the HTTP response code and headers from the server.
   414  	googleapi.ServerResponse `json:"-"`
   415  	// ForceSendFields is a list of field names (e.g. "Body") to unconditionally
   416  	// include in API requests. By default, fields with empty or default values are
   417  	// omitted from API requests. See
   418  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   419  	// details.
   420  	ForceSendFields []string `json:"-"`
   421  	// NullFields is a list of field names (e.g. "Body") to include in API requests
   422  	// with the JSON null value. By default, fields with empty values are omitted
   423  	// from API requests. See
   424  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   425  	NullFields []string `json:"-"`
   426  }
   427  
   428  func (s *Finding) MarshalJSON() ([]byte, error) {
   429  	type NoMethod Finding
   430  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   431  }
   432  
   433  // FindingTypeStats: A FindingTypeStats resource represents stats regarding a
   434  // specific FindingType of Findings under a given ScanRun.
   435  type FindingTypeStats struct {
   436  	// FindingCount: The count of findings belonging to this finding type.
   437  	FindingCount int64 `json:"findingCount,omitempty"`
   438  	// FindingType: The finding type associated with the stats.
   439  	//
   440  	// Possible values:
   441  	//   "FINDING_TYPE_UNSPECIFIED" - The invalid finding type.
   442  	//   "MIXED_CONTENT" - A page that was served over HTTPS also resources over
   443  	// HTTP. A man-in-the-middle attacker could tamper with the HTTP resource and
   444  	// gain full access to the website that loads the resource or to monitor the
   445  	// actions taken by the user.
   446  	//   "OUTDATED_LIBRARY" - The version of an included library is known to
   447  	// contain a security issue. The scanner checks the version of library in use
   448  	// against a known list of vulnerable libraries. False positives are possible
   449  	// if the version detection fails or if the library has been manually patched.
   450  	//   "ROSETTA_FLASH" - This type of vulnerability occurs when the value of a
   451  	// request parameter is reflected at the beginning of the response, for
   452  	// example, in requests using JSONP. Under certain circumstances, an attacker
   453  	// may be able to supply an alphanumeric-only Flash file in the vulnerable
   454  	// parameter causing the browser to execute the Flash file as if it originated
   455  	// on the vulnerable server.
   456  	//   "XSS_CALLBACK" - A cross-site scripting (XSS) bug is found via JavaScript
   457  	// callback. For detailed explanations on XSS, see
   458  	// https://www.google.com/about/appsecurity/learning/xss/.
   459  	//   "XSS_ERROR" - A potential cross-site scripting (XSS) bug due to JavaScript
   460  	// breakage. In some circumstances, the application under test might modify the
   461  	// test string before it is parsed by the browser. When the browser attempts to
   462  	// runs this modified test string, it will likely break and throw a JavaScript
   463  	// execution error, thus an injection issue is occurring. However, it may not
   464  	// be exploitable. Manual verification is needed to see if the test string
   465  	// modifications can be evaded and confirm that the issue is in fact an XSS
   466  	// vulnerability. For detailed explanations on XSS, see
   467  	// https://www.google.com/about/appsecurity/learning/xss/.
   468  	//   "CLEAR_TEXT_PASSWORD" - An application appears to be transmitting a
   469  	// password field in clear text. An attacker can eavesdrop network traffic and
   470  	// sniff the password field.
   471  	//   "INVALID_CONTENT_TYPE" - An application returns sensitive content with an
   472  	// invalid content type, or without an 'X-Content-Type-Options: nosniff'
   473  	// header.
   474  	//   "XSS_ANGULAR_CALLBACK" - A cross-site scripting (XSS) vulnerability in
   475  	// AngularJS module that occurs when a user-provided string is interpolated by
   476  	// Angular.
   477  	//   "INVALID_HEADER" - A malformed or invalid valued header.
   478  	//   "MISSPELLED_SECURITY_HEADER_NAME" - Misspelled security header name.
   479  	//   "MISMATCHING_SECURITY_HEADER_VALUES" - Mismatching values in a duplicate
   480  	// security header.
   481  	//   "ACCESSIBLE_GIT_REPOSITORY" - A world-readable git repository that
   482  	// potentially leaks source code, commit history or sensitive information such
   483  	// as credentials.
   484  	//   "ACCESSIBLE_SVN_REPOSITORY" - A world-readable subversion repository that
   485  	// potentially leaks source code, commit history or sensitive information such
   486  	// as credentials.
   487  	//   "ACCESSIBLE_ENV_FILE" - A world-readable env file that potentially leaks
   488  	// source code, commit history or sensitive information such as credentials.
   489  	FindingType string `json:"findingType,omitempty"`
   490  	// ForceSendFields is a list of field names (e.g. "FindingCount") to
   491  	// unconditionally include in API requests. By default, fields with empty or
   492  	// default values are omitted from API requests. See
   493  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   494  	// details.
   495  	ForceSendFields []string `json:"-"`
   496  	// NullFields is a list of field names (e.g. "FindingCount") to include in API
   497  	// requests with the JSON null value. By default, fields with empty values are
   498  	// omitted from API requests. See
   499  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   500  	NullFields []string `json:"-"`
   501  }
   502  
   503  func (s *FindingTypeStats) MarshalJSON() ([]byte, error) {
   504  	type NoMethod FindingTypeStats
   505  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   506  }
   507  
   508  // GoogleAccount: Describes authentication configuration that uses a Google
   509  // account.
   510  type GoogleAccount struct {
   511  	// Password: Required. Input only. The password of the Google account. The
   512  	// credential is stored encrypted and not returned in any response nor included
   513  	// in audit logs.
   514  	Password string `json:"password,omitempty"`
   515  	// Username: Required. The user name of the Google account.
   516  	Username string `json:"username,omitempty"`
   517  	// ForceSendFields is a list of field names (e.g. "Password") to
   518  	// unconditionally include in API requests. By default, fields with empty or
   519  	// default values are omitted from API requests. See
   520  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   521  	// details.
   522  	ForceSendFields []string `json:"-"`
   523  	// NullFields is a list of field names (e.g. "Password") to include in API
   524  	// requests with the JSON null value. By default, fields with empty values are
   525  	// omitted from API requests. See
   526  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   527  	NullFields []string `json:"-"`
   528  }
   529  
   530  func (s *GoogleAccount) MarshalJSON() ([]byte, error) {
   531  	type NoMethod GoogleAccount
   532  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   533  }
   534  
   535  // Header: Describes a HTTP Header.
   536  type Header struct {
   537  	// Name: Header name.
   538  	Name string `json:"name,omitempty"`
   539  	// Value: Header value.
   540  	Value string `json:"value,omitempty"`
   541  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   542  	// include in API requests. By default, fields with empty or default values are
   543  	// omitted from API requests. See
   544  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   545  	// details.
   546  	ForceSendFields []string `json:"-"`
   547  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   548  	// with the JSON null value. By default, fields with empty values are omitted
   549  	// from API requests. See
   550  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   551  	NullFields []string `json:"-"`
   552  }
   553  
   554  func (s *Header) MarshalJSON() ([]byte, error) {
   555  	type NoMethod Header
   556  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   557  }
   558  
   559  // ListCrawledUrlsResponse: Response for the `ListCrawledUrls` method.
   560  type ListCrawledUrlsResponse struct {
   561  	// CrawledUrls: The list of CrawledUrls returned.
   562  	CrawledUrls []*CrawledUrl `json:"crawledUrls,omitempty"`
   563  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   564  	// are no more results in the list.
   565  	NextPageToken string `json:"nextPageToken,omitempty"`
   566  
   567  	// ServerResponse contains the HTTP response code and headers from the server.
   568  	googleapi.ServerResponse `json:"-"`
   569  	// ForceSendFields is a list of field names (e.g. "CrawledUrls") to
   570  	// unconditionally include in API requests. By default, fields with empty or
   571  	// default values are omitted from API requests. See
   572  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   573  	// details.
   574  	ForceSendFields []string `json:"-"`
   575  	// NullFields is a list of field names (e.g. "CrawledUrls") to include in API
   576  	// requests with the JSON null value. By default, fields with empty values are
   577  	// omitted from API requests. See
   578  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   579  	NullFields []string `json:"-"`
   580  }
   581  
   582  func (s *ListCrawledUrlsResponse) MarshalJSON() ([]byte, error) {
   583  	type NoMethod ListCrawledUrlsResponse
   584  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   585  }
   586  
   587  // ListFindingTypeStatsResponse: Response for the `ListFindingTypeStats`
   588  // method.
   589  type ListFindingTypeStatsResponse struct {
   590  	// FindingTypeStats: The list of FindingTypeStats returned.
   591  	FindingTypeStats []*FindingTypeStats `json:"findingTypeStats,omitempty"`
   592  
   593  	// ServerResponse contains the HTTP response code and headers from the server.
   594  	googleapi.ServerResponse `json:"-"`
   595  	// ForceSendFields is a list of field names (e.g. "FindingTypeStats") to
   596  	// unconditionally include in API requests. By default, fields with empty or
   597  	// default values are omitted from API requests. See
   598  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   599  	// details.
   600  	ForceSendFields []string `json:"-"`
   601  	// NullFields is a list of field names (e.g. "FindingTypeStats") to include in
   602  	// API requests with the JSON null value. By default, fields with empty values
   603  	// are omitted from API requests. See
   604  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   605  	NullFields []string `json:"-"`
   606  }
   607  
   608  func (s *ListFindingTypeStatsResponse) MarshalJSON() ([]byte, error) {
   609  	type NoMethod ListFindingTypeStatsResponse
   610  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   611  }
   612  
   613  // ListFindingsResponse: Response for the `ListFindings` method.
   614  type ListFindingsResponse struct {
   615  	// Findings: The list of Findings returned.
   616  	Findings []*Finding `json:"findings,omitempty"`
   617  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   618  	// are no more results in the list.
   619  	NextPageToken string `json:"nextPageToken,omitempty"`
   620  
   621  	// ServerResponse contains the HTTP response code and headers from the server.
   622  	googleapi.ServerResponse `json:"-"`
   623  	// ForceSendFields is a list of field names (e.g. "Findings") to
   624  	// unconditionally include in API requests. By default, fields with empty or
   625  	// default values are omitted from API requests. See
   626  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   627  	// details.
   628  	ForceSendFields []string `json:"-"`
   629  	// NullFields is a list of field names (e.g. "Findings") to include in API
   630  	// requests with the JSON null value. By default, fields with empty values are
   631  	// omitted from API requests. See
   632  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   633  	NullFields []string `json:"-"`
   634  }
   635  
   636  func (s *ListFindingsResponse) MarshalJSON() ([]byte, error) {
   637  	type NoMethod ListFindingsResponse
   638  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   639  }
   640  
   641  // ListScanConfigsResponse: Response for the `ListScanConfigs` method.
   642  type ListScanConfigsResponse struct {
   643  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   644  	// are no more results in the list.
   645  	NextPageToken string `json:"nextPageToken,omitempty"`
   646  	// ScanConfigs: The list of ScanConfigs returned.
   647  	ScanConfigs []*ScanConfig `json:"scanConfigs,omitempty"`
   648  
   649  	// ServerResponse contains the HTTP response code and headers from the server.
   650  	googleapi.ServerResponse `json:"-"`
   651  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   652  	// unconditionally include in API requests. By default, fields with empty or
   653  	// default values are omitted from API requests. See
   654  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   655  	// details.
   656  	ForceSendFields []string `json:"-"`
   657  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   658  	// requests with the JSON null value. By default, fields with empty values are
   659  	// omitted from API requests. See
   660  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   661  	NullFields []string `json:"-"`
   662  }
   663  
   664  func (s *ListScanConfigsResponse) MarshalJSON() ([]byte, error) {
   665  	type NoMethod ListScanConfigsResponse
   666  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   667  }
   668  
   669  // ListScanRunsResponse: Response for the `ListScanRuns` method.
   670  type ListScanRunsResponse struct {
   671  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   672  	// are no more results in the list.
   673  	NextPageToken string `json:"nextPageToken,omitempty"`
   674  	// ScanRuns: The list of ScanRuns returned.
   675  	ScanRuns []*ScanRun `json:"scanRuns,omitempty"`
   676  
   677  	// ServerResponse contains the HTTP response code and headers from the server.
   678  	googleapi.ServerResponse `json:"-"`
   679  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   680  	// unconditionally include in API requests. By default, fields with empty or
   681  	// default values are omitted from API requests. See
   682  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   683  	// details.
   684  	ForceSendFields []string `json:"-"`
   685  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   686  	// requests with the JSON null value. By default, fields with empty values are
   687  	// omitted from API requests. See
   688  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   689  	NullFields []string `json:"-"`
   690  }
   691  
   692  func (s *ListScanRunsResponse) MarshalJSON() ([]byte, error) {
   693  	type NoMethod ListScanRunsResponse
   694  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   695  }
   696  
   697  // OutdatedLibrary: Information reported for an outdated library.
   698  type OutdatedLibrary struct {
   699  	// LearnMoreUrls: URLs to learn more information about the vulnerabilities in
   700  	// the library.
   701  	LearnMoreUrls []string `json:"learnMoreUrls,omitempty"`
   702  	// LibraryName: The name of the outdated library.
   703  	LibraryName string `json:"libraryName,omitempty"`
   704  	// Version: The version number.
   705  	Version string `json:"version,omitempty"`
   706  	// ForceSendFields is a list of field names (e.g. "LearnMoreUrls") to
   707  	// unconditionally include in API requests. By default, fields with empty or
   708  	// default values are omitted from API requests. See
   709  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   710  	// details.
   711  	ForceSendFields []string `json:"-"`
   712  	// NullFields is a list of field names (e.g. "LearnMoreUrls") to include in API
   713  	// requests with the JSON null value. By default, fields with empty values are
   714  	// omitted from API requests. See
   715  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   716  	NullFields []string `json:"-"`
   717  }
   718  
   719  func (s *OutdatedLibrary) MarshalJSON() ([]byte, error) {
   720  	type NoMethod OutdatedLibrary
   721  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   722  }
   723  
   724  // ScanConfig: A ScanConfig resource contains the configurations to launch a
   725  // scan. next id: 12
   726  type ScanConfig struct {
   727  	// Authentication: The authentication configuration. If specified, service will
   728  	// use the authentication configuration during scanning.
   729  	Authentication *Authentication `json:"authentication,omitempty"`
   730  	// BlacklistPatterns: The excluded URL patterns as described in
   731  	// https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
   732  	BlacklistPatterns []string `json:"blacklistPatterns,omitempty"`
   733  	// DisplayName: Required. The user provided display name of the ScanConfig.
   734  	DisplayName string `json:"displayName,omitempty"`
   735  	// LatestRun: Latest ScanRun if available.
   736  	LatestRun *ScanRun `json:"latestRun,omitempty"`
   737  	// MaxQps: The maximum QPS during scanning. A valid value ranges from 5 to 20
   738  	// inclusively. If the field is unspecified or its value is set 0, server will
   739  	// default to 15. Other values outside of [5, 20] range will be rejected with
   740  	// INVALID_ARGUMENT error.
   741  	MaxQps int64 `json:"maxQps,omitempty"`
   742  	// Name: The resource name of the ScanConfig. The name follows the format of
   743  	// 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
   744  	// generated by the system.
   745  	Name string `json:"name,omitempty"`
   746  	// Schedule: The schedule of the ScanConfig.
   747  	Schedule *Schedule `json:"schedule,omitempty"`
   748  	// StartingUrls: Required. The starting URLs from which the scanner finds site
   749  	// pages.
   750  	StartingUrls []string `json:"startingUrls,omitempty"`
   751  	// TargetPlatforms: Set of Google Cloud platforms targeted by the scan. If
   752  	// empty, APP_ENGINE will be used as a default.
   753  	//
   754  	// Possible values:
   755  	//   "TARGET_PLATFORM_UNSPECIFIED" - The target platform is unknown. Requests
   756  	// with this enum value will be rejected with INVALID_ARGUMENT error.
   757  	//   "APP_ENGINE" - Google App Engine service.
   758  	//   "COMPUTE" - Google Compute Engine service.
   759  	//   "CLOUD_RUN" - Google Cloud Run service.
   760  	//   "CLOUD_FUNCTIONS" - Google Cloud Function service.
   761  	TargetPlatforms []string `json:"targetPlatforms,omitempty"`
   762  	// UserAgent: The user agent used during scanning.
   763  	//
   764  	// Possible values:
   765  	//   "USER_AGENT_UNSPECIFIED" - The user agent is unknown. Service will default
   766  	// to CHROME_LINUX.
   767  	//   "CHROME_LINUX" - Chrome on Linux. This is the service default if
   768  	// unspecified.
   769  	//   "CHROME_ANDROID" - Chrome on Android.
   770  	//   "SAFARI_IPHONE" - Safari on IPhone.
   771  	UserAgent string `json:"userAgent,omitempty"`
   772  
   773  	// ServerResponse contains the HTTP response code and headers from the server.
   774  	googleapi.ServerResponse `json:"-"`
   775  	// ForceSendFields is a list of field names (e.g. "Authentication") to
   776  	// unconditionally include in API requests. By default, fields with empty or
   777  	// default values are omitted from API requests. See
   778  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   779  	// details.
   780  	ForceSendFields []string `json:"-"`
   781  	// NullFields is a list of field names (e.g. "Authentication") to include in
   782  	// API requests with the JSON null value. By default, fields with empty values
   783  	// are omitted from API requests. See
   784  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   785  	NullFields []string `json:"-"`
   786  }
   787  
   788  func (s *ScanConfig) MarshalJSON() ([]byte, error) {
   789  	type NoMethod ScanConfig
   790  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   791  }
   792  
   793  // ScanRun: A ScanRun is a output-only resource representing an actual run of
   794  // the scan.
   795  type ScanRun struct {
   796  	// EndTime: The time at which the ScanRun reached termination state - that the
   797  	// ScanRun is either finished or stopped by user.
   798  	EndTime string `json:"endTime,omitempty"`
   799  	// ExecutionState: The execution state of the ScanRun.
   800  	//
   801  	// Possible values:
   802  	//   "EXECUTION_STATE_UNSPECIFIED" - Represents an invalid state caused by
   803  	// internal server error. This value should never be returned.
   804  	//   "QUEUED" - The scan is waiting in the queue.
   805  	//   "SCANNING" - The scan is in progress.
   806  	//   "FINISHED" - The scan is either finished or stopped by user.
   807  	ExecutionState string `json:"executionState,omitempty"`
   808  	// HasVulnerabilities: Whether the scan run has found any vulnerabilities.
   809  	HasVulnerabilities bool `json:"hasVulnerabilities,omitempty"`
   810  	// Name: The resource name of the ScanRun. The name follows the format of
   811  	// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. The
   812  	// ScanRun IDs are generated by the system.
   813  	Name string `json:"name,omitempty"`
   814  	// ProgressPercent: The percentage of total completion ranging from 0 to 100.
   815  	// If the scan is in queue, the value is 0. If the scan is running, the value
   816  	// ranges from 0 to 100. If the scan is finished, the value is 100.
   817  	ProgressPercent int64 `json:"progressPercent,omitempty"`
   818  	// ResultState: The result state of the ScanRun. This field is only available
   819  	// after the execution state reaches "FINISHED".
   820  	//
   821  	// Possible values:
   822  	//   "RESULT_STATE_UNSPECIFIED" - Default value. This value is returned when
   823  	// the ScanRun is not yet finished.
   824  	//   "SUCCESS" - The scan finished without errors.
   825  	//   "ERROR" - The scan finished with errors.
   826  	//   "KILLED" - The scan was terminated by user.
   827  	ResultState string `json:"resultState,omitempty"`
   828  	// StartTime: The time at which the ScanRun started.
   829  	StartTime string `json:"startTime,omitempty"`
   830  	// UrlsCrawledCount: The number of URLs crawled during this ScanRun. If the
   831  	// scan is in progress, the value represents the number of URLs crawled up to
   832  	// now.
   833  	UrlsCrawledCount int64 `json:"urlsCrawledCount,omitempty,string"`
   834  	// UrlsTestedCount: The number of URLs tested during this ScanRun. If the scan
   835  	// is in progress, the value represents the number of URLs tested up to now.
   836  	// The number of URLs tested is usually larger than the number URLS crawled
   837  	// because typically a crawled URL is tested with multiple test payloads.
   838  	UrlsTestedCount int64 `json:"urlsTestedCount,omitempty,string"`
   839  
   840  	// ServerResponse contains the HTTP response code and headers from the server.
   841  	googleapi.ServerResponse `json:"-"`
   842  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   843  	// include in API requests. By default, fields with empty or default values are
   844  	// omitted from API requests. See
   845  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   846  	// details.
   847  	ForceSendFields []string `json:"-"`
   848  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   849  	// requests with the JSON null value. By default, fields with empty values are
   850  	// omitted from API requests. See
   851  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   852  	NullFields []string `json:"-"`
   853  }
   854  
   855  func (s *ScanRun) MarshalJSON() ([]byte, error) {
   856  	type NoMethod ScanRun
   857  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   858  }
   859  
   860  // Schedule: Scan schedule configuration.
   861  type Schedule struct {
   862  	// IntervalDurationDays: Required. The duration of time between executions in
   863  	// days.
   864  	IntervalDurationDays int64 `json:"intervalDurationDays,omitempty"`
   865  	// ScheduleTime: A timestamp indicates when the next run will be scheduled. The
   866  	// value is refreshed by the server after each run. If unspecified, it will
   867  	// default to current server time, which means the scan will be scheduled to
   868  	// start immediately.
   869  	ScheduleTime string `json:"scheduleTime,omitempty"`
   870  	// ForceSendFields is a list of field names (e.g. "IntervalDurationDays") to
   871  	// unconditionally include in API requests. By default, fields with empty or
   872  	// default values are omitted from API requests. See
   873  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   874  	// details.
   875  	ForceSendFields []string `json:"-"`
   876  	// NullFields is a list of field names (e.g. "IntervalDurationDays") to include
   877  	// in API requests with the JSON null value. By default, fields with empty
   878  	// values are omitted from API requests. See
   879  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   880  	NullFields []string `json:"-"`
   881  }
   882  
   883  func (s *Schedule) MarshalJSON() ([]byte, error) {
   884  	type NoMethod Schedule
   885  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   886  }
   887  
   888  // StartScanRunRequest: Request for the `StartScanRun` method.
   889  type StartScanRunRequest struct {
   890  }
   891  
   892  // StopScanRunRequest: Request for the `StopScanRun` method.
   893  type StopScanRunRequest struct {
   894  }
   895  
   896  // ViolatingResource: Information regarding any resource causing the
   897  // vulnerability such as JavaScript sources, image, audio files, etc.
   898  type ViolatingResource struct {
   899  	// ContentType: The MIME type of this resource.
   900  	ContentType string `json:"contentType,omitempty"`
   901  	// ResourceUrl: URL of this violating resource.
   902  	ResourceUrl string `json:"resourceUrl,omitempty"`
   903  	// ForceSendFields is a list of field names (e.g. "ContentType") to
   904  	// unconditionally include in API requests. By default, fields with empty or
   905  	// default values are omitted from API requests. See
   906  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   907  	// details.
   908  	ForceSendFields []string `json:"-"`
   909  	// NullFields is a list of field names (e.g. "ContentType") to include in API
   910  	// requests with the JSON null value. By default, fields with empty values are
   911  	// omitted from API requests. See
   912  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   913  	NullFields []string `json:"-"`
   914  }
   915  
   916  func (s *ViolatingResource) MarshalJSON() ([]byte, error) {
   917  	type NoMethod ViolatingResource
   918  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   919  }
   920  
   921  // VulnerableHeaders: Information about vulnerable or missing HTTP Headers.
   922  type VulnerableHeaders struct {
   923  	// Headers: List of vulnerable headers.
   924  	Headers []*Header `json:"headers,omitempty"`
   925  	// MissingHeaders: List of missing headers.
   926  	MissingHeaders []*Header `json:"missingHeaders,omitempty"`
   927  	// ForceSendFields is a list of field names (e.g. "Headers") to unconditionally
   928  	// include in API requests. By default, fields with empty or default values are
   929  	// omitted from API requests. See
   930  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   931  	// details.
   932  	ForceSendFields []string `json:"-"`
   933  	// NullFields is a list of field names (e.g. "Headers") to include in API
   934  	// requests with the JSON null value. By default, fields with empty values are
   935  	// omitted from API requests. See
   936  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   937  	NullFields []string `json:"-"`
   938  }
   939  
   940  func (s *VulnerableHeaders) MarshalJSON() ([]byte, error) {
   941  	type NoMethod VulnerableHeaders
   942  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   943  }
   944  
   945  // VulnerableParameters: Information about vulnerable request parameters.
   946  type VulnerableParameters struct {
   947  	// ParameterNames: The vulnerable parameter names.
   948  	ParameterNames []string `json:"parameterNames,omitempty"`
   949  	// ForceSendFields is a list of field names (e.g. "ParameterNames") to
   950  	// unconditionally include in API requests. By default, fields with empty or
   951  	// default values are omitted from API requests. See
   952  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   953  	// details.
   954  	ForceSendFields []string `json:"-"`
   955  	// NullFields is a list of field names (e.g. "ParameterNames") to include in
   956  	// API requests with the JSON null value. By default, fields with empty values
   957  	// are omitted from API requests. See
   958  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   959  	NullFields []string `json:"-"`
   960  }
   961  
   962  func (s *VulnerableParameters) MarshalJSON() ([]byte, error) {
   963  	type NoMethod VulnerableParameters
   964  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   965  }
   966  
   967  // Xss: Information reported for an XSS.
   968  type Xss struct {
   969  	// ErrorMessage: An error message generated by a javascript breakage.
   970  	ErrorMessage string `json:"errorMessage,omitempty"`
   971  	// StackTraces: Stack traces leading to the point where the XSS occurred.
   972  	StackTraces []string `json:"stackTraces,omitempty"`
   973  	// ForceSendFields is a list of field names (e.g. "ErrorMessage") to
   974  	// unconditionally include in API requests. By default, fields with empty or
   975  	// default values are omitted from API requests. See
   976  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   977  	// details.
   978  	ForceSendFields []string `json:"-"`
   979  	// NullFields is a list of field names (e.g. "ErrorMessage") to include in API
   980  	// requests with the JSON null value. By default, fields with empty values are
   981  	// omitted from API requests. See
   982  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   983  	NullFields []string `json:"-"`
   984  }
   985  
   986  func (s *Xss) MarshalJSON() ([]byte, error) {
   987  	type NoMethod Xss
   988  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   989  }
   990  
   991  type ProjectsScanConfigsCreateCall struct {
   992  	s          *Service
   993  	parent     string
   994  	scanconfig *ScanConfig
   995  	urlParams_ gensupport.URLParams
   996  	ctx_       context.Context
   997  	header_    http.Header
   998  }
   999  
  1000  // Create: Creates a new ScanConfig.
  1001  //
  1002  //   - parent: The parent resource name where the scan is created, which should
  1003  //     be a project resource name in the format 'projects/{projectId}'.
  1004  func (r *ProjectsScanConfigsService) Create(parent string, scanconfig *ScanConfig) *ProjectsScanConfigsCreateCall {
  1005  	c := &ProjectsScanConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1006  	c.parent = parent
  1007  	c.scanconfig = scanconfig
  1008  	return c
  1009  }
  1010  
  1011  // Fields allows partial responses to be retrieved. See
  1012  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1013  // details.
  1014  func (c *ProjectsScanConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsCreateCall {
  1015  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1016  	return c
  1017  }
  1018  
  1019  // Context sets the context to be used in this call's Do method.
  1020  func (c *ProjectsScanConfigsCreateCall) Context(ctx context.Context) *ProjectsScanConfigsCreateCall {
  1021  	c.ctx_ = ctx
  1022  	return c
  1023  }
  1024  
  1025  // Header returns a http.Header that can be modified by the caller to add
  1026  // headers to the request.
  1027  func (c *ProjectsScanConfigsCreateCall) Header() http.Header {
  1028  	if c.header_ == nil {
  1029  		c.header_ = make(http.Header)
  1030  	}
  1031  	return c.header_
  1032  }
  1033  
  1034  func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  1035  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1036  	var body io.Reader = nil
  1037  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
  1038  	if err != nil {
  1039  		return nil, err
  1040  	}
  1041  	c.urlParams_.Set("alt", alt)
  1042  	c.urlParams_.Set("prettyPrint", "false")
  1043  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanConfigs")
  1044  	urls += "?" + c.urlParams_.Encode()
  1045  	req, err := http.NewRequest("POST", urls, body)
  1046  	if err != nil {
  1047  		return nil, err
  1048  	}
  1049  	req.Header = reqHeaders
  1050  	googleapi.Expand(req.URL, map[string]string{
  1051  		"parent": c.parent,
  1052  	})
  1053  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1054  }
  1055  
  1056  // Do executes the "websecurityscanner.projects.scanConfigs.create" call.
  1057  // Any non-2xx status code is an error. Response headers are in either
  1058  // *ScanConfig.ServerResponse.Header or (if a response was returned at all) in
  1059  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1060  // whether the returned error was because http.StatusNotModified was returned.
  1061  func (c *ProjectsScanConfigsCreateCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
  1062  	gensupport.SetOptions(c.urlParams_, opts...)
  1063  	res, err := c.doRequest("json")
  1064  	if res != nil && res.StatusCode == http.StatusNotModified {
  1065  		if res.Body != nil {
  1066  			res.Body.Close()
  1067  		}
  1068  		return nil, gensupport.WrapError(&googleapi.Error{
  1069  			Code:   res.StatusCode,
  1070  			Header: res.Header,
  1071  		})
  1072  	}
  1073  	if err != nil {
  1074  		return nil, err
  1075  	}
  1076  	defer googleapi.CloseBody(res)
  1077  	if err := googleapi.CheckResponse(res); err != nil {
  1078  		return nil, gensupport.WrapError(err)
  1079  	}
  1080  	ret := &ScanConfig{
  1081  		ServerResponse: googleapi.ServerResponse{
  1082  			Header:         res.Header,
  1083  			HTTPStatusCode: res.StatusCode,
  1084  		},
  1085  	}
  1086  	target := &ret
  1087  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1088  		return nil, err
  1089  	}
  1090  	return ret, nil
  1091  }
  1092  
  1093  type ProjectsScanConfigsDeleteCall struct {
  1094  	s          *Service
  1095  	name       string
  1096  	urlParams_ gensupport.URLParams
  1097  	ctx_       context.Context
  1098  	header_    http.Header
  1099  }
  1100  
  1101  // Delete: Deletes an existing ScanConfig and its child resources.
  1102  //
  1103  //   - name: The resource name of the ScanConfig to be deleted. The name follows
  1104  //     the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1105  func (r *ProjectsScanConfigsService) Delete(name string) *ProjectsScanConfigsDeleteCall {
  1106  	c := &ProjectsScanConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1107  	c.name = name
  1108  	return c
  1109  }
  1110  
  1111  // Fields allows partial responses to be retrieved. See
  1112  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1113  // details.
  1114  func (c *ProjectsScanConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsDeleteCall {
  1115  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1116  	return c
  1117  }
  1118  
  1119  // Context sets the context to be used in this call's Do method.
  1120  func (c *ProjectsScanConfigsDeleteCall) Context(ctx context.Context) *ProjectsScanConfigsDeleteCall {
  1121  	c.ctx_ = ctx
  1122  	return c
  1123  }
  1124  
  1125  // Header returns a http.Header that can be modified by the caller to add
  1126  // headers to the request.
  1127  func (c *ProjectsScanConfigsDeleteCall) Header() http.Header {
  1128  	if c.header_ == nil {
  1129  		c.header_ = make(http.Header)
  1130  	}
  1131  	return c.header_
  1132  }
  1133  
  1134  func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1135  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1136  	var body io.Reader = nil
  1137  	c.urlParams_.Set("alt", alt)
  1138  	c.urlParams_.Set("prettyPrint", "false")
  1139  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
  1140  	urls += "?" + c.urlParams_.Encode()
  1141  	req, err := http.NewRequest("DELETE", urls, body)
  1142  	if err != nil {
  1143  		return nil, err
  1144  	}
  1145  	req.Header = reqHeaders
  1146  	googleapi.Expand(req.URL, map[string]string{
  1147  		"name": c.name,
  1148  	})
  1149  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1150  }
  1151  
  1152  // Do executes the "websecurityscanner.projects.scanConfigs.delete" call.
  1153  // Any non-2xx status code is an error. Response headers are in either
  1154  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1155  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1156  // whether the returned error was because http.StatusNotModified was returned.
  1157  func (c *ProjectsScanConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1158  	gensupport.SetOptions(c.urlParams_, opts...)
  1159  	res, err := c.doRequest("json")
  1160  	if res != nil && res.StatusCode == http.StatusNotModified {
  1161  		if res.Body != nil {
  1162  			res.Body.Close()
  1163  		}
  1164  		return nil, gensupport.WrapError(&googleapi.Error{
  1165  			Code:   res.StatusCode,
  1166  			Header: res.Header,
  1167  		})
  1168  	}
  1169  	if err != nil {
  1170  		return nil, err
  1171  	}
  1172  	defer googleapi.CloseBody(res)
  1173  	if err := googleapi.CheckResponse(res); err != nil {
  1174  		return nil, gensupport.WrapError(err)
  1175  	}
  1176  	ret := &Empty{
  1177  		ServerResponse: googleapi.ServerResponse{
  1178  			Header:         res.Header,
  1179  			HTTPStatusCode: res.StatusCode,
  1180  		},
  1181  	}
  1182  	target := &ret
  1183  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1184  		return nil, err
  1185  	}
  1186  	return ret, nil
  1187  }
  1188  
  1189  type ProjectsScanConfigsGetCall struct {
  1190  	s            *Service
  1191  	name         string
  1192  	urlParams_   gensupport.URLParams
  1193  	ifNoneMatch_ string
  1194  	ctx_         context.Context
  1195  	header_      http.Header
  1196  }
  1197  
  1198  // Get: Gets a ScanConfig.
  1199  //
  1200  //   - name: The resource name of the ScanConfig to be returned. The name follows
  1201  //     the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1202  func (r *ProjectsScanConfigsService) Get(name string) *ProjectsScanConfigsGetCall {
  1203  	c := &ProjectsScanConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1204  	c.name = name
  1205  	return c
  1206  }
  1207  
  1208  // Fields allows partial responses to be retrieved. See
  1209  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1210  // details.
  1211  func (c *ProjectsScanConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsGetCall {
  1212  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1213  	return c
  1214  }
  1215  
  1216  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1217  // object's ETag matches the given value. This is useful for getting updates
  1218  // only after the object has changed since the last request.
  1219  func (c *ProjectsScanConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsGetCall {
  1220  	c.ifNoneMatch_ = entityTag
  1221  	return c
  1222  }
  1223  
  1224  // Context sets the context to be used in this call's Do method.
  1225  func (c *ProjectsScanConfigsGetCall) Context(ctx context.Context) *ProjectsScanConfigsGetCall {
  1226  	c.ctx_ = ctx
  1227  	return c
  1228  }
  1229  
  1230  // Header returns a http.Header that can be modified by the caller to add
  1231  // headers to the request.
  1232  func (c *ProjectsScanConfigsGetCall) Header() http.Header {
  1233  	if c.header_ == nil {
  1234  		c.header_ = make(http.Header)
  1235  	}
  1236  	return c.header_
  1237  }
  1238  
  1239  func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  1240  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1241  	if c.ifNoneMatch_ != "" {
  1242  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1243  	}
  1244  	var body io.Reader = nil
  1245  	c.urlParams_.Set("alt", alt)
  1246  	c.urlParams_.Set("prettyPrint", "false")
  1247  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
  1248  	urls += "?" + c.urlParams_.Encode()
  1249  	req, err := http.NewRequest("GET", urls, body)
  1250  	if err != nil {
  1251  		return nil, err
  1252  	}
  1253  	req.Header = reqHeaders
  1254  	googleapi.Expand(req.URL, map[string]string{
  1255  		"name": c.name,
  1256  	})
  1257  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1258  }
  1259  
  1260  // Do executes the "websecurityscanner.projects.scanConfigs.get" call.
  1261  // Any non-2xx status code is an error. Response headers are in either
  1262  // *ScanConfig.ServerResponse.Header or (if a response was returned at all) in
  1263  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1264  // whether the returned error was because http.StatusNotModified was returned.
  1265  func (c *ProjectsScanConfigsGetCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
  1266  	gensupport.SetOptions(c.urlParams_, opts...)
  1267  	res, err := c.doRequest("json")
  1268  	if res != nil && res.StatusCode == http.StatusNotModified {
  1269  		if res.Body != nil {
  1270  			res.Body.Close()
  1271  		}
  1272  		return nil, gensupport.WrapError(&googleapi.Error{
  1273  			Code:   res.StatusCode,
  1274  			Header: res.Header,
  1275  		})
  1276  	}
  1277  	if err != nil {
  1278  		return nil, err
  1279  	}
  1280  	defer googleapi.CloseBody(res)
  1281  	if err := googleapi.CheckResponse(res); err != nil {
  1282  		return nil, gensupport.WrapError(err)
  1283  	}
  1284  	ret := &ScanConfig{
  1285  		ServerResponse: googleapi.ServerResponse{
  1286  			Header:         res.Header,
  1287  			HTTPStatusCode: res.StatusCode,
  1288  		},
  1289  	}
  1290  	target := &ret
  1291  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1292  		return nil, err
  1293  	}
  1294  	return ret, nil
  1295  }
  1296  
  1297  type ProjectsScanConfigsListCall struct {
  1298  	s            *Service
  1299  	parent       string
  1300  	urlParams_   gensupport.URLParams
  1301  	ifNoneMatch_ string
  1302  	ctx_         context.Context
  1303  	header_      http.Header
  1304  }
  1305  
  1306  // List: Lists ScanConfigs under a given project.
  1307  //
  1308  //   - parent: The parent resource name, which should be a project resource name
  1309  //     in the format 'projects/{projectId}'.
  1310  func (r *ProjectsScanConfigsService) List(parent string) *ProjectsScanConfigsListCall {
  1311  	c := &ProjectsScanConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1312  	c.parent = parent
  1313  	return c
  1314  }
  1315  
  1316  // PageSize sets the optional parameter "pageSize": The maximum number of
  1317  // ScanConfigs to return, can be limited by server. If not specified or not
  1318  // positive, the implementation will select a reasonable value.
  1319  func (c *ProjectsScanConfigsListCall) PageSize(pageSize int64) *ProjectsScanConfigsListCall {
  1320  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1321  	return c
  1322  }
  1323  
  1324  // PageToken sets the optional parameter "pageToken": A token identifying a
  1325  // page of results to be returned. This should be a `next_page_token` value
  1326  // returned from a previous List request. If unspecified, the first page of
  1327  // results is returned.
  1328  func (c *ProjectsScanConfigsListCall) PageToken(pageToken string) *ProjectsScanConfigsListCall {
  1329  	c.urlParams_.Set("pageToken", pageToken)
  1330  	return c
  1331  }
  1332  
  1333  // Fields allows partial responses to be retrieved. See
  1334  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1335  // details.
  1336  func (c *ProjectsScanConfigsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsListCall {
  1337  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1338  	return c
  1339  }
  1340  
  1341  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1342  // object's ETag matches the given value. This is useful for getting updates
  1343  // only after the object has changed since the last request.
  1344  func (c *ProjectsScanConfigsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsListCall {
  1345  	c.ifNoneMatch_ = entityTag
  1346  	return c
  1347  }
  1348  
  1349  // Context sets the context to be used in this call's Do method.
  1350  func (c *ProjectsScanConfigsListCall) Context(ctx context.Context) *ProjectsScanConfigsListCall {
  1351  	c.ctx_ = ctx
  1352  	return c
  1353  }
  1354  
  1355  // Header returns a http.Header that can be modified by the caller to add
  1356  // headers to the request.
  1357  func (c *ProjectsScanConfigsListCall) Header() http.Header {
  1358  	if c.header_ == nil {
  1359  		c.header_ = make(http.Header)
  1360  	}
  1361  	return c.header_
  1362  }
  1363  
  1364  func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, error) {
  1365  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1366  	if c.ifNoneMatch_ != "" {
  1367  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1368  	}
  1369  	var body io.Reader = nil
  1370  	c.urlParams_.Set("alt", alt)
  1371  	c.urlParams_.Set("prettyPrint", "false")
  1372  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanConfigs")
  1373  	urls += "?" + c.urlParams_.Encode()
  1374  	req, err := http.NewRequest("GET", urls, body)
  1375  	if err != nil {
  1376  		return nil, err
  1377  	}
  1378  	req.Header = reqHeaders
  1379  	googleapi.Expand(req.URL, map[string]string{
  1380  		"parent": c.parent,
  1381  	})
  1382  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1383  }
  1384  
  1385  // Do executes the "websecurityscanner.projects.scanConfigs.list" call.
  1386  // Any non-2xx status code is an error. Response headers are in either
  1387  // *ListScanConfigsResponse.ServerResponse.Header or (if a response was
  1388  // returned at all) in error.(*googleapi.Error).Header. Use
  1389  // googleapi.IsNotModified to check whether the returned error was because
  1390  // http.StatusNotModified was returned.
  1391  func (c *ProjectsScanConfigsListCall) Do(opts ...googleapi.CallOption) (*ListScanConfigsResponse, error) {
  1392  	gensupport.SetOptions(c.urlParams_, opts...)
  1393  	res, err := c.doRequest("json")
  1394  	if res != nil && res.StatusCode == http.StatusNotModified {
  1395  		if res.Body != nil {
  1396  			res.Body.Close()
  1397  		}
  1398  		return nil, gensupport.WrapError(&googleapi.Error{
  1399  			Code:   res.StatusCode,
  1400  			Header: res.Header,
  1401  		})
  1402  	}
  1403  	if err != nil {
  1404  		return nil, err
  1405  	}
  1406  	defer googleapi.CloseBody(res)
  1407  	if err := googleapi.CheckResponse(res); err != nil {
  1408  		return nil, gensupport.WrapError(err)
  1409  	}
  1410  	ret := &ListScanConfigsResponse{
  1411  		ServerResponse: googleapi.ServerResponse{
  1412  			Header:         res.Header,
  1413  			HTTPStatusCode: res.StatusCode,
  1414  		},
  1415  	}
  1416  	target := &ret
  1417  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1418  		return nil, err
  1419  	}
  1420  	return ret, nil
  1421  }
  1422  
  1423  // Pages invokes f for each page of results.
  1424  // A non-nil error returned from f will halt the iteration.
  1425  // The provided context supersedes any context provided to the Context method.
  1426  func (c *ProjectsScanConfigsListCall) Pages(ctx context.Context, f func(*ListScanConfigsResponse) error) error {
  1427  	c.ctx_ = ctx
  1428  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1429  	for {
  1430  		x, err := c.Do()
  1431  		if err != nil {
  1432  			return err
  1433  		}
  1434  		if err := f(x); err != nil {
  1435  			return err
  1436  		}
  1437  		if x.NextPageToken == "" {
  1438  			return nil
  1439  		}
  1440  		c.PageToken(x.NextPageToken)
  1441  	}
  1442  }
  1443  
  1444  type ProjectsScanConfigsPatchCall struct {
  1445  	s          *Service
  1446  	name       string
  1447  	scanconfig *ScanConfig
  1448  	urlParams_ gensupport.URLParams
  1449  	ctx_       context.Context
  1450  	header_    http.Header
  1451  }
  1452  
  1453  // Patch: Updates a ScanConfig. This method support partial update of a
  1454  // ScanConfig.
  1455  //
  1456  //   - name: The resource name of the ScanConfig. The name follows the format of
  1457  //     'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
  1458  //     generated by the system.
  1459  func (r *ProjectsScanConfigsService) Patch(name string, scanconfig *ScanConfig) *ProjectsScanConfigsPatchCall {
  1460  	c := &ProjectsScanConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1461  	c.name = name
  1462  	c.scanconfig = scanconfig
  1463  	return c
  1464  }
  1465  
  1466  // UpdateMask sets the optional parameter "updateMask": Required. The update
  1467  // mask applies to the resource. For the `FieldMask` definition, see
  1468  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  1469  func (c *ProjectsScanConfigsPatchCall) UpdateMask(updateMask string) *ProjectsScanConfigsPatchCall {
  1470  	c.urlParams_.Set("updateMask", updateMask)
  1471  	return c
  1472  }
  1473  
  1474  // Fields allows partial responses to be retrieved. See
  1475  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1476  // details.
  1477  func (c *ProjectsScanConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsPatchCall {
  1478  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1479  	return c
  1480  }
  1481  
  1482  // Context sets the context to be used in this call's Do method.
  1483  func (c *ProjectsScanConfigsPatchCall) Context(ctx context.Context) *ProjectsScanConfigsPatchCall {
  1484  	c.ctx_ = ctx
  1485  	return c
  1486  }
  1487  
  1488  // Header returns a http.Header that can be modified by the caller to add
  1489  // headers to the request.
  1490  func (c *ProjectsScanConfigsPatchCall) Header() http.Header {
  1491  	if c.header_ == nil {
  1492  		c.header_ = make(http.Header)
  1493  	}
  1494  	return c.header_
  1495  }
  1496  
  1497  func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) {
  1498  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1499  	var body io.Reader = nil
  1500  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
  1501  	if err != nil {
  1502  		return nil, err
  1503  	}
  1504  	c.urlParams_.Set("alt", alt)
  1505  	c.urlParams_.Set("prettyPrint", "false")
  1506  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
  1507  	urls += "?" + c.urlParams_.Encode()
  1508  	req, err := http.NewRequest("PATCH", urls, body)
  1509  	if err != nil {
  1510  		return nil, err
  1511  	}
  1512  	req.Header = reqHeaders
  1513  	googleapi.Expand(req.URL, map[string]string{
  1514  		"name": c.name,
  1515  	})
  1516  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1517  }
  1518  
  1519  // Do executes the "websecurityscanner.projects.scanConfigs.patch" call.
  1520  // Any non-2xx status code is an error. Response headers are in either
  1521  // *ScanConfig.ServerResponse.Header or (if a response was returned at all) in
  1522  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1523  // whether the returned error was because http.StatusNotModified was returned.
  1524  func (c *ProjectsScanConfigsPatchCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
  1525  	gensupport.SetOptions(c.urlParams_, opts...)
  1526  	res, err := c.doRequest("json")
  1527  	if res != nil && res.StatusCode == http.StatusNotModified {
  1528  		if res.Body != nil {
  1529  			res.Body.Close()
  1530  		}
  1531  		return nil, gensupport.WrapError(&googleapi.Error{
  1532  			Code:   res.StatusCode,
  1533  			Header: res.Header,
  1534  		})
  1535  	}
  1536  	if err != nil {
  1537  		return nil, err
  1538  	}
  1539  	defer googleapi.CloseBody(res)
  1540  	if err := googleapi.CheckResponse(res); err != nil {
  1541  		return nil, gensupport.WrapError(err)
  1542  	}
  1543  	ret := &ScanConfig{
  1544  		ServerResponse: googleapi.ServerResponse{
  1545  			Header:         res.Header,
  1546  			HTTPStatusCode: res.StatusCode,
  1547  		},
  1548  	}
  1549  	target := &ret
  1550  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1551  		return nil, err
  1552  	}
  1553  	return ret, nil
  1554  }
  1555  
  1556  type ProjectsScanConfigsStartCall struct {
  1557  	s                   *Service
  1558  	name                string
  1559  	startscanrunrequest *StartScanRunRequest
  1560  	urlParams_          gensupport.URLParams
  1561  	ctx_                context.Context
  1562  	header_             http.Header
  1563  }
  1564  
  1565  // Start: Start a ScanRun according to the given ScanConfig.
  1566  //
  1567  //   - name: The resource name of the ScanConfig to be used. The name follows the
  1568  //     format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1569  func (r *ProjectsScanConfigsService) Start(name string, startscanrunrequest *StartScanRunRequest) *ProjectsScanConfigsStartCall {
  1570  	c := &ProjectsScanConfigsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1571  	c.name = name
  1572  	c.startscanrunrequest = startscanrunrequest
  1573  	return c
  1574  }
  1575  
  1576  // Fields allows partial responses to be retrieved. See
  1577  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1578  // details.
  1579  func (c *ProjectsScanConfigsStartCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsStartCall {
  1580  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1581  	return c
  1582  }
  1583  
  1584  // Context sets the context to be used in this call's Do method.
  1585  func (c *ProjectsScanConfigsStartCall) Context(ctx context.Context) *ProjectsScanConfigsStartCall {
  1586  	c.ctx_ = ctx
  1587  	return c
  1588  }
  1589  
  1590  // Header returns a http.Header that can be modified by the caller to add
  1591  // headers to the request.
  1592  func (c *ProjectsScanConfigsStartCall) Header() http.Header {
  1593  	if c.header_ == nil {
  1594  		c.header_ = make(http.Header)
  1595  	}
  1596  	return c.header_
  1597  }
  1598  
  1599  func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) {
  1600  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1601  	var body io.Reader = nil
  1602  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest)
  1603  	if err != nil {
  1604  		return nil, err
  1605  	}
  1606  	c.urlParams_.Set("alt", alt)
  1607  	c.urlParams_.Set("prettyPrint", "false")
  1608  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:start")
  1609  	urls += "?" + c.urlParams_.Encode()
  1610  	req, err := http.NewRequest("POST", urls, body)
  1611  	if err != nil {
  1612  		return nil, err
  1613  	}
  1614  	req.Header = reqHeaders
  1615  	googleapi.Expand(req.URL, map[string]string{
  1616  		"name": c.name,
  1617  	})
  1618  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1619  }
  1620  
  1621  // Do executes the "websecurityscanner.projects.scanConfigs.start" call.
  1622  // Any non-2xx status code is an error. Response headers are in either
  1623  // *ScanRun.ServerResponse.Header or (if a response was returned at all) in
  1624  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1625  // whether the returned error was because http.StatusNotModified was returned.
  1626  func (c *ProjectsScanConfigsStartCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
  1627  	gensupport.SetOptions(c.urlParams_, opts...)
  1628  	res, err := c.doRequest("json")
  1629  	if res != nil && res.StatusCode == http.StatusNotModified {
  1630  		if res.Body != nil {
  1631  			res.Body.Close()
  1632  		}
  1633  		return nil, gensupport.WrapError(&googleapi.Error{
  1634  			Code:   res.StatusCode,
  1635  			Header: res.Header,
  1636  		})
  1637  	}
  1638  	if err != nil {
  1639  		return nil, err
  1640  	}
  1641  	defer googleapi.CloseBody(res)
  1642  	if err := googleapi.CheckResponse(res); err != nil {
  1643  		return nil, gensupport.WrapError(err)
  1644  	}
  1645  	ret := &ScanRun{
  1646  		ServerResponse: googleapi.ServerResponse{
  1647  			Header:         res.Header,
  1648  			HTTPStatusCode: res.StatusCode,
  1649  		},
  1650  	}
  1651  	target := &ret
  1652  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1653  		return nil, err
  1654  	}
  1655  	return ret, nil
  1656  }
  1657  
  1658  type ProjectsScanConfigsScanRunsGetCall struct {
  1659  	s            *Service
  1660  	name         string
  1661  	urlParams_   gensupport.URLParams
  1662  	ifNoneMatch_ string
  1663  	ctx_         context.Context
  1664  	header_      http.Header
  1665  }
  1666  
  1667  // Get: Gets a ScanRun.
  1668  //
  1669  //   - name: The resource name of the ScanRun to be returned. The name follows
  1670  //     the format of
  1671  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  1672  func (r *ProjectsScanConfigsScanRunsService) Get(name string) *ProjectsScanConfigsScanRunsGetCall {
  1673  	c := &ProjectsScanConfigsScanRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1674  	c.name = name
  1675  	return c
  1676  }
  1677  
  1678  // Fields allows partial responses to be retrieved. See
  1679  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1680  // details.
  1681  func (c *ProjectsScanConfigsScanRunsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsGetCall {
  1682  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1683  	return c
  1684  }
  1685  
  1686  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1687  // object's ETag matches the given value. This is useful for getting updates
  1688  // only after the object has changed since the last request.
  1689  func (c *ProjectsScanConfigsScanRunsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsGetCall {
  1690  	c.ifNoneMatch_ = entityTag
  1691  	return c
  1692  }
  1693  
  1694  // Context sets the context to be used in this call's Do method.
  1695  func (c *ProjectsScanConfigsScanRunsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsGetCall {
  1696  	c.ctx_ = ctx
  1697  	return c
  1698  }
  1699  
  1700  // Header returns a http.Header that can be modified by the caller to add
  1701  // headers to the request.
  1702  func (c *ProjectsScanConfigsScanRunsGetCall) Header() http.Header {
  1703  	if c.header_ == nil {
  1704  		c.header_ = make(http.Header)
  1705  	}
  1706  	return c.header_
  1707  }
  1708  
  1709  func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Response, error) {
  1710  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1711  	if c.ifNoneMatch_ != "" {
  1712  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1713  	}
  1714  	var body io.Reader = nil
  1715  	c.urlParams_.Set("alt", alt)
  1716  	c.urlParams_.Set("prettyPrint", "false")
  1717  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
  1718  	urls += "?" + c.urlParams_.Encode()
  1719  	req, err := http.NewRequest("GET", urls, body)
  1720  	if err != nil {
  1721  		return nil, err
  1722  	}
  1723  	req.Header = reqHeaders
  1724  	googleapi.Expand(req.URL, map[string]string{
  1725  		"name": c.name,
  1726  	})
  1727  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1728  }
  1729  
  1730  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.get" call.
  1731  // Any non-2xx status code is an error. Response headers are in either
  1732  // *ScanRun.ServerResponse.Header or (if a response was returned at all) in
  1733  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1734  // whether the returned error was because http.StatusNotModified was returned.
  1735  func (c *ProjectsScanConfigsScanRunsGetCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
  1736  	gensupport.SetOptions(c.urlParams_, opts...)
  1737  	res, err := c.doRequest("json")
  1738  	if res != nil && res.StatusCode == http.StatusNotModified {
  1739  		if res.Body != nil {
  1740  			res.Body.Close()
  1741  		}
  1742  		return nil, gensupport.WrapError(&googleapi.Error{
  1743  			Code:   res.StatusCode,
  1744  			Header: res.Header,
  1745  		})
  1746  	}
  1747  	if err != nil {
  1748  		return nil, err
  1749  	}
  1750  	defer googleapi.CloseBody(res)
  1751  	if err := googleapi.CheckResponse(res); err != nil {
  1752  		return nil, gensupport.WrapError(err)
  1753  	}
  1754  	ret := &ScanRun{
  1755  		ServerResponse: googleapi.ServerResponse{
  1756  			Header:         res.Header,
  1757  			HTTPStatusCode: res.StatusCode,
  1758  		},
  1759  	}
  1760  	target := &ret
  1761  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1762  		return nil, err
  1763  	}
  1764  	return ret, nil
  1765  }
  1766  
  1767  type ProjectsScanConfigsScanRunsListCall struct {
  1768  	s            *Service
  1769  	parent       string
  1770  	urlParams_   gensupport.URLParams
  1771  	ifNoneMatch_ string
  1772  	ctx_         context.Context
  1773  	header_      http.Header
  1774  }
  1775  
  1776  // List: Lists ScanRuns under a given ScanConfig, in descending order of
  1777  // ScanRun stop time.
  1778  //
  1779  //   - parent: The parent resource name, which should be a scan resource name in
  1780  //     the format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1781  func (r *ProjectsScanConfigsScanRunsService) List(parent string) *ProjectsScanConfigsScanRunsListCall {
  1782  	c := &ProjectsScanConfigsScanRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1783  	c.parent = parent
  1784  	return c
  1785  }
  1786  
  1787  // PageSize sets the optional parameter "pageSize": The maximum number of
  1788  // ScanRuns to return, can be limited by server. If not specified or not
  1789  // positive, the implementation will select a reasonable value.
  1790  func (c *ProjectsScanConfigsScanRunsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsListCall {
  1791  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1792  	return c
  1793  }
  1794  
  1795  // PageToken sets the optional parameter "pageToken": A token identifying a
  1796  // page of results to be returned. This should be a `next_page_token` value
  1797  // returned from a previous List request. If unspecified, the first page of
  1798  // results is returned.
  1799  func (c *ProjectsScanConfigsScanRunsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsListCall {
  1800  	c.urlParams_.Set("pageToken", pageToken)
  1801  	return c
  1802  }
  1803  
  1804  // Fields allows partial responses to be retrieved. See
  1805  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1806  // details.
  1807  func (c *ProjectsScanConfigsScanRunsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsListCall {
  1808  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1809  	return c
  1810  }
  1811  
  1812  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1813  // object's ETag matches the given value. This is useful for getting updates
  1814  // only after the object has changed since the last request.
  1815  func (c *ProjectsScanConfigsScanRunsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsListCall {
  1816  	c.ifNoneMatch_ = entityTag
  1817  	return c
  1818  }
  1819  
  1820  // Context sets the context to be used in this call's Do method.
  1821  func (c *ProjectsScanConfigsScanRunsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsListCall {
  1822  	c.ctx_ = ctx
  1823  	return c
  1824  }
  1825  
  1826  // Header returns a http.Header that can be modified by the caller to add
  1827  // headers to the request.
  1828  func (c *ProjectsScanConfigsScanRunsListCall) Header() http.Header {
  1829  	if c.header_ == nil {
  1830  		c.header_ = make(http.Header)
  1831  	}
  1832  	return c.header_
  1833  }
  1834  
  1835  func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Response, error) {
  1836  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1837  	if c.ifNoneMatch_ != "" {
  1838  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1839  	}
  1840  	var body io.Reader = nil
  1841  	c.urlParams_.Set("alt", alt)
  1842  	c.urlParams_.Set("prettyPrint", "false")
  1843  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/scanRuns")
  1844  	urls += "?" + c.urlParams_.Encode()
  1845  	req, err := http.NewRequest("GET", urls, body)
  1846  	if err != nil {
  1847  		return nil, err
  1848  	}
  1849  	req.Header = reqHeaders
  1850  	googleapi.Expand(req.URL, map[string]string{
  1851  		"parent": c.parent,
  1852  	})
  1853  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1854  }
  1855  
  1856  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.list" call.
  1857  // Any non-2xx status code is an error. Response headers are in either
  1858  // *ListScanRunsResponse.ServerResponse.Header or (if a response was returned
  1859  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1860  // check whether the returned error was because http.StatusNotModified was
  1861  // returned.
  1862  func (c *ProjectsScanConfigsScanRunsListCall) Do(opts ...googleapi.CallOption) (*ListScanRunsResponse, error) {
  1863  	gensupport.SetOptions(c.urlParams_, opts...)
  1864  	res, err := c.doRequest("json")
  1865  	if res != nil && res.StatusCode == http.StatusNotModified {
  1866  		if res.Body != nil {
  1867  			res.Body.Close()
  1868  		}
  1869  		return nil, gensupport.WrapError(&googleapi.Error{
  1870  			Code:   res.StatusCode,
  1871  			Header: res.Header,
  1872  		})
  1873  	}
  1874  	if err != nil {
  1875  		return nil, err
  1876  	}
  1877  	defer googleapi.CloseBody(res)
  1878  	if err := googleapi.CheckResponse(res); err != nil {
  1879  		return nil, gensupport.WrapError(err)
  1880  	}
  1881  	ret := &ListScanRunsResponse{
  1882  		ServerResponse: googleapi.ServerResponse{
  1883  			Header:         res.Header,
  1884  			HTTPStatusCode: res.StatusCode,
  1885  		},
  1886  	}
  1887  	target := &ret
  1888  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1889  		return nil, err
  1890  	}
  1891  	return ret, nil
  1892  }
  1893  
  1894  // Pages invokes f for each page of results.
  1895  // A non-nil error returned from f will halt the iteration.
  1896  // The provided context supersedes any context provided to the Context method.
  1897  func (c *ProjectsScanConfigsScanRunsListCall) Pages(ctx context.Context, f func(*ListScanRunsResponse) error) error {
  1898  	c.ctx_ = ctx
  1899  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1900  	for {
  1901  		x, err := c.Do()
  1902  		if err != nil {
  1903  			return err
  1904  		}
  1905  		if err := f(x); err != nil {
  1906  			return err
  1907  		}
  1908  		if x.NextPageToken == "" {
  1909  			return nil
  1910  		}
  1911  		c.PageToken(x.NextPageToken)
  1912  	}
  1913  }
  1914  
  1915  type ProjectsScanConfigsScanRunsStopCall struct {
  1916  	s                  *Service
  1917  	name               string
  1918  	stopscanrunrequest *StopScanRunRequest
  1919  	urlParams_         gensupport.URLParams
  1920  	ctx_               context.Context
  1921  	header_            http.Header
  1922  }
  1923  
  1924  // Stop: Stops a ScanRun. The stopped ScanRun is returned.
  1925  //
  1926  //   - name: The resource name of the ScanRun to be stopped. The name follows the
  1927  //     format of
  1928  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  1929  func (r *ProjectsScanConfigsScanRunsService) Stop(name string, stopscanrunrequest *StopScanRunRequest) *ProjectsScanConfigsScanRunsStopCall {
  1930  	c := &ProjectsScanConfigsScanRunsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1931  	c.name = name
  1932  	c.stopscanrunrequest = stopscanrunrequest
  1933  	return c
  1934  }
  1935  
  1936  // Fields allows partial responses to be retrieved. See
  1937  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1938  // details.
  1939  func (c *ProjectsScanConfigsScanRunsStopCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsStopCall {
  1940  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1941  	return c
  1942  }
  1943  
  1944  // Context sets the context to be used in this call's Do method.
  1945  func (c *ProjectsScanConfigsScanRunsStopCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsStopCall {
  1946  	c.ctx_ = ctx
  1947  	return c
  1948  }
  1949  
  1950  // Header returns a http.Header that can be modified by the caller to add
  1951  // headers to the request.
  1952  func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header {
  1953  	if c.header_ == nil {
  1954  		c.header_ = make(http.Header)
  1955  	}
  1956  	return c.header_
  1957  }
  1958  
  1959  func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) {
  1960  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1961  	var body io.Reader = nil
  1962  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest)
  1963  	if err != nil {
  1964  		return nil, err
  1965  	}
  1966  	c.urlParams_.Set("alt", alt)
  1967  	c.urlParams_.Set("prettyPrint", "false")
  1968  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:stop")
  1969  	urls += "?" + c.urlParams_.Encode()
  1970  	req, err := http.NewRequest("POST", urls, body)
  1971  	if err != nil {
  1972  		return nil, err
  1973  	}
  1974  	req.Header = reqHeaders
  1975  	googleapi.Expand(req.URL, map[string]string{
  1976  		"name": c.name,
  1977  	})
  1978  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1979  }
  1980  
  1981  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.stop" call.
  1982  // Any non-2xx status code is an error. Response headers are in either
  1983  // *ScanRun.ServerResponse.Header or (if a response was returned at all) in
  1984  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1985  // whether the returned error was because http.StatusNotModified was returned.
  1986  func (c *ProjectsScanConfigsScanRunsStopCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
  1987  	gensupport.SetOptions(c.urlParams_, opts...)
  1988  	res, err := c.doRequest("json")
  1989  	if res != nil && res.StatusCode == http.StatusNotModified {
  1990  		if res.Body != nil {
  1991  			res.Body.Close()
  1992  		}
  1993  		return nil, gensupport.WrapError(&googleapi.Error{
  1994  			Code:   res.StatusCode,
  1995  			Header: res.Header,
  1996  		})
  1997  	}
  1998  	if err != nil {
  1999  		return nil, err
  2000  	}
  2001  	defer googleapi.CloseBody(res)
  2002  	if err := googleapi.CheckResponse(res); err != nil {
  2003  		return nil, gensupport.WrapError(err)
  2004  	}
  2005  	ret := &ScanRun{
  2006  		ServerResponse: googleapi.ServerResponse{
  2007  			Header:         res.Header,
  2008  			HTTPStatusCode: res.StatusCode,
  2009  		},
  2010  	}
  2011  	target := &ret
  2012  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2013  		return nil, err
  2014  	}
  2015  	return ret, nil
  2016  }
  2017  
  2018  type ProjectsScanConfigsScanRunsCrawledUrlsListCall struct {
  2019  	s            *Service
  2020  	parent       string
  2021  	urlParams_   gensupport.URLParams
  2022  	ifNoneMatch_ string
  2023  	ctx_         context.Context
  2024  	header_      http.Header
  2025  }
  2026  
  2027  // List: List CrawledUrls under a given ScanRun.
  2028  //
  2029  //   - parent: The parent resource name, which should be a scan run resource name
  2030  //     in the format
  2031  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2032  func (r *ProjectsScanConfigsScanRunsCrawledUrlsService) List(parent string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2033  	c := &ProjectsScanConfigsScanRunsCrawledUrlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2034  	c.parent = parent
  2035  	return c
  2036  }
  2037  
  2038  // PageSize sets the optional parameter "pageSize": The maximum number of
  2039  // CrawledUrls to return, can be limited by server. If not specified or not
  2040  // positive, the implementation will select a reasonable value.
  2041  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2042  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2043  	return c
  2044  }
  2045  
  2046  // PageToken sets the optional parameter "pageToken": A token identifying a
  2047  // page of results to be returned. This should be a `next_page_token` value
  2048  // returned from a previous List request. If unspecified, the first page of
  2049  // results is returned.
  2050  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2051  	c.urlParams_.Set("pageToken", pageToken)
  2052  	return c
  2053  }
  2054  
  2055  // Fields allows partial responses to be retrieved. See
  2056  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2057  // details.
  2058  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2059  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2060  	return c
  2061  }
  2062  
  2063  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2064  // object's ETag matches the given value. This is useful for getting updates
  2065  // only after the object has changed since the last request.
  2066  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2067  	c.ifNoneMatch_ = entityTag
  2068  	return c
  2069  }
  2070  
  2071  // Context sets the context to be used in this call's Do method.
  2072  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2073  	c.ctx_ = ctx
  2074  	return c
  2075  }
  2076  
  2077  // Header returns a http.Header that can be modified by the caller to add
  2078  // headers to the request.
  2079  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Header() http.Header {
  2080  	if c.header_ == nil {
  2081  		c.header_ = make(http.Header)
  2082  	}
  2083  	return c.header_
  2084  }
  2085  
  2086  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) (*http.Response, error) {
  2087  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2088  	if c.ifNoneMatch_ != "" {
  2089  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2090  	}
  2091  	var body io.Reader = nil
  2092  	c.urlParams_.Set("alt", alt)
  2093  	c.urlParams_.Set("prettyPrint", "false")
  2094  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/crawledUrls")
  2095  	urls += "?" + c.urlParams_.Encode()
  2096  	req, err := http.NewRequest("GET", urls, body)
  2097  	if err != nil {
  2098  		return nil, err
  2099  	}
  2100  	req.Header = reqHeaders
  2101  	googleapi.Expand(req.URL, map[string]string{
  2102  		"parent": c.parent,
  2103  	})
  2104  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2105  }
  2106  
  2107  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list" call.
  2108  // Any non-2xx status code is an error. Response headers are in either
  2109  // *ListCrawledUrlsResponse.ServerResponse.Header or (if a response was
  2110  // returned at all) in error.(*googleapi.Error).Header. Use
  2111  // googleapi.IsNotModified to check whether the returned error was because
  2112  // http.StatusNotModified was returned.
  2113  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Do(opts ...googleapi.CallOption) (*ListCrawledUrlsResponse, error) {
  2114  	gensupport.SetOptions(c.urlParams_, opts...)
  2115  	res, err := c.doRequest("json")
  2116  	if res != nil && res.StatusCode == http.StatusNotModified {
  2117  		if res.Body != nil {
  2118  			res.Body.Close()
  2119  		}
  2120  		return nil, gensupport.WrapError(&googleapi.Error{
  2121  			Code:   res.StatusCode,
  2122  			Header: res.Header,
  2123  		})
  2124  	}
  2125  	if err != nil {
  2126  		return nil, err
  2127  	}
  2128  	defer googleapi.CloseBody(res)
  2129  	if err := googleapi.CheckResponse(res); err != nil {
  2130  		return nil, gensupport.WrapError(err)
  2131  	}
  2132  	ret := &ListCrawledUrlsResponse{
  2133  		ServerResponse: googleapi.ServerResponse{
  2134  			Header:         res.Header,
  2135  			HTTPStatusCode: res.StatusCode,
  2136  		},
  2137  	}
  2138  	target := &ret
  2139  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2140  		return nil, err
  2141  	}
  2142  	return ret, nil
  2143  }
  2144  
  2145  // Pages invokes f for each page of results.
  2146  // A non-nil error returned from f will halt the iteration.
  2147  // The provided context supersedes any context provided to the Context method.
  2148  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Pages(ctx context.Context, f func(*ListCrawledUrlsResponse) error) error {
  2149  	c.ctx_ = ctx
  2150  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2151  	for {
  2152  		x, err := c.Do()
  2153  		if err != nil {
  2154  			return err
  2155  		}
  2156  		if err := f(x); err != nil {
  2157  			return err
  2158  		}
  2159  		if x.NextPageToken == "" {
  2160  			return nil
  2161  		}
  2162  		c.PageToken(x.NextPageToken)
  2163  	}
  2164  }
  2165  
  2166  type ProjectsScanConfigsScanRunsFindingTypeStatsListCall struct {
  2167  	s            *Service
  2168  	parent       string
  2169  	urlParams_   gensupport.URLParams
  2170  	ifNoneMatch_ string
  2171  	ctx_         context.Context
  2172  	header_      http.Header
  2173  }
  2174  
  2175  // List: List all FindingTypeStats under a given ScanRun.
  2176  //
  2177  //   - parent: The parent resource name, which should be a scan run resource name
  2178  //     in the format
  2179  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2180  func (r *ProjectsScanConfigsScanRunsFindingTypeStatsService) List(parent string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2181  	c := &ProjectsScanConfigsScanRunsFindingTypeStatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2182  	c.parent = parent
  2183  	return c
  2184  }
  2185  
  2186  // Fields allows partial responses to be retrieved. See
  2187  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2188  // details.
  2189  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2190  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2191  	return c
  2192  }
  2193  
  2194  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2195  // object's ETag matches the given value. This is useful for getting updates
  2196  // only after the object has changed since the last request.
  2197  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2198  	c.ifNoneMatch_ = entityTag
  2199  	return c
  2200  }
  2201  
  2202  // Context sets the context to be used in this call's Do method.
  2203  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2204  	c.ctx_ = ctx
  2205  	return c
  2206  }
  2207  
  2208  // Header returns a http.Header that can be modified by the caller to add
  2209  // headers to the request.
  2210  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Header() http.Header {
  2211  	if c.header_ == nil {
  2212  		c.header_ = make(http.Header)
  2213  	}
  2214  	return c.header_
  2215  }
  2216  
  2217  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt string) (*http.Response, error) {
  2218  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2219  	if c.ifNoneMatch_ != "" {
  2220  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2221  	}
  2222  	var body io.Reader = nil
  2223  	c.urlParams_.Set("alt", alt)
  2224  	c.urlParams_.Set("prettyPrint", "false")
  2225  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/findingTypeStats")
  2226  	urls += "?" + c.urlParams_.Encode()
  2227  	req, err := http.NewRequest("GET", urls, body)
  2228  	if err != nil {
  2229  		return nil, err
  2230  	}
  2231  	req.Header = reqHeaders
  2232  	googleapi.Expand(req.URL, map[string]string{
  2233  		"parent": c.parent,
  2234  	})
  2235  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2236  }
  2237  
  2238  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list" call.
  2239  // Any non-2xx status code is an error. Response headers are in either
  2240  // *ListFindingTypeStatsResponse.ServerResponse.Header or (if a response was
  2241  // returned at all) in error.(*googleapi.Error).Header. Use
  2242  // googleapi.IsNotModified to check whether the returned error was because
  2243  // http.StatusNotModified was returned.
  2244  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Do(opts ...googleapi.CallOption) (*ListFindingTypeStatsResponse, error) {
  2245  	gensupport.SetOptions(c.urlParams_, opts...)
  2246  	res, err := c.doRequest("json")
  2247  	if res != nil && res.StatusCode == http.StatusNotModified {
  2248  		if res.Body != nil {
  2249  			res.Body.Close()
  2250  		}
  2251  		return nil, gensupport.WrapError(&googleapi.Error{
  2252  			Code:   res.StatusCode,
  2253  			Header: res.Header,
  2254  		})
  2255  	}
  2256  	if err != nil {
  2257  		return nil, err
  2258  	}
  2259  	defer googleapi.CloseBody(res)
  2260  	if err := googleapi.CheckResponse(res); err != nil {
  2261  		return nil, gensupport.WrapError(err)
  2262  	}
  2263  	ret := &ListFindingTypeStatsResponse{
  2264  		ServerResponse: googleapi.ServerResponse{
  2265  			Header:         res.Header,
  2266  			HTTPStatusCode: res.StatusCode,
  2267  		},
  2268  	}
  2269  	target := &ret
  2270  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2271  		return nil, err
  2272  	}
  2273  	return ret, nil
  2274  }
  2275  
  2276  type ProjectsScanConfigsScanRunsFindingsGetCall struct {
  2277  	s            *Service
  2278  	name         string
  2279  	urlParams_   gensupport.URLParams
  2280  	ifNoneMatch_ string
  2281  	ctx_         context.Context
  2282  	header_      http.Header
  2283  }
  2284  
  2285  // Get: Gets a Finding.
  2286  //
  2287  //   - name: The resource name of the Finding to be returned. The name follows
  2288  //     the format of
  2289  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findi
  2290  //     ngs/{findingId}'.
  2291  func (r *ProjectsScanConfigsScanRunsFindingsService) Get(name string) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2292  	c := &ProjectsScanConfigsScanRunsFindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2293  	c.name = name
  2294  	return c
  2295  }
  2296  
  2297  // Fields allows partial responses to be retrieved. See
  2298  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2299  // details.
  2300  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2301  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2302  	return c
  2303  }
  2304  
  2305  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2306  // object's ETag matches the given value. This is useful for getting updates
  2307  // only after the object has changed since the last request.
  2308  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2309  	c.ifNoneMatch_ = entityTag
  2310  	return c
  2311  }
  2312  
  2313  // Context sets the context to be used in this call's Do method.
  2314  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2315  	c.ctx_ = ctx
  2316  	return c
  2317  }
  2318  
  2319  // Header returns a http.Header that can be modified by the caller to add
  2320  // headers to the request.
  2321  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Header() http.Header {
  2322  	if c.header_ == nil {
  2323  		c.header_ = make(http.Header)
  2324  	}
  2325  	return c.header_
  2326  }
  2327  
  2328  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*http.Response, error) {
  2329  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2330  	if c.ifNoneMatch_ != "" {
  2331  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2332  	}
  2333  	var body io.Reader = nil
  2334  	c.urlParams_.Set("alt", alt)
  2335  	c.urlParams_.Set("prettyPrint", "false")
  2336  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
  2337  	urls += "?" + c.urlParams_.Encode()
  2338  	req, err := http.NewRequest("GET", urls, body)
  2339  	if err != nil {
  2340  		return nil, err
  2341  	}
  2342  	req.Header = reqHeaders
  2343  	googleapi.Expand(req.URL, map[string]string{
  2344  		"name": c.name,
  2345  	})
  2346  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2347  }
  2348  
  2349  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findings.get" call.
  2350  // Any non-2xx status code is an error. Response headers are in either
  2351  // *Finding.ServerResponse.Header or (if a response was returned at all) in
  2352  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2353  // whether the returned error was because http.StatusNotModified was returned.
  2354  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Do(opts ...googleapi.CallOption) (*Finding, error) {
  2355  	gensupport.SetOptions(c.urlParams_, opts...)
  2356  	res, err := c.doRequest("json")
  2357  	if res != nil && res.StatusCode == http.StatusNotModified {
  2358  		if res.Body != nil {
  2359  			res.Body.Close()
  2360  		}
  2361  		return nil, gensupport.WrapError(&googleapi.Error{
  2362  			Code:   res.StatusCode,
  2363  			Header: res.Header,
  2364  		})
  2365  	}
  2366  	if err != nil {
  2367  		return nil, err
  2368  	}
  2369  	defer googleapi.CloseBody(res)
  2370  	if err := googleapi.CheckResponse(res); err != nil {
  2371  		return nil, gensupport.WrapError(err)
  2372  	}
  2373  	ret := &Finding{
  2374  		ServerResponse: googleapi.ServerResponse{
  2375  			Header:         res.Header,
  2376  			HTTPStatusCode: res.StatusCode,
  2377  		},
  2378  	}
  2379  	target := &ret
  2380  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2381  		return nil, err
  2382  	}
  2383  	return ret, nil
  2384  }
  2385  
  2386  type ProjectsScanConfigsScanRunsFindingsListCall struct {
  2387  	s            *Service
  2388  	parent       string
  2389  	urlParams_   gensupport.URLParams
  2390  	ifNoneMatch_ string
  2391  	ctx_         context.Context
  2392  	header_      http.Header
  2393  }
  2394  
  2395  // List: List Findings under a given ScanRun.
  2396  //
  2397  //   - parent: The parent resource name, which should be a scan run resource name
  2398  //     in the format
  2399  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2400  func (r *ProjectsScanConfigsScanRunsFindingsService) List(parent string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2401  	c := &ProjectsScanConfigsScanRunsFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2402  	c.parent = parent
  2403  	return c
  2404  }
  2405  
  2406  // Filter sets the optional parameter "filter": Required. The filter
  2407  // expression. The expression must be in the format: . Supported field:
  2408  // 'finding_type'. Supported operator: '='.
  2409  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Filter(filter string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2410  	c.urlParams_.Set("filter", filter)
  2411  	return c
  2412  }
  2413  
  2414  // PageSize sets the optional parameter "pageSize": The maximum number of
  2415  // Findings to return, can be limited by server. If not specified or not
  2416  // positive, the implementation will select a reasonable value.
  2417  func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsFindingsListCall {
  2418  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2419  	return c
  2420  }
  2421  
  2422  // PageToken sets the optional parameter "pageToken": A token identifying a
  2423  // page of results to be returned. This should be a `next_page_token` value
  2424  // returned from a previous List request. If unspecified, the first page of
  2425  // results is returned.
  2426  func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2427  	c.urlParams_.Set("pageToken", pageToken)
  2428  	return c
  2429  }
  2430  
  2431  // Fields allows partial responses to be retrieved. See
  2432  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2433  // details.
  2434  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsListCall {
  2435  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2436  	return c
  2437  }
  2438  
  2439  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2440  // object's ETag matches the given value. This is useful for getting updates
  2441  // only after the object has changed since the last request.
  2442  func (c *ProjectsScanConfigsScanRunsFindingsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2443  	c.ifNoneMatch_ = entityTag
  2444  	return c
  2445  }
  2446  
  2447  // Context sets the context to be used in this call's Do method.
  2448  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsListCall {
  2449  	c.ctx_ = ctx
  2450  	return c
  2451  }
  2452  
  2453  // Header returns a http.Header that can be modified by the caller to add
  2454  // headers to the request.
  2455  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Header() http.Header {
  2456  	if c.header_ == nil {
  2457  		c.header_ = make(http.Header)
  2458  	}
  2459  	return c.header_
  2460  }
  2461  
  2462  func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*http.Response, error) {
  2463  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2464  	if c.ifNoneMatch_ != "" {
  2465  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2466  	}
  2467  	var body io.Reader = nil
  2468  	c.urlParams_.Set("alt", alt)
  2469  	c.urlParams_.Set("prettyPrint", "false")
  2470  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/findings")
  2471  	urls += "?" + c.urlParams_.Encode()
  2472  	req, err := http.NewRequest("GET", urls, body)
  2473  	if err != nil {
  2474  		return nil, err
  2475  	}
  2476  	req.Header = reqHeaders
  2477  	googleapi.Expand(req.URL, map[string]string{
  2478  		"parent": c.parent,
  2479  	})
  2480  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2481  }
  2482  
  2483  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findings.list" call.
  2484  // Any non-2xx status code is an error. Response headers are in either
  2485  // *ListFindingsResponse.ServerResponse.Header or (if a response was returned
  2486  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2487  // check whether the returned error was because http.StatusNotModified was
  2488  // returned.
  2489  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) {
  2490  	gensupport.SetOptions(c.urlParams_, opts...)
  2491  	res, err := c.doRequest("json")
  2492  	if res != nil && res.StatusCode == http.StatusNotModified {
  2493  		if res.Body != nil {
  2494  			res.Body.Close()
  2495  		}
  2496  		return nil, gensupport.WrapError(&googleapi.Error{
  2497  			Code:   res.StatusCode,
  2498  			Header: res.Header,
  2499  		})
  2500  	}
  2501  	if err != nil {
  2502  		return nil, err
  2503  	}
  2504  	defer googleapi.CloseBody(res)
  2505  	if err := googleapi.CheckResponse(res); err != nil {
  2506  		return nil, gensupport.WrapError(err)
  2507  	}
  2508  	ret := &ListFindingsResponse{
  2509  		ServerResponse: googleapi.ServerResponse{
  2510  			Header:         res.Header,
  2511  			HTTPStatusCode: res.StatusCode,
  2512  		},
  2513  	}
  2514  	target := &ret
  2515  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2516  		return nil, err
  2517  	}
  2518  	return ret, nil
  2519  }
  2520  
  2521  // Pages invokes f for each page of results.
  2522  // A non-nil error returned from f will halt the iteration.
  2523  // The provided context supersedes any context provided to the Context method.
  2524  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error {
  2525  	c.ctx_ = ctx
  2526  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2527  	for {
  2528  		x, err := c.Do()
  2529  		if err != nil {
  2530  			return err
  2531  		}
  2532  		if err := f(x); err != nil {
  2533  			return err
  2534  		}
  2535  		if x.NextPageToken == "" {
  2536  			return nil
  2537  		}
  2538  		c.PageToken(x.NextPageToken)
  2539  	}
  2540  }
  2541  

View as plain text