...

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

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

     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/v1beta"
    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/v1beta"
    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:v1beta"
    90  const apiName = "websecurityscanner"
    91  const apiVersion = "v1beta"
    92  const basePath = "https://websecurityscanner.googleapis.com/"
    93  const basePathTemplate = "https://websecurityscanner.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://websecurityscanner.mtls.googleapis.com/"
    95  
    96  // 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  	// IapCredential: Authentication using Identity-Aware-Proxy (IAP).
   233  	IapCredential *IapCredential `json:"iapCredential,omitempty"`
   234  	// ForceSendFields is a list of field names (e.g. "CustomAccount") to
   235  	// unconditionally include in API requests. By default, fields with empty or
   236  	// default values are omitted from API requests. See
   237  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   238  	// details.
   239  	ForceSendFields []string `json:"-"`
   240  	// NullFields is a list of field names (e.g. "CustomAccount") to include in API
   241  	// requests with the JSON null value. By default, fields with empty values are
   242  	// omitted from API requests. See
   243  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   244  	NullFields []string `json:"-"`
   245  }
   246  
   247  func (s *Authentication) MarshalJSON() ([]byte, error) {
   248  	type NoMethod Authentication
   249  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   250  }
   251  
   252  // CrawledUrl: A CrawledUrl resource represents a URL that was crawled during a
   253  // ScanRun. Web Security Scanner Service crawls the web applications, following
   254  // all links within the scope of sites, to find the URLs to test against.
   255  type CrawledUrl struct {
   256  	// Body: The body of the request that was used to visit the URL.
   257  	Body string `json:"body,omitempty"`
   258  	// HttpMethod: The http method of the request that was used to visit the URL,
   259  	// in uppercase.
   260  	HttpMethod string `json:"httpMethod,omitempty"`
   261  	// Url: The URL that was crawled.
   262  	Url string `json:"url,omitempty"`
   263  	// ForceSendFields is a list of field names (e.g. "Body") to unconditionally
   264  	// include in API requests. By default, fields with empty or default values are
   265  	// omitted from API requests. See
   266  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   267  	// details.
   268  	ForceSendFields []string `json:"-"`
   269  	// NullFields is a list of field names (e.g. "Body") to include in API requests
   270  	// with the JSON null value. By default, fields with empty values are omitted
   271  	// from API requests. See
   272  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   273  	NullFields []string `json:"-"`
   274  }
   275  
   276  func (s *CrawledUrl) MarshalJSON() ([]byte, error) {
   277  	type NoMethod CrawledUrl
   278  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   279  }
   280  
   281  // CustomAccount: Describes authentication configuration that uses a custom
   282  // account.
   283  type CustomAccount struct {
   284  	// LoginUrl: Required. The login form URL of the website.
   285  	LoginUrl string `json:"loginUrl,omitempty"`
   286  	// Password: Required. Input only. The password of the custom account. The
   287  	// credential is stored encrypted and not returned in any response nor included
   288  	// in audit logs.
   289  	Password string `json:"password,omitempty"`
   290  	// Username: Required. The user name of the custom account.
   291  	Username string `json:"username,omitempty"`
   292  	// ForceSendFields is a list of field names (e.g. "LoginUrl") to
   293  	// unconditionally include in API requests. By default, fields with empty or
   294  	// default values are omitted from API requests. See
   295  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   296  	// details.
   297  	ForceSendFields []string `json:"-"`
   298  	// NullFields is a list of field names (e.g. "LoginUrl") to include in API
   299  	// requests with the JSON null value. By default, fields with empty values are
   300  	// omitted from API requests. See
   301  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   302  	NullFields []string `json:"-"`
   303  }
   304  
   305  func (s *CustomAccount) MarshalJSON() ([]byte, error) {
   306  	type NoMethod CustomAccount
   307  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   308  }
   309  
   310  // Empty: A generic empty message that you can re-use to avoid defining
   311  // duplicated empty messages in your APIs. A typical example is to use it as
   312  // the request or the response type of an API method. For instance: service Foo
   313  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   314  type Empty struct {
   315  	// ServerResponse contains the HTTP response code and headers from the server.
   316  	googleapi.ServerResponse `json:"-"`
   317  }
   318  
   319  // Finding: A Finding resource represents a vulnerability instance identified
   320  // during a ScanRun.
   321  type Finding struct {
   322  	// Body: The body of the request that triggered the vulnerability.
   323  	Body string `json:"body,omitempty"`
   324  	// Description: The description of the vulnerability.
   325  	Description string `json:"description,omitempty"`
   326  	// FinalUrl: The URL where the browser lands when the vulnerability is
   327  	// detected.
   328  	FinalUrl string `json:"finalUrl,omitempty"`
   329  	// FindingType: The type of the Finding. Detailed and up-to-date information on
   330  	// findings can be found here:
   331  	// https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner
   332  	FindingType string `json:"findingType,omitempty"`
   333  	// Form: An addon containing information reported for a vulnerability with an
   334  	// HTML form, if any.
   335  	Form *Form `json:"form,omitempty"`
   336  	// FrameUrl: If the vulnerability was originated from nested IFrame, the
   337  	// immediate parent IFrame is reported.
   338  	FrameUrl string `json:"frameUrl,omitempty"`
   339  	// FuzzedUrl: The URL produced by the server-side fuzzer and used in the
   340  	// request that triggered the vulnerability.
   341  	FuzzedUrl string `json:"fuzzedUrl,omitempty"`
   342  	// HttpMethod: The http method of the request that triggered the vulnerability,
   343  	// in uppercase.
   344  	HttpMethod string `json:"httpMethod,omitempty"`
   345  	// Name: The resource name of the Finding. The name follows the format of
   346  	// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/finding
   347  	// s/{findingId}'. The finding IDs are generated by the system.
   348  	Name string `json:"name,omitempty"`
   349  	// OutdatedLibrary: An addon containing information about outdated libraries.
   350  	OutdatedLibrary *OutdatedLibrary `json:"outdatedLibrary,omitempty"`
   351  	// ReproductionUrl: The URL containing human-readable payload that user can
   352  	// leverage to reproduce the vulnerability.
   353  	ReproductionUrl string `json:"reproductionUrl,omitempty"`
   354  	// Severity: The severity level of the reported vulnerability.
   355  	//
   356  	// Possible values:
   357  	//   "SEVERITY_UNSPECIFIED" - No severity specified. The default value.
   358  	//   "CRITICAL" - Critical severity.
   359  	//   "HIGH" - High severity.
   360  	//   "MEDIUM" - Medium severity.
   361  	//   "LOW" - Low severity.
   362  	Severity string `json:"severity,omitempty"`
   363  	// TrackingId: The tracking ID uniquely identifies a vulnerability instance
   364  	// across multiple ScanRuns.
   365  	TrackingId string `json:"trackingId,omitempty"`
   366  	// ViolatingResource: An addon containing detailed information regarding any
   367  	// resource causing the vulnerability such as JavaScript sources, image, audio
   368  	// files, etc.
   369  	ViolatingResource *ViolatingResource `json:"violatingResource,omitempty"`
   370  	// VulnerableHeaders: An addon containing information about vulnerable or
   371  	// missing HTTP headers.
   372  	VulnerableHeaders *VulnerableHeaders `json:"vulnerableHeaders,omitempty"`
   373  	// VulnerableParameters: An addon containing information about request
   374  	// parameters which were found to be vulnerable.
   375  	VulnerableParameters *VulnerableParameters `json:"vulnerableParameters,omitempty"`
   376  	// Xss: An addon containing information reported for an XSS, if any.
   377  	Xss *Xss `json:"xss,omitempty"`
   378  	// Xxe: An addon containing information reported for an XXE, if any.
   379  	Xxe *Xxe `json:"xxe,omitempty"`
   380  
   381  	// ServerResponse contains the HTTP response code and headers from the server.
   382  	googleapi.ServerResponse `json:"-"`
   383  	// ForceSendFields is a list of field names (e.g. "Body") to unconditionally
   384  	// include in API requests. By default, fields with empty or default values are
   385  	// omitted from API requests. See
   386  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   387  	// details.
   388  	ForceSendFields []string `json:"-"`
   389  	// NullFields is a list of field names (e.g. "Body") to include in API requests
   390  	// with the JSON null value. By default, fields with empty values are omitted
   391  	// from API requests. See
   392  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   393  	NullFields []string `json:"-"`
   394  }
   395  
   396  func (s *Finding) MarshalJSON() ([]byte, error) {
   397  	type NoMethod Finding
   398  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   399  }
   400  
   401  // FindingTypeStats: A FindingTypeStats resource represents stats regarding a
   402  // specific FindingType of Findings under a given ScanRun.
   403  type FindingTypeStats struct {
   404  	// FindingCount: The count of findings belonging to this finding type.
   405  	FindingCount int64 `json:"findingCount,omitempty"`
   406  	// FindingType: The finding type associated with the stats.
   407  	FindingType string `json:"findingType,omitempty"`
   408  	// ForceSendFields is a list of field names (e.g. "FindingCount") to
   409  	// unconditionally include in API requests. By default, fields with empty or
   410  	// default values are omitted from API requests. See
   411  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   412  	// details.
   413  	ForceSendFields []string `json:"-"`
   414  	// NullFields is a list of field names (e.g. "FindingCount") to include in API
   415  	// requests with the JSON null value. By default, fields with empty values are
   416  	// omitted from API requests. See
   417  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   418  	NullFields []string `json:"-"`
   419  }
   420  
   421  func (s *FindingTypeStats) MarshalJSON() ([]byte, error) {
   422  	type NoMethod FindingTypeStats
   423  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   424  }
   425  
   426  // Form: ! Information about a vulnerability with an HTML.
   427  type Form struct {
   428  	// ActionUri: ! The URI where to send the form when it's submitted.
   429  	ActionUri string `json:"actionUri,omitempty"`
   430  	// Fields: ! The names of form fields related to the vulnerability.
   431  	Fields []string `json:"fields,omitempty"`
   432  	// ForceSendFields is a list of field names (e.g. "ActionUri") to
   433  	// unconditionally include in API requests. By default, fields with empty or
   434  	// default values are omitted from API requests. See
   435  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   436  	// details.
   437  	ForceSendFields []string `json:"-"`
   438  	// NullFields is a list of field names (e.g. "ActionUri") to include in API
   439  	// requests with the JSON null value. By default, fields with empty values are
   440  	// omitted from API requests. See
   441  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   442  	NullFields []string `json:"-"`
   443  }
   444  
   445  func (s *Form) MarshalJSON() ([]byte, error) {
   446  	type NoMethod Form
   447  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   448  }
   449  
   450  // GoogleAccount: Describes authentication configuration that uses a Google
   451  // account.
   452  type GoogleAccount struct {
   453  	// Password: Required. Input only. The password of the Google account. The
   454  	// credential is stored encrypted and not returned in any response nor included
   455  	// in audit logs.
   456  	Password string `json:"password,omitempty"`
   457  	// Username: Required. The user name of the Google account.
   458  	Username string `json:"username,omitempty"`
   459  	// ForceSendFields is a list of field names (e.g. "Password") to
   460  	// unconditionally include in API requests. By default, fields with empty or
   461  	// default values are omitted from API requests. See
   462  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   463  	// details.
   464  	ForceSendFields []string `json:"-"`
   465  	// NullFields is a list of field names (e.g. "Password") to include in API
   466  	// requests with the JSON null value. By default, fields with empty values are
   467  	// omitted from API requests. See
   468  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   469  	NullFields []string `json:"-"`
   470  }
   471  
   472  func (s *GoogleAccount) MarshalJSON() ([]byte, error) {
   473  	type NoMethod GoogleAccount
   474  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   475  }
   476  
   477  // Header: Describes a HTTP Header.
   478  type Header struct {
   479  	// Name: Header name.
   480  	Name string `json:"name,omitempty"`
   481  	// Value: Header value.
   482  	Value string `json:"value,omitempty"`
   483  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   484  	// include in API requests. By default, fields with empty or default values are
   485  	// omitted from API requests. See
   486  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   487  	// details.
   488  	ForceSendFields []string `json:"-"`
   489  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   490  	// with the JSON null value. By default, fields with empty values are omitted
   491  	// from API requests. See
   492  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   493  	NullFields []string `json:"-"`
   494  }
   495  
   496  func (s *Header) MarshalJSON() ([]byte, error) {
   497  	type NoMethod Header
   498  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   499  }
   500  
   501  // IapCredential: Describes authentication configuration for
   502  // Identity-Aware-Proxy (IAP).
   503  type IapCredential struct {
   504  	// IapTestServiceAccountInfo: Authentication configuration when
   505  	// Web-Security-Scanner service account is added in Identity-Aware-Proxy (IAP)
   506  	// access policies.
   507  	IapTestServiceAccountInfo *IapTestServiceAccountInfo `json:"iapTestServiceAccountInfo,omitempty"`
   508  	// ForceSendFields is a list of field names (e.g. "IapTestServiceAccountInfo")
   509  	// to unconditionally include in API requests. By default, fields with empty or
   510  	// default values are omitted from API requests. See
   511  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   512  	// details.
   513  	ForceSendFields []string `json:"-"`
   514  	// NullFields is a list of field names (e.g. "IapTestServiceAccountInfo") to
   515  	// include in API requests with the JSON null value. By default, fields with
   516  	// empty values are omitted from API requests. See
   517  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   518  	NullFields []string `json:"-"`
   519  }
   520  
   521  func (s *IapCredential) MarshalJSON() ([]byte, error) {
   522  	type NoMethod IapCredential
   523  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   524  }
   525  
   526  // IapTestServiceAccountInfo: Describes authentication configuration when
   527  // Web-Security-Scanner service account is added in Identity-Aware-Proxy (IAP)
   528  // access policies.
   529  type IapTestServiceAccountInfo struct {
   530  	// TargetAudienceClientId: Required. Describes OAuth2 Client ID of resources
   531  	// protected by Identity-Aware-Proxy(IAP).
   532  	TargetAudienceClientId string `json:"targetAudienceClientId,omitempty"`
   533  	// ForceSendFields is a list of field names (e.g. "TargetAudienceClientId") to
   534  	// unconditionally include in API requests. By default, fields with empty or
   535  	// default values are omitted from API requests. See
   536  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   537  	// details.
   538  	ForceSendFields []string `json:"-"`
   539  	// NullFields is a list of field names (e.g. "TargetAudienceClientId") to
   540  	// include in API requests with the JSON null value. By default, fields with
   541  	// empty values are omitted from API requests. See
   542  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   543  	NullFields []string `json:"-"`
   544  }
   545  
   546  func (s *IapTestServiceAccountInfo) MarshalJSON() ([]byte, error) {
   547  	type NoMethod IapTestServiceAccountInfo
   548  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   549  }
   550  
   551  // ListCrawledUrlsResponse: Response for the `ListCrawledUrls` method.
   552  type ListCrawledUrlsResponse struct {
   553  	// CrawledUrls: The list of CrawledUrls returned.
   554  	CrawledUrls []*CrawledUrl `json:"crawledUrls,omitempty"`
   555  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   556  	// are no more results in the list.
   557  	NextPageToken string `json:"nextPageToken,omitempty"`
   558  
   559  	// ServerResponse contains the HTTP response code and headers from the server.
   560  	googleapi.ServerResponse `json:"-"`
   561  	// ForceSendFields is a list of field names (e.g. "CrawledUrls") to
   562  	// unconditionally include in API requests. By default, fields with empty or
   563  	// default values are omitted from API requests. See
   564  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   565  	// details.
   566  	ForceSendFields []string `json:"-"`
   567  	// NullFields is a list of field names (e.g. "CrawledUrls") to include in API
   568  	// requests with the JSON null value. By default, fields with empty values are
   569  	// omitted from API requests. See
   570  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   571  	NullFields []string `json:"-"`
   572  }
   573  
   574  func (s *ListCrawledUrlsResponse) MarshalJSON() ([]byte, error) {
   575  	type NoMethod ListCrawledUrlsResponse
   576  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   577  }
   578  
   579  // ListFindingTypeStatsResponse: Response for the `ListFindingTypeStats`
   580  // method.
   581  type ListFindingTypeStatsResponse struct {
   582  	// FindingTypeStats: The list of FindingTypeStats returned.
   583  	FindingTypeStats []*FindingTypeStats `json:"findingTypeStats,omitempty"`
   584  
   585  	// ServerResponse contains the HTTP response code and headers from the server.
   586  	googleapi.ServerResponse `json:"-"`
   587  	// ForceSendFields is a list of field names (e.g. "FindingTypeStats") to
   588  	// unconditionally include in API requests. By default, fields with empty or
   589  	// default values are omitted from API requests. See
   590  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   591  	// details.
   592  	ForceSendFields []string `json:"-"`
   593  	// NullFields is a list of field names (e.g. "FindingTypeStats") to include in
   594  	// API requests with the JSON null value. By default, fields with empty values
   595  	// are omitted from API requests. See
   596  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   597  	NullFields []string `json:"-"`
   598  }
   599  
   600  func (s *ListFindingTypeStatsResponse) MarshalJSON() ([]byte, error) {
   601  	type NoMethod ListFindingTypeStatsResponse
   602  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   603  }
   604  
   605  // ListFindingsResponse: Response for the `ListFindings` method.
   606  type ListFindingsResponse struct {
   607  	// Findings: The list of Findings returned.
   608  	Findings []*Finding `json:"findings,omitempty"`
   609  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   610  	// are no more results in the list.
   611  	NextPageToken string `json:"nextPageToken,omitempty"`
   612  
   613  	// ServerResponse contains the HTTP response code and headers from the server.
   614  	googleapi.ServerResponse `json:"-"`
   615  	// ForceSendFields is a list of field names (e.g. "Findings") to
   616  	// unconditionally include in API requests. By default, fields with empty or
   617  	// default values are omitted from API requests. See
   618  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   619  	// details.
   620  	ForceSendFields []string `json:"-"`
   621  	// NullFields is a list of field names (e.g. "Findings") to include in API
   622  	// requests with the JSON null value. By default, fields with empty values are
   623  	// omitted from API requests. See
   624  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   625  	NullFields []string `json:"-"`
   626  }
   627  
   628  func (s *ListFindingsResponse) MarshalJSON() ([]byte, error) {
   629  	type NoMethod ListFindingsResponse
   630  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   631  }
   632  
   633  // ListScanConfigsResponse: Response for the `ListScanConfigs` method.
   634  type ListScanConfigsResponse struct {
   635  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   636  	// are no more results in the list.
   637  	NextPageToken string `json:"nextPageToken,omitempty"`
   638  	// ScanConfigs: The list of ScanConfigs returned.
   639  	ScanConfigs []*ScanConfig `json:"scanConfigs,omitempty"`
   640  
   641  	// ServerResponse contains the HTTP response code and headers from the server.
   642  	googleapi.ServerResponse `json:"-"`
   643  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   644  	// unconditionally include in API requests. By default, fields with empty or
   645  	// default values are omitted from API requests. See
   646  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   647  	// details.
   648  	ForceSendFields []string `json:"-"`
   649  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   650  	// requests with the JSON null value. By default, fields with empty values are
   651  	// omitted from API requests. See
   652  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   653  	NullFields []string `json:"-"`
   654  }
   655  
   656  func (s *ListScanConfigsResponse) MarshalJSON() ([]byte, error) {
   657  	type NoMethod ListScanConfigsResponse
   658  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   659  }
   660  
   661  // ListScanRunsResponse: Response for the `ListScanRuns` method.
   662  type ListScanRunsResponse struct {
   663  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   664  	// are no more results in the list.
   665  	NextPageToken string `json:"nextPageToken,omitempty"`
   666  	// ScanRuns: The list of ScanRuns returned.
   667  	ScanRuns []*ScanRun `json:"scanRuns,omitempty"`
   668  
   669  	// ServerResponse contains the HTTP response code and headers from the server.
   670  	googleapi.ServerResponse `json:"-"`
   671  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   672  	// unconditionally include in API requests. By default, fields with empty or
   673  	// default values are omitted from API requests. See
   674  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   675  	// details.
   676  	ForceSendFields []string `json:"-"`
   677  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   678  	// requests with the JSON null value. By default, fields with empty values are
   679  	// omitted from API requests. See
   680  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   681  	NullFields []string `json:"-"`
   682  }
   683  
   684  func (s *ListScanRunsResponse) MarshalJSON() ([]byte, error) {
   685  	type NoMethod ListScanRunsResponse
   686  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   687  }
   688  
   689  // OutdatedLibrary: Information reported for an outdated library.
   690  type OutdatedLibrary struct {
   691  	// LearnMoreUrls: URLs to learn more information about the vulnerabilities in
   692  	// the library.
   693  	LearnMoreUrls []string `json:"learnMoreUrls,omitempty"`
   694  	// LibraryName: The name of the outdated library.
   695  	LibraryName string `json:"libraryName,omitempty"`
   696  	// Version: The version number.
   697  	Version string `json:"version,omitempty"`
   698  	// ForceSendFields is a list of field names (e.g. "LearnMoreUrls") to
   699  	// unconditionally include in API requests. By default, fields with empty or
   700  	// default values are omitted from API requests. See
   701  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   702  	// details.
   703  	ForceSendFields []string `json:"-"`
   704  	// NullFields is a list of field names (e.g. "LearnMoreUrls") to include in API
   705  	// requests with the JSON null value. By default, fields with empty values are
   706  	// omitted from API requests. See
   707  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   708  	NullFields []string `json:"-"`
   709  }
   710  
   711  func (s *OutdatedLibrary) MarshalJSON() ([]byte, error) {
   712  	type NoMethod OutdatedLibrary
   713  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   714  }
   715  
   716  // ScanConfig: A ScanConfig resource contains the configurations to launch a
   717  // scan.
   718  type ScanConfig struct {
   719  	// Authentication: The authentication configuration. If specified, service will
   720  	// use the authentication configuration during scanning.
   721  	Authentication *Authentication `json:"authentication,omitempty"`
   722  	// BlacklistPatterns: The excluded URL patterns as described in
   723  	// https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
   724  	BlacklistPatterns []string `json:"blacklistPatterns,omitempty"`
   725  	// DisplayName: Required. The user provided display name of the ScanConfig.
   726  	DisplayName string `json:"displayName,omitempty"`
   727  	// ExportToSecurityCommandCenter: Controls export of scan configurations and
   728  	// results to Security Command Center.
   729  	//
   730  	// Possible values:
   731  	//   "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED" - Use default, which is
   732  	// ENABLED.
   733  	//   "ENABLED" - Export results of this scan to Security Command Center.
   734  	//   "DISABLED" - Do not export results of this scan to Security Command
   735  	// Center.
   736  	ExportToSecurityCommandCenter string `json:"exportToSecurityCommandCenter,omitempty"`
   737  	// IgnoreHttpStatusErrors: Whether to keep scanning even if most requests
   738  	// return HTTP error codes.
   739  	IgnoreHttpStatusErrors bool `json:"ignoreHttpStatusErrors,omitempty"`
   740  	// LatestRun: Latest ScanRun if available.
   741  	LatestRun *ScanRun `json:"latestRun,omitempty"`
   742  	// ManagedScan: Whether the scan config is managed by Web Security Scanner,
   743  	// output only.
   744  	ManagedScan bool `json:"managedScan,omitempty"`
   745  	// MaxQps: The maximum QPS during scanning. A valid value ranges from 5 to 20
   746  	// inclusively. If the field is unspecified or its value is set 0, server will
   747  	// default to 15. Other values outside of [5, 20] range will be rejected with
   748  	// INVALID_ARGUMENT error.
   749  	MaxQps int64 `json:"maxQps,omitempty"`
   750  	// Name: The resource name of the ScanConfig. The name follows the format of
   751  	// 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
   752  	// generated by the system.
   753  	Name string `json:"name,omitempty"`
   754  	// RiskLevel: The risk level selected for the scan
   755  	//
   756  	// Possible values:
   757  	//   "RISK_LEVEL_UNSPECIFIED" - Use default, which is NORMAL.
   758  	//   "NORMAL" - Normal scanning (Recommended)
   759  	//   "LOW" - Lower impact scanning
   760  	RiskLevel string `json:"riskLevel,omitempty"`
   761  	// Schedule: The schedule of the ScanConfig.
   762  	Schedule *Schedule `json:"schedule,omitempty"`
   763  	// StartingUrls: Required. The starting URLs from which the scanner finds site
   764  	// pages.
   765  	StartingUrls []string `json:"startingUrls,omitempty"`
   766  	// StaticIpScan: Whether the scan configuration has enabled static IP address
   767  	// scan feature. If enabled, the scanner will access applications from static
   768  	// IP addresses.
   769  	StaticIpScan bool `json:"staticIpScan,omitempty"`
   770  	// TargetPlatforms: Set of Google Cloud platforms targeted by the scan. If
   771  	// empty, APP_ENGINE will be used as a default.
   772  	//
   773  	// Possible values:
   774  	//   "TARGET_PLATFORM_UNSPECIFIED" - The target platform is unknown. Requests
   775  	// with this enum value will be rejected with INVALID_ARGUMENT error.
   776  	//   "APP_ENGINE" - Google App Engine service.
   777  	//   "COMPUTE" - Google Compute Engine service.
   778  	//   "CLOUD_RUN" - Google Cloud Run service.
   779  	//   "CLOUD_FUNCTIONS" - Google Cloud Function service.
   780  	TargetPlatforms []string `json:"targetPlatforms,omitempty"`
   781  	// UserAgent: The user agent used during scanning.
   782  	//
   783  	// Possible values:
   784  	//   "USER_AGENT_UNSPECIFIED" - The user agent is unknown. Service will default
   785  	// to CHROME_LINUX.
   786  	//   "CHROME_LINUX" - Chrome on Linux. This is the service default if
   787  	// unspecified.
   788  	//   "CHROME_ANDROID" - Chrome on Android.
   789  	//   "SAFARI_IPHONE" - Safari on IPhone.
   790  	UserAgent string `json:"userAgent,omitempty"`
   791  
   792  	// ServerResponse contains the HTTP response code and headers from the server.
   793  	googleapi.ServerResponse `json:"-"`
   794  	// ForceSendFields is a list of field names (e.g. "Authentication") to
   795  	// unconditionally include in API requests. By default, fields with empty or
   796  	// default values are omitted from API requests. See
   797  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   798  	// details.
   799  	ForceSendFields []string `json:"-"`
   800  	// NullFields is a list of field names (e.g. "Authentication") to include in
   801  	// API requests with the JSON null value. By default, fields with empty values
   802  	// are omitted from API requests. See
   803  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   804  	NullFields []string `json:"-"`
   805  }
   806  
   807  func (s *ScanConfig) MarshalJSON() ([]byte, error) {
   808  	type NoMethod ScanConfig
   809  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   810  }
   811  
   812  // ScanConfigError: Defines a custom error message used by CreateScanConfig and
   813  // UpdateScanConfig APIs when scan configuration validation fails. It is also
   814  // reported as part of a ScanRunErrorTrace message if scan validation fails due
   815  // to a scan configuration error.
   816  type ScanConfigError struct {
   817  	// Code: Indicates the reason code for a configuration failure.
   818  	//
   819  	// Possible values:
   820  	//   "CODE_UNSPECIFIED" - There is no error.
   821  	//   "OK" - There is no error.
   822  	//   "INTERNAL_ERROR" - Indicates an internal server error. Please DO NOT USE
   823  	// THIS ERROR CODE unless the root cause is truly unknown.
   824  	//   "APPENGINE_API_BACKEND_ERROR" - One of the seed URLs is an App Engine URL
   825  	// but we cannot validate the scan settings due to an App Engine API backend
   826  	// error.
   827  	//   "APPENGINE_API_NOT_ACCESSIBLE" - One of the seed URLs is an App Engine URL
   828  	// but we cannot access the App Engine API to validate scan settings.
   829  	//   "APPENGINE_DEFAULT_HOST_MISSING" - One of the seed URLs is an App Engine
   830  	// URL but the Default Host of the App Engine is not set.
   831  	//   "CANNOT_USE_GOOGLE_COM_ACCOUNT" - Google corporate accounts can not be
   832  	// used for scanning.
   833  	//   "CANNOT_USE_OWNER_ACCOUNT" - The account of the scan creator can not be
   834  	// used for scanning.
   835  	//   "COMPUTE_API_BACKEND_ERROR" - This scan targets Compute Engine, but we
   836  	// cannot validate scan settings due to a Compute Engine API backend error.
   837  	//   "COMPUTE_API_NOT_ACCESSIBLE" - This scan targets Compute Engine, but we
   838  	// cannot access the Compute Engine API to validate the scan settings.
   839  	//   "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT" - The Custom Login
   840  	// URL does not belong to the current project.
   841  	//   "CUSTOM_LOGIN_URL_MALFORMED" - The Custom Login URL is malformed (can not
   842  	// be parsed).
   843  	//   "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS" - The Custom Login URL
   844  	// is mapped to a non-routable IP address in DNS.
   845  	//   "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS" - The Custom Login URL is
   846  	// mapped to an IP address which is not reserved for the current project.
   847  	//   "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS" - The Custom Login URL has
   848  	// a non-routable IP address.
   849  	//   "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS" - The Custom Login URL has an
   850  	// IP address which is not reserved for the current project.
   851  	//   "DUPLICATE_SCAN_NAME" - Another scan with the same name (case-sensitive)
   852  	// already exists.
   853  	//   "INVALID_FIELD_VALUE" - A field is set to an invalid value.
   854  	//   "FAILED_TO_AUTHENTICATE_TO_TARGET" - There was an error trying to
   855  	// authenticate to the scan target.
   856  	//   "FINDING_TYPE_UNSPECIFIED" - Finding type value is not specified in the
   857  	// list findings request.
   858  	//   "FORBIDDEN_TO_SCAN_COMPUTE" - Scan targets Compute Engine, yet current
   859  	// project was not whitelisted for Google Compute Engine Scanning Alpha access.
   860  	//   "FORBIDDEN_UPDATE_TO_MANAGED_SCAN" - User tries to update managed scan
   861  	//   "MALFORMED_FILTER" - The supplied filter is malformed. For example, it can
   862  	// not be parsed, does not have a filter type in expression, or the same filter
   863  	// type appears more than once.
   864  	//   "MALFORMED_RESOURCE_NAME" - The supplied resource name is malformed (can
   865  	// not be parsed).
   866  	//   "PROJECT_INACTIVE" - The current project is not in an active state.
   867  	//   "REQUIRED_FIELD" - A required field is not set.
   868  	//   "RESOURCE_NAME_INCONSISTENT" - Project id, scanconfig id, scanrun id, or
   869  	// finding id are not consistent with each other in resource name.
   870  	//   "SCAN_ALREADY_RUNNING" - The scan being requested to start is already
   871  	// running.
   872  	//   "SCAN_NOT_RUNNING" - The scan that was requested to be stopped is not
   873  	// running.
   874  	//   "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT" - One of the seed URLs does
   875  	// not belong to the current project.
   876  	//   "SEED_URL_MALFORMED" - One of the seed URLs is malformed (can not be
   877  	// parsed).
   878  	//   "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS" - One of the seed URLs is mapped
   879  	// to a non-routable IP address in DNS.
   880  	//   "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS" - One of the seed URLs is mapped
   881  	// to an IP address which is not reserved for the current project.
   882  	//   "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS" - One of the seed URLs has
   883  	// on-routable IP address.
   884  	//   "SEED_URL_HAS_UNRESERVED_IP_ADDRESS" - One of the seed URLs has an IP
   885  	// address that is not reserved for the current project.
   886  	//   "SERVICE_ACCOUNT_NOT_CONFIGURED" - The Web Security Scanner service
   887  	// account is not configured under the project.
   888  	//   "TOO_MANY_SCANS" - A project has reached the maximum number of scans.
   889  	//   "UNABLE_TO_RESOLVE_PROJECT_INFO" - Resolving the details of the current
   890  	// project fails.
   891  	//   "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT" - One or more blacklist patterns
   892  	// were in the wrong format.
   893  	//   "UNSUPPORTED_FILTER" - The supplied filter is not supported.
   894  	//   "UNSUPPORTED_FINDING_TYPE" - The supplied finding type is not supported.
   895  	// For example, we do not provide findings of the given finding type.
   896  	//   "UNSUPPORTED_URL_SCHEME" - The URL scheme of one or more of the supplied
   897  	// URLs is not supported.
   898  	//   "CLOUD_ASSET_INVENTORY_ASSET_NOT_FOUND" - CAI is not able to list assets.
   899  	Code string `json:"code,omitempty"`
   900  	// FieldName: Indicates the full name of the ScanConfig field that triggers
   901  	// this error, for example "scan_config.max_qps". This field is provided for
   902  	// troubleshooting purposes only and its actual value can change in the future.
   903  	FieldName string `json:"fieldName,omitempty"`
   904  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   905  	// include in API requests. By default, fields with empty or default values are
   906  	// omitted from API requests. See
   907  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   908  	// details.
   909  	ForceSendFields []string `json:"-"`
   910  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   911  	// with the JSON null value. By default, fields with empty values are omitted
   912  	// from API requests. See
   913  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   914  	NullFields []string `json:"-"`
   915  }
   916  
   917  func (s *ScanConfigError) MarshalJSON() ([]byte, error) {
   918  	type NoMethod ScanConfigError
   919  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   920  }
   921  
   922  // ScanRun: A ScanRun is a output-only resource representing an actual run of
   923  // the scan. Next id: 12
   924  type ScanRun struct {
   925  	// EndTime: The time at which the ScanRun reached termination state - that the
   926  	// ScanRun is either finished or stopped by user.
   927  	EndTime string `json:"endTime,omitempty"`
   928  	// ErrorTrace: If result_state is an ERROR, this field provides the primary
   929  	// reason for scan's termination and more details, if such are available.
   930  	ErrorTrace *ScanRunErrorTrace `json:"errorTrace,omitempty"`
   931  	// ExecutionState: The execution state of the ScanRun.
   932  	//
   933  	// Possible values:
   934  	//   "EXECUTION_STATE_UNSPECIFIED" - Represents an invalid state caused by
   935  	// internal server error. This value should never be returned.
   936  	//   "QUEUED" - The scan is waiting in the queue.
   937  	//   "SCANNING" - The scan is in progress.
   938  	//   "FINISHED" - The scan is either finished or stopped by user.
   939  	ExecutionState string `json:"executionState,omitempty"`
   940  	// HasVulnerabilities: Whether the scan run has found any vulnerabilities.
   941  	HasVulnerabilities bool `json:"hasVulnerabilities,omitempty"`
   942  	// Name: The resource name of the ScanRun. The name follows the format of
   943  	// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. The
   944  	// ScanRun IDs are generated by the system.
   945  	Name string `json:"name,omitempty"`
   946  	// ProgressPercent: The percentage of total completion ranging from 0 to 100.
   947  	// If the scan is in queue, the value is 0. If the scan is running, the value
   948  	// ranges from 0 to 100. If the scan is finished, the value is 100.
   949  	ProgressPercent int64 `json:"progressPercent,omitempty"`
   950  	// ResultState: The result state of the ScanRun. This field is only available
   951  	// after the execution state reaches "FINISHED".
   952  	//
   953  	// Possible values:
   954  	//   "RESULT_STATE_UNSPECIFIED" - Default value. This value is returned when
   955  	// the ScanRun is not yet finished.
   956  	//   "SUCCESS" - The scan finished without errors.
   957  	//   "ERROR" - The scan finished with errors.
   958  	//   "KILLED" - The scan was terminated by user.
   959  	ResultState string `json:"resultState,omitempty"`
   960  	// StartTime: The time at which the ScanRun started.
   961  	StartTime string `json:"startTime,omitempty"`
   962  	// UrlsCrawledCount: The number of URLs crawled during this ScanRun. If the
   963  	// scan is in progress, the value represents the number of URLs crawled up to
   964  	// now.
   965  	UrlsCrawledCount int64 `json:"urlsCrawledCount,omitempty,string"`
   966  	// UrlsTestedCount: The number of URLs tested during this ScanRun. If the scan
   967  	// is in progress, the value represents the number of URLs tested up to now.
   968  	// The number of URLs tested is usually larger than the number URLS crawled
   969  	// because typically a crawled URL is tested with multiple test payloads.
   970  	UrlsTestedCount int64 `json:"urlsTestedCount,omitempty,string"`
   971  	// WarningTraces: A list of warnings, if such are encountered during this scan
   972  	// run.
   973  	WarningTraces []*ScanRunWarningTrace `json:"warningTraces,omitempty"`
   974  
   975  	// ServerResponse contains the HTTP response code and headers from the server.
   976  	googleapi.ServerResponse `json:"-"`
   977  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   978  	// include in API requests. By default, fields with empty or default values are
   979  	// omitted from API requests. See
   980  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   981  	// details.
   982  	ForceSendFields []string `json:"-"`
   983  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   984  	// requests with the JSON null value. By default, fields with empty values are
   985  	// omitted from API requests. See
   986  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   987  	NullFields []string `json:"-"`
   988  }
   989  
   990  func (s *ScanRun) MarshalJSON() ([]byte, error) {
   991  	type NoMethod ScanRun
   992  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   993  }
   994  
   995  // ScanRunErrorTrace: Output only. Defines an error trace message for a
   996  // ScanRun.
   997  type ScanRunErrorTrace struct {
   998  	// Code: Indicates the error reason code.
   999  	//
  1000  	// Possible values:
  1001  	//   "CODE_UNSPECIFIED" - Default value is never used.
  1002  	//   "INTERNAL_ERROR" - Indicates that the scan run failed due to an internal
  1003  	// server error.
  1004  	//   "SCAN_CONFIG_ISSUE" - Indicates a scan configuration error, usually due to
  1005  	// outdated ScanConfig settings, such as starting_urls or the DNS
  1006  	// configuration.
  1007  	//   "AUTHENTICATION_CONFIG_ISSUE" - Indicates an authentication error, usually
  1008  	// due to outdated ScanConfig authentication settings.
  1009  	//   "TIMED_OUT_WHILE_SCANNING" - Indicates a scan operation timeout, usually
  1010  	// caused by a very large site.
  1011  	//   "TOO_MANY_REDIRECTS" - Indicates that a scan encountered excessive
  1012  	// redirects, either to authentication or some other page outside of the scan
  1013  	// scope.
  1014  	//   "TOO_MANY_HTTP_ERRORS" - Indicates that a scan encountered numerous errors
  1015  	// from the web site pages. When available, most_common_http_error_code field
  1016  	// indicates the most common HTTP error code encountered during the scan.
  1017  	//   "STARTING_URLS_CRAWL_HTTP_ERRORS" - Indicates that some of the starting
  1018  	// web urls returned HTTP errors during the scan.
  1019  	Code string `json:"code,omitempty"`
  1020  	// MostCommonHttpErrorCode: If the scan encounters TOO_MANY_HTTP_ERRORS, this
  1021  	// field indicates the most common HTTP error code, if such is available. For
  1022  	// example, if this code is 404, the scan has encountered too many NOT_FOUND
  1023  	// responses.
  1024  	MostCommonHttpErrorCode int64 `json:"mostCommonHttpErrorCode,omitempty"`
  1025  	// ScanConfigError: If the scan encounters SCAN_CONFIG_ISSUE error, this field
  1026  	// has the error message encountered during scan configuration validation that
  1027  	// is performed before each scan run.
  1028  	ScanConfigError *ScanConfigError `json:"scanConfigError,omitempty"`
  1029  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1030  	// include in API requests. By default, fields with empty or default values are
  1031  	// omitted from API requests. See
  1032  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1033  	// details.
  1034  	ForceSendFields []string `json:"-"`
  1035  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1036  	// with the JSON null value. By default, fields with empty values are omitted
  1037  	// from API requests. See
  1038  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1039  	NullFields []string `json:"-"`
  1040  }
  1041  
  1042  func (s *ScanRunErrorTrace) MarshalJSON() ([]byte, error) {
  1043  	type NoMethod ScanRunErrorTrace
  1044  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1045  }
  1046  
  1047  // ScanRunWarningTrace: Output only. Defines a warning trace message for
  1048  // ScanRun. Warning traces provide customers with useful information that helps
  1049  // make the scanning process more effective.
  1050  type ScanRunWarningTrace struct {
  1051  	// Code: Indicates the warning code.
  1052  	//
  1053  	// Possible values:
  1054  	//   "CODE_UNSPECIFIED" - Default value is never used.
  1055  	//   "INSUFFICIENT_CRAWL_RESULTS" - Indicates that a scan discovered an
  1056  	// unexpectedly low number of URLs. This is sometimes caused by complex
  1057  	// navigation features or by using a single URL for numerous pages.
  1058  	//   "TOO_MANY_CRAWL_RESULTS" - Indicates that a scan discovered too many URLs
  1059  	// to test, or excessive redundant URLs.
  1060  	//   "TOO_MANY_FUZZ_TASKS" - Indicates that too many tests have been generated
  1061  	// for the scan. Customer should try reducing the number of starting URLs,
  1062  	// increasing the QPS rate, or narrowing down the scope of the scan using the
  1063  	// excluded patterns.
  1064  	//   "BLOCKED_BY_IAP" - Indicates that a scan is blocked by IAP.
  1065  	//   "NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN" - Indicates that no seed is found
  1066  	// for a scan
  1067  	Code string `json:"code,omitempty"`
  1068  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1069  	// include in API requests. By default, fields with empty or default values are
  1070  	// omitted from API requests. See
  1071  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1072  	// details.
  1073  	ForceSendFields []string `json:"-"`
  1074  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1075  	// with the JSON null value. By default, fields with empty values are omitted
  1076  	// from API requests. See
  1077  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1078  	NullFields []string `json:"-"`
  1079  }
  1080  
  1081  func (s *ScanRunWarningTrace) MarshalJSON() ([]byte, error) {
  1082  	type NoMethod ScanRunWarningTrace
  1083  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1084  }
  1085  
  1086  // Schedule: Scan schedule configuration.
  1087  type Schedule struct {
  1088  	// IntervalDurationDays: Required. The duration of time between executions in
  1089  	// days.
  1090  	IntervalDurationDays int64 `json:"intervalDurationDays,omitempty"`
  1091  	// ScheduleTime: A timestamp indicates when the next run will be scheduled. The
  1092  	// value is refreshed by the server after each run. If unspecified, it will
  1093  	// default to current server time, which means the scan will be scheduled to
  1094  	// start immediately.
  1095  	ScheduleTime string `json:"scheduleTime,omitempty"`
  1096  	// ForceSendFields is a list of field names (e.g. "IntervalDurationDays") to
  1097  	// unconditionally include in API requests. By default, fields with empty or
  1098  	// default values are omitted from API requests. See
  1099  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1100  	// details.
  1101  	ForceSendFields []string `json:"-"`
  1102  	// NullFields is a list of field names (e.g. "IntervalDurationDays") to include
  1103  	// in API requests with the JSON null value. By default, fields with empty
  1104  	// values are omitted from API requests. See
  1105  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1106  	NullFields []string `json:"-"`
  1107  }
  1108  
  1109  func (s *Schedule) MarshalJSON() ([]byte, error) {
  1110  	type NoMethod Schedule
  1111  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1112  }
  1113  
  1114  // StartScanRunRequest: Request for the `StartScanRun` method.
  1115  type StartScanRunRequest struct {
  1116  }
  1117  
  1118  // StopScanRunRequest: Request for the `StopScanRun` method.
  1119  type StopScanRunRequest struct {
  1120  }
  1121  
  1122  // ViolatingResource: Information regarding any resource causing the
  1123  // vulnerability such as JavaScript sources, image, audio files, etc.
  1124  type ViolatingResource struct {
  1125  	// ContentType: The MIME type of this resource.
  1126  	ContentType string `json:"contentType,omitempty"`
  1127  	// ResourceUrl: URL of this violating resource.
  1128  	ResourceUrl string `json:"resourceUrl,omitempty"`
  1129  	// ForceSendFields is a list of field names (e.g. "ContentType") to
  1130  	// unconditionally include in API requests. By default, fields with empty or
  1131  	// default values are omitted from API requests. See
  1132  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1133  	// details.
  1134  	ForceSendFields []string `json:"-"`
  1135  	// NullFields is a list of field names (e.g. "ContentType") to include in API
  1136  	// requests with the JSON null value. By default, fields with empty values are
  1137  	// omitted from API requests. See
  1138  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1139  	NullFields []string `json:"-"`
  1140  }
  1141  
  1142  func (s *ViolatingResource) MarshalJSON() ([]byte, error) {
  1143  	type NoMethod ViolatingResource
  1144  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1145  }
  1146  
  1147  // VulnerableHeaders: Information about vulnerable or missing HTTP Headers.
  1148  type VulnerableHeaders struct {
  1149  	// Headers: List of vulnerable headers.
  1150  	Headers []*Header `json:"headers,omitempty"`
  1151  	// MissingHeaders: List of missing headers.
  1152  	MissingHeaders []*Header `json:"missingHeaders,omitempty"`
  1153  	// ForceSendFields is a list of field names (e.g. "Headers") to unconditionally
  1154  	// include in API requests. By default, fields with empty or default values are
  1155  	// omitted from API requests. See
  1156  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1157  	// details.
  1158  	ForceSendFields []string `json:"-"`
  1159  	// NullFields is a list of field names (e.g. "Headers") to include in API
  1160  	// requests with the JSON null value. By default, fields with empty values are
  1161  	// omitted from API requests. See
  1162  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1163  	NullFields []string `json:"-"`
  1164  }
  1165  
  1166  func (s *VulnerableHeaders) MarshalJSON() ([]byte, error) {
  1167  	type NoMethod VulnerableHeaders
  1168  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1169  }
  1170  
  1171  // VulnerableParameters: Information about vulnerable request parameters.
  1172  type VulnerableParameters struct {
  1173  	// ParameterNames: The vulnerable parameter names.
  1174  	ParameterNames []string `json:"parameterNames,omitempty"`
  1175  	// ForceSendFields is a list of field names (e.g. "ParameterNames") to
  1176  	// unconditionally include in API requests. By default, fields with empty or
  1177  	// default values are omitted from API requests. See
  1178  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1179  	// details.
  1180  	ForceSendFields []string `json:"-"`
  1181  	// NullFields is a list of field names (e.g. "ParameterNames") to include in
  1182  	// API requests with the JSON null value. By default, fields with empty values
  1183  	// are omitted from API requests. See
  1184  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1185  	NullFields []string `json:"-"`
  1186  }
  1187  
  1188  func (s *VulnerableParameters) MarshalJSON() ([]byte, error) {
  1189  	type NoMethod VulnerableParameters
  1190  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1191  }
  1192  
  1193  // Xss: Information reported for an XSS.
  1194  type Xss struct {
  1195  	// ErrorMessage: An error message generated by a javascript breakage.
  1196  	ErrorMessage string `json:"errorMessage,omitempty"`
  1197  	// StackTraces: Stack traces leading to the point where the XSS occurred.
  1198  	StackTraces []string `json:"stackTraces,omitempty"`
  1199  	// ForceSendFields is a list of field names (e.g. "ErrorMessage") to
  1200  	// unconditionally include in API requests. By default, fields with empty or
  1201  	// default values are omitted from API requests. See
  1202  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1203  	// details.
  1204  	ForceSendFields []string `json:"-"`
  1205  	// NullFields is a list of field names (e.g. "ErrorMessage") to include in API
  1206  	// requests with the JSON null value. By default, fields with empty values are
  1207  	// omitted from API requests. See
  1208  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1209  	NullFields []string `json:"-"`
  1210  }
  1211  
  1212  func (s *Xss) MarshalJSON() ([]byte, error) {
  1213  	type NoMethod Xss
  1214  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1215  }
  1216  
  1217  // Xxe: Information reported for an XXE.
  1218  type Xxe struct {
  1219  	// PayloadLocation: Location within the request where the payload was placed.
  1220  	//
  1221  	// Possible values:
  1222  	//   "LOCATION_UNSPECIFIED" - Unknown Location.
  1223  	//   "COMPLETE_REQUEST_BODY" - The XML payload replaced the complete request
  1224  	// body.
  1225  	PayloadLocation string `json:"payloadLocation,omitempty"`
  1226  	// PayloadValue: The XML string that triggered the XXE vulnerability.
  1227  	// Non-payload values might be redacted.
  1228  	PayloadValue string `json:"payloadValue,omitempty"`
  1229  	// ForceSendFields is a list of field names (e.g. "PayloadLocation") to
  1230  	// unconditionally include in API requests. By default, fields with empty or
  1231  	// default values are omitted from API requests. See
  1232  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1233  	// details.
  1234  	ForceSendFields []string `json:"-"`
  1235  	// NullFields is a list of field names (e.g. "PayloadLocation") to include in
  1236  	// API requests with the JSON null value. By default, fields with empty values
  1237  	// are omitted from API requests. See
  1238  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1239  	NullFields []string `json:"-"`
  1240  }
  1241  
  1242  func (s *Xxe) MarshalJSON() ([]byte, error) {
  1243  	type NoMethod Xxe
  1244  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1245  }
  1246  
  1247  type ProjectsScanConfigsCreateCall struct {
  1248  	s          *Service
  1249  	parent     string
  1250  	scanconfig *ScanConfig
  1251  	urlParams_ gensupport.URLParams
  1252  	ctx_       context.Context
  1253  	header_    http.Header
  1254  }
  1255  
  1256  // Create: Creates a new ScanConfig.
  1257  //
  1258  //   - parent: The parent resource name where the scan is created, which should
  1259  //     be a project resource name in the format 'projects/{projectId}'.
  1260  func (r *ProjectsScanConfigsService) Create(parent string, scanconfig *ScanConfig) *ProjectsScanConfigsCreateCall {
  1261  	c := &ProjectsScanConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1262  	c.parent = parent
  1263  	c.scanconfig = scanconfig
  1264  	return c
  1265  }
  1266  
  1267  // Fields allows partial responses to be retrieved. See
  1268  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1269  // details.
  1270  func (c *ProjectsScanConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsCreateCall {
  1271  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1272  	return c
  1273  }
  1274  
  1275  // Context sets the context to be used in this call's Do method.
  1276  func (c *ProjectsScanConfigsCreateCall) Context(ctx context.Context) *ProjectsScanConfigsCreateCall {
  1277  	c.ctx_ = ctx
  1278  	return c
  1279  }
  1280  
  1281  // Header returns a http.Header that can be modified by the caller to add
  1282  // headers to the request.
  1283  func (c *ProjectsScanConfigsCreateCall) Header() http.Header {
  1284  	if c.header_ == nil {
  1285  		c.header_ = make(http.Header)
  1286  	}
  1287  	return c.header_
  1288  }
  1289  
  1290  func (c *ProjectsScanConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  1291  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1292  	var body io.Reader = nil
  1293  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
  1294  	if err != nil {
  1295  		return nil, err
  1296  	}
  1297  	c.urlParams_.Set("alt", alt)
  1298  	c.urlParams_.Set("prettyPrint", "false")
  1299  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scanConfigs")
  1300  	urls += "?" + c.urlParams_.Encode()
  1301  	req, err := http.NewRequest("POST", urls, body)
  1302  	if err != nil {
  1303  		return nil, err
  1304  	}
  1305  	req.Header = reqHeaders
  1306  	googleapi.Expand(req.URL, map[string]string{
  1307  		"parent": c.parent,
  1308  	})
  1309  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1310  }
  1311  
  1312  // Do executes the "websecurityscanner.projects.scanConfigs.create" call.
  1313  // Any non-2xx status code is an error. Response headers are in either
  1314  // *ScanConfig.ServerResponse.Header or (if a response was returned at all) in
  1315  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1316  // whether the returned error was because http.StatusNotModified was returned.
  1317  func (c *ProjectsScanConfigsCreateCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
  1318  	gensupport.SetOptions(c.urlParams_, opts...)
  1319  	res, err := c.doRequest("json")
  1320  	if res != nil && res.StatusCode == http.StatusNotModified {
  1321  		if res.Body != nil {
  1322  			res.Body.Close()
  1323  		}
  1324  		return nil, gensupport.WrapError(&googleapi.Error{
  1325  			Code:   res.StatusCode,
  1326  			Header: res.Header,
  1327  		})
  1328  	}
  1329  	if err != nil {
  1330  		return nil, err
  1331  	}
  1332  	defer googleapi.CloseBody(res)
  1333  	if err := googleapi.CheckResponse(res); err != nil {
  1334  		return nil, gensupport.WrapError(err)
  1335  	}
  1336  	ret := &ScanConfig{
  1337  		ServerResponse: googleapi.ServerResponse{
  1338  			Header:         res.Header,
  1339  			HTTPStatusCode: res.StatusCode,
  1340  		},
  1341  	}
  1342  	target := &ret
  1343  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1344  		return nil, err
  1345  	}
  1346  	return ret, nil
  1347  }
  1348  
  1349  type ProjectsScanConfigsDeleteCall struct {
  1350  	s          *Service
  1351  	name       string
  1352  	urlParams_ gensupport.URLParams
  1353  	ctx_       context.Context
  1354  	header_    http.Header
  1355  }
  1356  
  1357  // Delete: Deletes an existing ScanConfig and its child resources.
  1358  //
  1359  //   - name: The resource name of the ScanConfig to be deleted. The name follows
  1360  //     the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1361  func (r *ProjectsScanConfigsService) Delete(name string) *ProjectsScanConfigsDeleteCall {
  1362  	c := &ProjectsScanConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1363  	c.name = name
  1364  	return c
  1365  }
  1366  
  1367  // Fields allows partial responses to be retrieved. See
  1368  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1369  // details.
  1370  func (c *ProjectsScanConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsDeleteCall {
  1371  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1372  	return c
  1373  }
  1374  
  1375  // Context sets the context to be used in this call's Do method.
  1376  func (c *ProjectsScanConfigsDeleteCall) Context(ctx context.Context) *ProjectsScanConfigsDeleteCall {
  1377  	c.ctx_ = ctx
  1378  	return c
  1379  }
  1380  
  1381  // Header returns a http.Header that can be modified by the caller to add
  1382  // headers to the request.
  1383  func (c *ProjectsScanConfigsDeleteCall) Header() http.Header {
  1384  	if c.header_ == nil {
  1385  		c.header_ = make(http.Header)
  1386  	}
  1387  	return c.header_
  1388  }
  1389  
  1390  func (c *ProjectsScanConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1391  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1392  	var body io.Reader = nil
  1393  	c.urlParams_.Set("alt", alt)
  1394  	c.urlParams_.Set("prettyPrint", "false")
  1395  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1396  	urls += "?" + c.urlParams_.Encode()
  1397  	req, err := http.NewRequest("DELETE", urls, body)
  1398  	if err != nil {
  1399  		return nil, err
  1400  	}
  1401  	req.Header = reqHeaders
  1402  	googleapi.Expand(req.URL, map[string]string{
  1403  		"name": c.name,
  1404  	})
  1405  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1406  }
  1407  
  1408  // Do executes the "websecurityscanner.projects.scanConfigs.delete" call.
  1409  // Any non-2xx status code is an error. Response headers are in either
  1410  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1411  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1412  // whether the returned error was because http.StatusNotModified was returned.
  1413  func (c *ProjectsScanConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1414  	gensupport.SetOptions(c.urlParams_, opts...)
  1415  	res, err := c.doRequest("json")
  1416  	if res != nil && res.StatusCode == http.StatusNotModified {
  1417  		if res.Body != nil {
  1418  			res.Body.Close()
  1419  		}
  1420  		return nil, gensupport.WrapError(&googleapi.Error{
  1421  			Code:   res.StatusCode,
  1422  			Header: res.Header,
  1423  		})
  1424  	}
  1425  	if err != nil {
  1426  		return nil, err
  1427  	}
  1428  	defer googleapi.CloseBody(res)
  1429  	if err := googleapi.CheckResponse(res); err != nil {
  1430  		return nil, gensupport.WrapError(err)
  1431  	}
  1432  	ret := &Empty{
  1433  		ServerResponse: googleapi.ServerResponse{
  1434  			Header:         res.Header,
  1435  			HTTPStatusCode: res.StatusCode,
  1436  		},
  1437  	}
  1438  	target := &ret
  1439  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1440  		return nil, err
  1441  	}
  1442  	return ret, nil
  1443  }
  1444  
  1445  type ProjectsScanConfigsGetCall struct {
  1446  	s            *Service
  1447  	name         string
  1448  	urlParams_   gensupport.URLParams
  1449  	ifNoneMatch_ string
  1450  	ctx_         context.Context
  1451  	header_      http.Header
  1452  }
  1453  
  1454  // Get: Gets a ScanConfig.
  1455  //
  1456  //   - name: The resource name of the ScanConfig to be returned. The name follows
  1457  //     the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1458  func (r *ProjectsScanConfigsService) Get(name string) *ProjectsScanConfigsGetCall {
  1459  	c := &ProjectsScanConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1460  	c.name = name
  1461  	return c
  1462  }
  1463  
  1464  // Fields allows partial responses to be retrieved. See
  1465  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1466  // details.
  1467  func (c *ProjectsScanConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsGetCall {
  1468  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1469  	return c
  1470  }
  1471  
  1472  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1473  // object's ETag matches the given value. This is useful for getting updates
  1474  // only after the object has changed since the last request.
  1475  func (c *ProjectsScanConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsGetCall {
  1476  	c.ifNoneMatch_ = entityTag
  1477  	return c
  1478  }
  1479  
  1480  // Context sets the context to be used in this call's Do method.
  1481  func (c *ProjectsScanConfigsGetCall) Context(ctx context.Context) *ProjectsScanConfigsGetCall {
  1482  	c.ctx_ = ctx
  1483  	return c
  1484  }
  1485  
  1486  // Header returns a http.Header that can be modified by the caller to add
  1487  // headers to the request.
  1488  func (c *ProjectsScanConfigsGetCall) Header() http.Header {
  1489  	if c.header_ == nil {
  1490  		c.header_ = make(http.Header)
  1491  	}
  1492  	return c.header_
  1493  }
  1494  
  1495  func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  1496  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1497  	if c.ifNoneMatch_ != "" {
  1498  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1499  	}
  1500  	var body io.Reader = nil
  1501  	c.urlParams_.Set("alt", alt)
  1502  	c.urlParams_.Set("prettyPrint", "false")
  1503  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1504  	urls += "?" + c.urlParams_.Encode()
  1505  	req, err := http.NewRequest("GET", urls, body)
  1506  	if err != nil {
  1507  		return nil, err
  1508  	}
  1509  	req.Header = reqHeaders
  1510  	googleapi.Expand(req.URL, map[string]string{
  1511  		"name": c.name,
  1512  	})
  1513  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1514  }
  1515  
  1516  // Do executes the "websecurityscanner.projects.scanConfigs.get" call.
  1517  // Any non-2xx status code is an error. Response headers are in either
  1518  // *ScanConfig.ServerResponse.Header or (if a response was returned at all) in
  1519  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1520  // whether the returned error was because http.StatusNotModified was returned.
  1521  func (c *ProjectsScanConfigsGetCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
  1522  	gensupport.SetOptions(c.urlParams_, opts...)
  1523  	res, err := c.doRequest("json")
  1524  	if res != nil && res.StatusCode == http.StatusNotModified {
  1525  		if res.Body != nil {
  1526  			res.Body.Close()
  1527  		}
  1528  		return nil, gensupport.WrapError(&googleapi.Error{
  1529  			Code:   res.StatusCode,
  1530  			Header: res.Header,
  1531  		})
  1532  	}
  1533  	if err != nil {
  1534  		return nil, err
  1535  	}
  1536  	defer googleapi.CloseBody(res)
  1537  	if err := googleapi.CheckResponse(res); err != nil {
  1538  		return nil, gensupport.WrapError(err)
  1539  	}
  1540  	ret := &ScanConfig{
  1541  		ServerResponse: googleapi.ServerResponse{
  1542  			Header:         res.Header,
  1543  			HTTPStatusCode: res.StatusCode,
  1544  		},
  1545  	}
  1546  	target := &ret
  1547  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1548  		return nil, err
  1549  	}
  1550  	return ret, nil
  1551  }
  1552  
  1553  type ProjectsScanConfigsListCall struct {
  1554  	s            *Service
  1555  	parent       string
  1556  	urlParams_   gensupport.URLParams
  1557  	ifNoneMatch_ string
  1558  	ctx_         context.Context
  1559  	header_      http.Header
  1560  }
  1561  
  1562  // List: Lists ScanConfigs under a given project.
  1563  //
  1564  //   - parent: The parent resource name, which should be a project resource name
  1565  //     in the format 'projects/{projectId}'.
  1566  func (r *ProjectsScanConfigsService) List(parent string) *ProjectsScanConfigsListCall {
  1567  	c := &ProjectsScanConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1568  	c.parent = parent
  1569  	return c
  1570  }
  1571  
  1572  // PageSize sets the optional parameter "pageSize": The maximum number of
  1573  // ScanConfigs to return, can be limited by server. If not specified or not
  1574  // positive, the implementation will select a reasonable value.
  1575  func (c *ProjectsScanConfigsListCall) PageSize(pageSize int64) *ProjectsScanConfigsListCall {
  1576  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1577  	return c
  1578  }
  1579  
  1580  // PageToken sets the optional parameter "pageToken": A token identifying a
  1581  // page of results to be returned. This should be a `next_page_token` value
  1582  // returned from a previous List request. If unspecified, the first page of
  1583  // results is returned.
  1584  func (c *ProjectsScanConfigsListCall) PageToken(pageToken string) *ProjectsScanConfigsListCall {
  1585  	c.urlParams_.Set("pageToken", pageToken)
  1586  	return c
  1587  }
  1588  
  1589  // Fields allows partial responses to be retrieved. See
  1590  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1591  // details.
  1592  func (c *ProjectsScanConfigsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsListCall {
  1593  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1594  	return c
  1595  }
  1596  
  1597  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1598  // object's ETag matches the given value. This is useful for getting updates
  1599  // only after the object has changed since the last request.
  1600  func (c *ProjectsScanConfigsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsListCall {
  1601  	c.ifNoneMatch_ = entityTag
  1602  	return c
  1603  }
  1604  
  1605  // Context sets the context to be used in this call's Do method.
  1606  func (c *ProjectsScanConfigsListCall) Context(ctx context.Context) *ProjectsScanConfigsListCall {
  1607  	c.ctx_ = ctx
  1608  	return c
  1609  }
  1610  
  1611  // Header returns a http.Header that can be modified by the caller to add
  1612  // headers to the request.
  1613  func (c *ProjectsScanConfigsListCall) Header() http.Header {
  1614  	if c.header_ == nil {
  1615  		c.header_ = make(http.Header)
  1616  	}
  1617  	return c.header_
  1618  }
  1619  
  1620  func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, error) {
  1621  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1622  	if c.ifNoneMatch_ != "" {
  1623  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1624  	}
  1625  	var body io.Reader = nil
  1626  	c.urlParams_.Set("alt", alt)
  1627  	c.urlParams_.Set("prettyPrint", "false")
  1628  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scanConfigs")
  1629  	urls += "?" + c.urlParams_.Encode()
  1630  	req, err := http.NewRequest("GET", urls, body)
  1631  	if err != nil {
  1632  		return nil, err
  1633  	}
  1634  	req.Header = reqHeaders
  1635  	googleapi.Expand(req.URL, map[string]string{
  1636  		"parent": c.parent,
  1637  	})
  1638  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1639  }
  1640  
  1641  // Do executes the "websecurityscanner.projects.scanConfigs.list" call.
  1642  // Any non-2xx status code is an error. Response headers are in either
  1643  // *ListScanConfigsResponse.ServerResponse.Header or (if a response was
  1644  // returned at all) in error.(*googleapi.Error).Header. Use
  1645  // googleapi.IsNotModified to check whether the returned error was because
  1646  // http.StatusNotModified was returned.
  1647  func (c *ProjectsScanConfigsListCall) Do(opts ...googleapi.CallOption) (*ListScanConfigsResponse, error) {
  1648  	gensupport.SetOptions(c.urlParams_, opts...)
  1649  	res, err := c.doRequest("json")
  1650  	if res != nil && res.StatusCode == http.StatusNotModified {
  1651  		if res.Body != nil {
  1652  			res.Body.Close()
  1653  		}
  1654  		return nil, gensupport.WrapError(&googleapi.Error{
  1655  			Code:   res.StatusCode,
  1656  			Header: res.Header,
  1657  		})
  1658  	}
  1659  	if err != nil {
  1660  		return nil, err
  1661  	}
  1662  	defer googleapi.CloseBody(res)
  1663  	if err := googleapi.CheckResponse(res); err != nil {
  1664  		return nil, gensupport.WrapError(err)
  1665  	}
  1666  	ret := &ListScanConfigsResponse{
  1667  		ServerResponse: googleapi.ServerResponse{
  1668  			Header:         res.Header,
  1669  			HTTPStatusCode: res.StatusCode,
  1670  		},
  1671  	}
  1672  	target := &ret
  1673  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1674  		return nil, err
  1675  	}
  1676  	return ret, nil
  1677  }
  1678  
  1679  // Pages invokes f for each page of results.
  1680  // A non-nil error returned from f will halt the iteration.
  1681  // The provided context supersedes any context provided to the Context method.
  1682  func (c *ProjectsScanConfigsListCall) Pages(ctx context.Context, f func(*ListScanConfigsResponse) error) error {
  1683  	c.ctx_ = ctx
  1684  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1685  	for {
  1686  		x, err := c.Do()
  1687  		if err != nil {
  1688  			return err
  1689  		}
  1690  		if err := f(x); err != nil {
  1691  			return err
  1692  		}
  1693  		if x.NextPageToken == "" {
  1694  			return nil
  1695  		}
  1696  		c.PageToken(x.NextPageToken)
  1697  	}
  1698  }
  1699  
  1700  type ProjectsScanConfigsPatchCall struct {
  1701  	s          *Service
  1702  	name       string
  1703  	scanconfig *ScanConfig
  1704  	urlParams_ gensupport.URLParams
  1705  	ctx_       context.Context
  1706  	header_    http.Header
  1707  }
  1708  
  1709  // Patch: Updates a ScanConfig. This method support partial update of a
  1710  // ScanConfig.
  1711  //
  1712  //   - name: The resource name of the ScanConfig. The name follows the format of
  1713  //     'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
  1714  //     generated by the system.
  1715  func (r *ProjectsScanConfigsService) Patch(name string, scanconfig *ScanConfig) *ProjectsScanConfigsPatchCall {
  1716  	c := &ProjectsScanConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1717  	c.name = name
  1718  	c.scanconfig = scanconfig
  1719  	return c
  1720  }
  1721  
  1722  // UpdateMask sets the optional parameter "updateMask": Required. The update
  1723  // mask applies to the resource. For the `FieldMask` definition, see
  1724  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  1725  func (c *ProjectsScanConfigsPatchCall) UpdateMask(updateMask string) *ProjectsScanConfigsPatchCall {
  1726  	c.urlParams_.Set("updateMask", updateMask)
  1727  	return c
  1728  }
  1729  
  1730  // Fields allows partial responses to be retrieved. See
  1731  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1732  // details.
  1733  func (c *ProjectsScanConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsPatchCall {
  1734  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1735  	return c
  1736  }
  1737  
  1738  // Context sets the context to be used in this call's Do method.
  1739  func (c *ProjectsScanConfigsPatchCall) Context(ctx context.Context) *ProjectsScanConfigsPatchCall {
  1740  	c.ctx_ = ctx
  1741  	return c
  1742  }
  1743  
  1744  // Header returns a http.Header that can be modified by the caller to add
  1745  // headers to the request.
  1746  func (c *ProjectsScanConfigsPatchCall) Header() http.Header {
  1747  	if c.header_ == nil {
  1748  		c.header_ = make(http.Header)
  1749  	}
  1750  	return c.header_
  1751  }
  1752  
  1753  func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) {
  1754  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1755  	var body io.Reader = nil
  1756  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig)
  1757  	if err != nil {
  1758  		return nil, err
  1759  	}
  1760  	c.urlParams_.Set("alt", alt)
  1761  	c.urlParams_.Set("prettyPrint", "false")
  1762  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1763  	urls += "?" + c.urlParams_.Encode()
  1764  	req, err := http.NewRequest("PATCH", urls, body)
  1765  	if err != nil {
  1766  		return nil, err
  1767  	}
  1768  	req.Header = reqHeaders
  1769  	googleapi.Expand(req.URL, map[string]string{
  1770  		"name": c.name,
  1771  	})
  1772  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1773  }
  1774  
  1775  // Do executes the "websecurityscanner.projects.scanConfigs.patch" call.
  1776  // Any non-2xx status code is an error. Response headers are in either
  1777  // *ScanConfig.ServerResponse.Header or (if a response was returned at all) in
  1778  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1779  // whether the returned error was because http.StatusNotModified was returned.
  1780  func (c *ProjectsScanConfigsPatchCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) {
  1781  	gensupport.SetOptions(c.urlParams_, opts...)
  1782  	res, err := c.doRequest("json")
  1783  	if res != nil && res.StatusCode == http.StatusNotModified {
  1784  		if res.Body != nil {
  1785  			res.Body.Close()
  1786  		}
  1787  		return nil, gensupport.WrapError(&googleapi.Error{
  1788  			Code:   res.StatusCode,
  1789  			Header: res.Header,
  1790  		})
  1791  	}
  1792  	if err != nil {
  1793  		return nil, err
  1794  	}
  1795  	defer googleapi.CloseBody(res)
  1796  	if err := googleapi.CheckResponse(res); err != nil {
  1797  		return nil, gensupport.WrapError(err)
  1798  	}
  1799  	ret := &ScanConfig{
  1800  		ServerResponse: googleapi.ServerResponse{
  1801  			Header:         res.Header,
  1802  			HTTPStatusCode: res.StatusCode,
  1803  		},
  1804  	}
  1805  	target := &ret
  1806  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1807  		return nil, err
  1808  	}
  1809  	return ret, nil
  1810  }
  1811  
  1812  type ProjectsScanConfigsStartCall struct {
  1813  	s                   *Service
  1814  	name                string
  1815  	startscanrunrequest *StartScanRunRequest
  1816  	urlParams_          gensupport.URLParams
  1817  	ctx_                context.Context
  1818  	header_             http.Header
  1819  }
  1820  
  1821  // Start: Start a ScanRun according to the given ScanConfig.
  1822  //
  1823  //   - name: The resource name of the ScanConfig to be used. The name follows the
  1824  //     format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  1825  func (r *ProjectsScanConfigsService) Start(name string, startscanrunrequest *StartScanRunRequest) *ProjectsScanConfigsStartCall {
  1826  	c := &ProjectsScanConfigsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1827  	c.name = name
  1828  	c.startscanrunrequest = startscanrunrequest
  1829  	return c
  1830  }
  1831  
  1832  // Fields allows partial responses to be retrieved. See
  1833  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1834  // details.
  1835  func (c *ProjectsScanConfigsStartCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsStartCall {
  1836  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1837  	return c
  1838  }
  1839  
  1840  // Context sets the context to be used in this call's Do method.
  1841  func (c *ProjectsScanConfigsStartCall) Context(ctx context.Context) *ProjectsScanConfigsStartCall {
  1842  	c.ctx_ = ctx
  1843  	return c
  1844  }
  1845  
  1846  // Header returns a http.Header that can be modified by the caller to add
  1847  // headers to the request.
  1848  func (c *ProjectsScanConfigsStartCall) Header() http.Header {
  1849  	if c.header_ == nil {
  1850  		c.header_ = make(http.Header)
  1851  	}
  1852  	return c.header_
  1853  }
  1854  
  1855  func (c *ProjectsScanConfigsStartCall) doRequest(alt string) (*http.Response, error) {
  1856  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1857  	var body io.Reader = nil
  1858  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startscanrunrequest)
  1859  	if err != nil {
  1860  		return nil, err
  1861  	}
  1862  	c.urlParams_.Set("alt", alt)
  1863  	c.urlParams_.Set("prettyPrint", "false")
  1864  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:start")
  1865  	urls += "?" + c.urlParams_.Encode()
  1866  	req, err := http.NewRequest("POST", urls, body)
  1867  	if err != nil {
  1868  		return nil, err
  1869  	}
  1870  	req.Header = reqHeaders
  1871  	googleapi.Expand(req.URL, map[string]string{
  1872  		"name": c.name,
  1873  	})
  1874  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1875  }
  1876  
  1877  // Do executes the "websecurityscanner.projects.scanConfigs.start" call.
  1878  // Any non-2xx status code is an error. Response headers are in either
  1879  // *ScanRun.ServerResponse.Header or (if a response was returned at all) in
  1880  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1881  // whether the returned error was because http.StatusNotModified was returned.
  1882  func (c *ProjectsScanConfigsStartCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
  1883  	gensupport.SetOptions(c.urlParams_, opts...)
  1884  	res, err := c.doRequest("json")
  1885  	if res != nil && res.StatusCode == http.StatusNotModified {
  1886  		if res.Body != nil {
  1887  			res.Body.Close()
  1888  		}
  1889  		return nil, gensupport.WrapError(&googleapi.Error{
  1890  			Code:   res.StatusCode,
  1891  			Header: res.Header,
  1892  		})
  1893  	}
  1894  	if err != nil {
  1895  		return nil, err
  1896  	}
  1897  	defer googleapi.CloseBody(res)
  1898  	if err := googleapi.CheckResponse(res); err != nil {
  1899  		return nil, gensupport.WrapError(err)
  1900  	}
  1901  	ret := &ScanRun{
  1902  		ServerResponse: googleapi.ServerResponse{
  1903  			Header:         res.Header,
  1904  			HTTPStatusCode: res.StatusCode,
  1905  		},
  1906  	}
  1907  	target := &ret
  1908  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1909  		return nil, err
  1910  	}
  1911  	return ret, nil
  1912  }
  1913  
  1914  type ProjectsScanConfigsScanRunsGetCall struct {
  1915  	s            *Service
  1916  	name         string
  1917  	urlParams_   gensupport.URLParams
  1918  	ifNoneMatch_ string
  1919  	ctx_         context.Context
  1920  	header_      http.Header
  1921  }
  1922  
  1923  // Get: Gets a ScanRun.
  1924  //
  1925  //   - name: The resource name of the ScanRun to be returned. The name follows
  1926  //     the format of
  1927  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  1928  func (r *ProjectsScanConfigsScanRunsService) Get(name string) *ProjectsScanConfigsScanRunsGetCall {
  1929  	c := &ProjectsScanConfigsScanRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1930  	c.name = name
  1931  	return c
  1932  }
  1933  
  1934  // Fields allows partial responses to be retrieved. See
  1935  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1936  // details.
  1937  func (c *ProjectsScanConfigsScanRunsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsGetCall {
  1938  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1939  	return c
  1940  }
  1941  
  1942  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1943  // object's ETag matches the given value. This is useful for getting updates
  1944  // only after the object has changed since the last request.
  1945  func (c *ProjectsScanConfigsScanRunsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsGetCall {
  1946  	c.ifNoneMatch_ = entityTag
  1947  	return c
  1948  }
  1949  
  1950  // Context sets the context to be used in this call's Do method.
  1951  func (c *ProjectsScanConfigsScanRunsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsGetCall {
  1952  	c.ctx_ = ctx
  1953  	return c
  1954  }
  1955  
  1956  // Header returns a http.Header that can be modified by the caller to add
  1957  // headers to the request.
  1958  func (c *ProjectsScanConfigsScanRunsGetCall) Header() http.Header {
  1959  	if c.header_ == nil {
  1960  		c.header_ = make(http.Header)
  1961  	}
  1962  	return c.header_
  1963  }
  1964  
  1965  func (c *ProjectsScanConfigsScanRunsGetCall) doRequest(alt string) (*http.Response, error) {
  1966  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1967  	if c.ifNoneMatch_ != "" {
  1968  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1969  	}
  1970  	var body io.Reader = nil
  1971  	c.urlParams_.Set("alt", alt)
  1972  	c.urlParams_.Set("prettyPrint", "false")
  1973  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  1974  	urls += "?" + c.urlParams_.Encode()
  1975  	req, err := http.NewRequest("GET", urls, body)
  1976  	if err != nil {
  1977  		return nil, err
  1978  	}
  1979  	req.Header = reqHeaders
  1980  	googleapi.Expand(req.URL, map[string]string{
  1981  		"name": c.name,
  1982  	})
  1983  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1984  }
  1985  
  1986  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.get" call.
  1987  // Any non-2xx status code is an error. Response headers are in either
  1988  // *ScanRun.ServerResponse.Header or (if a response was returned at all) in
  1989  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1990  // whether the returned error was because http.StatusNotModified was returned.
  1991  func (c *ProjectsScanConfigsScanRunsGetCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
  1992  	gensupport.SetOptions(c.urlParams_, opts...)
  1993  	res, err := c.doRequest("json")
  1994  	if res != nil && res.StatusCode == http.StatusNotModified {
  1995  		if res.Body != nil {
  1996  			res.Body.Close()
  1997  		}
  1998  		return nil, gensupport.WrapError(&googleapi.Error{
  1999  			Code:   res.StatusCode,
  2000  			Header: res.Header,
  2001  		})
  2002  	}
  2003  	if err != nil {
  2004  		return nil, err
  2005  	}
  2006  	defer googleapi.CloseBody(res)
  2007  	if err := googleapi.CheckResponse(res); err != nil {
  2008  		return nil, gensupport.WrapError(err)
  2009  	}
  2010  	ret := &ScanRun{
  2011  		ServerResponse: googleapi.ServerResponse{
  2012  			Header:         res.Header,
  2013  			HTTPStatusCode: res.StatusCode,
  2014  		},
  2015  	}
  2016  	target := &ret
  2017  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2018  		return nil, err
  2019  	}
  2020  	return ret, nil
  2021  }
  2022  
  2023  type ProjectsScanConfigsScanRunsListCall struct {
  2024  	s            *Service
  2025  	parent       string
  2026  	urlParams_   gensupport.URLParams
  2027  	ifNoneMatch_ string
  2028  	ctx_         context.Context
  2029  	header_      http.Header
  2030  }
  2031  
  2032  // List: Lists ScanRuns under a given ScanConfig, in descending order of
  2033  // ScanRun stop time.
  2034  //
  2035  //   - parent: The parent resource name, which should be a scan resource name in
  2036  //     the format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  2037  func (r *ProjectsScanConfigsScanRunsService) List(parent string) *ProjectsScanConfigsScanRunsListCall {
  2038  	c := &ProjectsScanConfigsScanRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2039  	c.parent = parent
  2040  	return c
  2041  }
  2042  
  2043  // PageSize sets the optional parameter "pageSize": The maximum number of
  2044  // ScanRuns to return, can be limited by server. If not specified or not
  2045  // positive, the implementation will select a reasonable value.
  2046  func (c *ProjectsScanConfigsScanRunsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsListCall {
  2047  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2048  	return c
  2049  }
  2050  
  2051  // PageToken sets the optional parameter "pageToken": A token identifying a
  2052  // page of results to be returned. This should be a `next_page_token` value
  2053  // returned from a previous List request. If unspecified, the first page of
  2054  // results is returned.
  2055  func (c *ProjectsScanConfigsScanRunsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsListCall {
  2056  	c.urlParams_.Set("pageToken", pageToken)
  2057  	return c
  2058  }
  2059  
  2060  // Fields allows partial responses to be retrieved. See
  2061  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2062  // details.
  2063  func (c *ProjectsScanConfigsScanRunsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsListCall {
  2064  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2065  	return c
  2066  }
  2067  
  2068  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2069  // object's ETag matches the given value. This is useful for getting updates
  2070  // only after the object has changed since the last request.
  2071  func (c *ProjectsScanConfigsScanRunsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsListCall {
  2072  	c.ifNoneMatch_ = entityTag
  2073  	return c
  2074  }
  2075  
  2076  // Context sets the context to be used in this call's Do method.
  2077  func (c *ProjectsScanConfigsScanRunsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsListCall {
  2078  	c.ctx_ = ctx
  2079  	return c
  2080  }
  2081  
  2082  // Header returns a http.Header that can be modified by the caller to add
  2083  // headers to the request.
  2084  func (c *ProjectsScanConfigsScanRunsListCall) Header() http.Header {
  2085  	if c.header_ == nil {
  2086  		c.header_ = make(http.Header)
  2087  	}
  2088  	return c.header_
  2089  }
  2090  
  2091  func (c *ProjectsScanConfigsScanRunsListCall) doRequest(alt string) (*http.Response, error) {
  2092  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2093  	if c.ifNoneMatch_ != "" {
  2094  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2095  	}
  2096  	var body io.Reader = nil
  2097  	c.urlParams_.Set("alt", alt)
  2098  	c.urlParams_.Set("prettyPrint", "false")
  2099  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/scanRuns")
  2100  	urls += "?" + c.urlParams_.Encode()
  2101  	req, err := http.NewRequest("GET", urls, body)
  2102  	if err != nil {
  2103  		return nil, err
  2104  	}
  2105  	req.Header = reqHeaders
  2106  	googleapi.Expand(req.URL, map[string]string{
  2107  		"parent": c.parent,
  2108  	})
  2109  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2110  }
  2111  
  2112  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.list" call.
  2113  // Any non-2xx status code is an error. Response headers are in either
  2114  // *ListScanRunsResponse.ServerResponse.Header or (if a response was returned
  2115  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2116  // check whether the returned error was because http.StatusNotModified was
  2117  // returned.
  2118  func (c *ProjectsScanConfigsScanRunsListCall) Do(opts ...googleapi.CallOption) (*ListScanRunsResponse, error) {
  2119  	gensupport.SetOptions(c.urlParams_, opts...)
  2120  	res, err := c.doRequest("json")
  2121  	if res != nil && res.StatusCode == http.StatusNotModified {
  2122  		if res.Body != nil {
  2123  			res.Body.Close()
  2124  		}
  2125  		return nil, gensupport.WrapError(&googleapi.Error{
  2126  			Code:   res.StatusCode,
  2127  			Header: res.Header,
  2128  		})
  2129  	}
  2130  	if err != nil {
  2131  		return nil, err
  2132  	}
  2133  	defer googleapi.CloseBody(res)
  2134  	if err := googleapi.CheckResponse(res); err != nil {
  2135  		return nil, gensupport.WrapError(err)
  2136  	}
  2137  	ret := &ListScanRunsResponse{
  2138  		ServerResponse: googleapi.ServerResponse{
  2139  			Header:         res.Header,
  2140  			HTTPStatusCode: res.StatusCode,
  2141  		},
  2142  	}
  2143  	target := &ret
  2144  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2145  		return nil, err
  2146  	}
  2147  	return ret, nil
  2148  }
  2149  
  2150  // Pages invokes f for each page of results.
  2151  // A non-nil error returned from f will halt the iteration.
  2152  // The provided context supersedes any context provided to the Context method.
  2153  func (c *ProjectsScanConfigsScanRunsListCall) Pages(ctx context.Context, f func(*ListScanRunsResponse) error) error {
  2154  	c.ctx_ = ctx
  2155  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2156  	for {
  2157  		x, err := c.Do()
  2158  		if err != nil {
  2159  			return err
  2160  		}
  2161  		if err := f(x); err != nil {
  2162  			return err
  2163  		}
  2164  		if x.NextPageToken == "" {
  2165  			return nil
  2166  		}
  2167  		c.PageToken(x.NextPageToken)
  2168  	}
  2169  }
  2170  
  2171  type ProjectsScanConfigsScanRunsStopCall struct {
  2172  	s                  *Service
  2173  	name               string
  2174  	stopscanrunrequest *StopScanRunRequest
  2175  	urlParams_         gensupport.URLParams
  2176  	ctx_               context.Context
  2177  	header_            http.Header
  2178  }
  2179  
  2180  // Stop: Stops a ScanRun. The stopped ScanRun is returned.
  2181  //
  2182  //   - name: The resource name of the ScanRun to be stopped. The name follows the
  2183  //     format of
  2184  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2185  func (r *ProjectsScanConfigsScanRunsService) Stop(name string, stopscanrunrequest *StopScanRunRequest) *ProjectsScanConfigsScanRunsStopCall {
  2186  	c := &ProjectsScanConfigsScanRunsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2187  	c.name = name
  2188  	c.stopscanrunrequest = stopscanrunrequest
  2189  	return c
  2190  }
  2191  
  2192  // Fields allows partial responses to be retrieved. See
  2193  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2194  // details.
  2195  func (c *ProjectsScanConfigsScanRunsStopCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsStopCall {
  2196  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2197  	return c
  2198  }
  2199  
  2200  // Context sets the context to be used in this call's Do method.
  2201  func (c *ProjectsScanConfigsScanRunsStopCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsStopCall {
  2202  	c.ctx_ = ctx
  2203  	return c
  2204  }
  2205  
  2206  // Header returns a http.Header that can be modified by the caller to add
  2207  // headers to the request.
  2208  func (c *ProjectsScanConfigsScanRunsStopCall) Header() http.Header {
  2209  	if c.header_ == nil {
  2210  		c.header_ = make(http.Header)
  2211  	}
  2212  	return c.header_
  2213  }
  2214  
  2215  func (c *ProjectsScanConfigsScanRunsStopCall) doRequest(alt string) (*http.Response, error) {
  2216  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2217  	var body io.Reader = nil
  2218  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopscanrunrequest)
  2219  	if err != nil {
  2220  		return nil, err
  2221  	}
  2222  	c.urlParams_.Set("alt", alt)
  2223  	c.urlParams_.Set("prettyPrint", "false")
  2224  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:stop")
  2225  	urls += "?" + c.urlParams_.Encode()
  2226  	req, err := http.NewRequest("POST", urls, body)
  2227  	if err != nil {
  2228  		return nil, err
  2229  	}
  2230  	req.Header = reqHeaders
  2231  	googleapi.Expand(req.URL, map[string]string{
  2232  		"name": c.name,
  2233  	})
  2234  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2235  }
  2236  
  2237  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.stop" call.
  2238  // Any non-2xx status code is an error. Response headers are in either
  2239  // *ScanRun.ServerResponse.Header or (if a response was returned at all) in
  2240  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2241  // whether the returned error was because http.StatusNotModified was returned.
  2242  func (c *ProjectsScanConfigsScanRunsStopCall) Do(opts ...googleapi.CallOption) (*ScanRun, error) {
  2243  	gensupport.SetOptions(c.urlParams_, opts...)
  2244  	res, err := c.doRequest("json")
  2245  	if res != nil && res.StatusCode == http.StatusNotModified {
  2246  		if res.Body != nil {
  2247  			res.Body.Close()
  2248  		}
  2249  		return nil, gensupport.WrapError(&googleapi.Error{
  2250  			Code:   res.StatusCode,
  2251  			Header: res.Header,
  2252  		})
  2253  	}
  2254  	if err != nil {
  2255  		return nil, err
  2256  	}
  2257  	defer googleapi.CloseBody(res)
  2258  	if err := googleapi.CheckResponse(res); err != nil {
  2259  		return nil, gensupport.WrapError(err)
  2260  	}
  2261  	ret := &ScanRun{
  2262  		ServerResponse: googleapi.ServerResponse{
  2263  			Header:         res.Header,
  2264  			HTTPStatusCode: res.StatusCode,
  2265  		},
  2266  	}
  2267  	target := &ret
  2268  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2269  		return nil, err
  2270  	}
  2271  	return ret, nil
  2272  }
  2273  
  2274  type ProjectsScanConfigsScanRunsCrawledUrlsListCall struct {
  2275  	s            *Service
  2276  	parent       string
  2277  	urlParams_   gensupport.URLParams
  2278  	ifNoneMatch_ string
  2279  	ctx_         context.Context
  2280  	header_      http.Header
  2281  }
  2282  
  2283  // List: List CrawledUrls under a given ScanRun.
  2284  //
  2285  //   - parent: The parent resource name, which should be a scan run resource name
  2286  //     in the format
  2287  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2288  func (r *ProjectsScanConfigsScanRunsCrawledUrlsService) List(parent string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2289  	c := &ProjectsScanConfigsScanRunsCrawledUrlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2290  	c.parent = parent
  2291  	return c
  2292  }
  2293  
  2294  // PageSize sets the optional parameter "pageSize": The maximum number of
  2295  // CrawledUrls to return, can be limited by server. If not specified or not
  2296  // positive, the implementation will select a reasonable value.
  2297  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2298  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2299  	return c
  2300  }
  2301  
  2302  // PageToken sets the optional parameter "pageToken": A token identifying a
  2303  // page of results to be returned. This should be a `next_page_token` value
  2304  // returned from a previous List request. If unspecified, the first page of
  2305  // results is returned.
  2306  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2307  	c.urlParams_.Set("pageToken", pageToken)
  2308  	return c
  2309  }
  2310  
  2311  // Fields allows partial responses to be retrieved. See
  2312  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2313  // details.
  2314  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2315  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2316  	return c
  2317  }
  2318  
  2319  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2320  // object's ETag matches the given value. This is useful for getting updates
  2321  // only after the object has changed since the last request.
  2322  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2323  	c.ifNoneMatch_ = entityTag
  2324  	return c
  2325  }
  2326  
  2327  // Context sets the context to be used in this call's Do method.
  2328  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsCrawledUrlsListCall {
  2329  	c.ctx_ = ctx
  2330  	return c
  2331  }
  2332  
  2333  // Header returns a http.Header that can be modified by the caller to add
  2334  // headers to the request.
  2335  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Header() http.Header {
  2336  	if c.header_ == nil {
  2337  		c.header_ = make(http.Header)
  2338  	}
  2339  	return c.header_
  2340  }
  2341  
  2342  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) doRequest(alt string) (*http.Response, error) {
  2343  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2344  	if c.ifNoneMatch_ != "" {
  2345  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2346  	}
  2347  	var body io.Reader = nil
  2348  	c.urlParams_.Set("alt", alt)
  2349  	c.urlParams_.Set("prettyPrint", "false")
  2350  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/crawledUrls")
  2351  	urls += "?" + c.urlParams_.Encode()
  2352  	req, err := http.NewRequest("GET", urls, body)
  2353  	if err != nil {
  2354  		return nil, err
  2355  	}
  2356  	req.Header = reqHeaders
  2357  	googleapi.Expand(req.URL, map[string]string{
  2358  		"parent": c.parent,
  2359  	})
  2360  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2361  }
  2362  
  2363  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list" call.
  2364  // Any non-2xx status code is an error. Response headers are in either
  2365  // *ListCrawledUrlsResponse.ServerResponse.Header or (if a response was
  2366  // returned at all) in error.(*googleapi.Error).Header. Use
  2367  // googleapi.IsNotModified to check whether the returned error was because
  2368  // http.StatusNotModified was returned.
  2369  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Do(opts ...googleapi.CallOption) (*ListCrawledUrlsResponse, error) {
  2370  	gensupport.SetOptions(c.urlParams_, opts...)
  2371  	res, err := c.doRequest("json")
  2372  	if res != nil && res.StatusCode == http.StatusNotModified {
  2373  		if res.Body != nil {
  2374  			res.Body.Close()
  2375  		}
  2376  		return nil, gensupport.WrapError(&googleapi.Error{
  2377  			Code:   res.StatusCode,
  2378  			Header: res.Header,
  2379  		})
  2380  	}
  2381  	if err != nil {
  2382  		return nil, err
  2383  	}
  2384  	defer googleapi.CloseBody(res)
  2385  	if err := googleapi.CheckResponse(res); err != nil {
  2386  		return nil, gensupport.WrapError(err)
  2387  	}
  2388  	ret := &ListCrawledUrlsResponse{
  2389  		ServerResponse: googleapi.ServerResponse{
  2390  			Header:         res.Header,
  2391  			HTTPStatusCode: res.StatusCode,
  2392  		},
  2393  	}
  2394  	target := &ret
  2395  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2396  		return nil, err
  2397  	}
  2398  	return ret, nil
  2399  }
  2400  
  2401  // Pages invokes f for each page of results.
  2402  // A non-nil error returned from f will halt the iteration.
  2403  // The provided context supersedes any context provided to the Context method.
  2404  func (c *ProjectsScanConfigsScanRunsCrawledUrlsListCall) Pages(ctx context.Context, f func(*ListCrawledUrlsResponse) error) error {
  2405  	c.ctx_ = ctx
  2406  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2407  	for {
  2408  		x, err := c.Do()
  2409  		if err != nil {
  2410  			return err
  2411  		}
  2412  		if err := f(x); err != nil {
  2413  			return err
  2414  		}
  2415  		if x.NextPageToken == "" {
  2416  			return nil
  2417  		}
  2418  		c.PageToken(x.NextPageToken)
  2419  	}
  2420  }
  2421  
  2422  type ProjectsScanConfigsScanRunsFindingTypeStatsListCall struct {
  2423  	s            *Service
  2424  	parent       string
  2425  	urlParams_   gensupport.URLParams
  2426  	ifNoneMatch_ string
  2427  	ctx_         context.Context
  2428  	header_      http.Header
  2429  }
  2430  
  2431  // List: List all FindingTypeStats under a given ScanRun.
  2432  //
  2433  //   - parent: The parent resource name, which should be a scan run resource name
  2434  //     in the format
  2435  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2436  func (r *ProjectsScanConfigsScanRunsFindingTypeStatsService) List(parent string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2437  	c := &ProjectsScanConfigsScanRunsFindingTypeStatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2438  	c.parent = parent
  2439  	return c
  2440  }
  2441  
  2442  // Fields allows partial responses to be retrieved. See
  2443  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2444  // details.
  2445  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2446  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2447  	return c
  2448  }
  2449  
  2450  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2451  // object's ETag matches the given value. This is useful for getting updates
  2452  // only after the object has changed since the last request.
  2453  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2454  	c.ifNoneMatch_ = entityTag
  2455  	return c
  2456  }
  2457  
  2458  // Context sets the context to be used in this call's Do method.
  2459  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingTypeStatsListCall {
  2460  	c.ctx_ = ctx
  2461  	return c
  2462  }
  2463  
  2464  // Header returns a http.Header that can be modified by the caller to add
  2465  // headers to the request.
  2466  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Header() http.Header {
  2467  	if c.header_ == nil {
  2468  		c.header_ = make(http.Header)
  2469  	}
  2470  	return c.header_
  2471  }
  2472  
  2473  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) doRequest(alt string) (*http.Response, error) {
  2474  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2475  	if c.ifNoneMatch_ != "" {
  2476  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2477  	}
  2478  	var body io.Reader = nil
  2479  	c.urlParams_.Set("alt", alt)
  2480  	c.urlParams_.Set("prettyPrint", "false")
  2481  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/findingTypeStats")
  2482  	urls += "?" + c.urlParams_.Encode()
  2483  	req, err := http.NewRequest("GET", urls, body)
  2484  	if err != nil {
  2485  		return nil, err
  2486  	}
  2487  	req.Header = reqHeaders
  2488  	googleapi.Expand(req.URL, map[string]string{
  2489  		"parent": c.parent,
  2490  	})
  2491  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2492  }
  2493  
  2494  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list" call.
  2495  // Any non-2xx status code is an error. Response headers are in either
  2496  // *ListFindingTypeStatsResponse.ServerResponse.Header or (if a response was
  2497  // returned at all) in error.(*googleapi.Error).Header. Use
  2498  // googleapi.IsNotModified to check whether the returned error was because
  2499  // http.StatusNotModified was returned.
  2500  func (c *ProjectsScanConfigsScanRunsFindingTypeStatsListCall) Do(opts ...googleapi.CallOption) (*ListFindingTypeStatsResponse, error) {
  2501  	gensupport.SetOptions(c.urlParams_, opts...)
  2502  	res, err := c.doRequest("json")
  2503  	if res != nil && res.StatusCode == http.StatusNotModified {
  2504  		if res.Body != nil {
  2505  			res.Body.Close()
  2506  		}
  2507  		return nil, gensupport.WrapError(&googleapi.Error{
  2508  			Code:   res.StatusCode,
  2509  			Header: res.Header,
  2510  		})
  2511  	}
  2512  	if err != nil {
  2513  		return nil, err
  2514  	}
  2515  	defer googleapi.CloseBody(res)
  2516  	if err := googleapi.CheckResponse(res); err != nil {
  2517  		return nil, gensupport.WrapError(err)
  2518  	}
  2519  	ret := &ListFindingTypeStatsResponse{
  2520  		ServerResponse: googleapi.ServerResponse{
  2521  			Header:         res.Header,
  2522  			HTTPStatusCode: res.StatusCode,
  2523  		},
  2524  	}
  2525  	target := &ret
  2526  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2527  		return nil, err
  2528  	}
  2529  	return ret, nil
  2530  }
  2531  
  2532  type ProjectsScanConfigsScanRunsFindingsGetCall struct {
  2533  	s            *Service
  2534  	name         string
  2535  	urlParams_   gensupport.URLParams
  2536  	ifNoneMatch_ string
  2537  	ctx_         context.Context
  2538  	header_      http.Header
  2539  }
  2540  
  2541  // Get: Gets a Finding.
  2542  //
  2543  //   - name: The resource name of the Finding to be returned. The name follows
  2544  //     the format of
  2545  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findi
  2546  //     ngs/{findingId}'.
  2547  func (r *ProjectsScanConfigsScanRunsFindingsService) Get(name string) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2548  	c := &ProjectsScanConfigsScanRunsFindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2549  	c.name = name
  2550  	return c
  2551  }
  2552  
  2553  // Fields allows partial responses to be retrieved. See
  2554  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2555  // details.
  2556  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2557  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2558  	return c
  2559  }
  2560  
  2561  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2562  // object's ETag matches the given value. This is useful for getting updates
  2563  // only after the object has changed since the last request.
  2564  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2565  	c.ifNoneMatch_ = entityTag
  2566  	return c
  2567  }
  2568  
  2569  // Context sets the context to be used in this call's Do method.
  2570  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsGetCall {
  2571  	c.ctx_ = ctx
  2572  	return c
  2573  }
  2574  
  2575  // Header returns a http.Header that can be modified by the caller to add
  2576  // headers to the request.
  2577  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Header() http.Header {
  2578  	if c.header_ == nil {
  2579  		c.header_ = make(http.Header)
  2580  	}
  2581  	return c.header_
  2582  }
  2583  
  2584  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) doRequest(alt string) (*http.Response, error) {
  2585  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2586  	if c.ifNoneMatch_ != "" {
  2587  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2588  	}
  2589  	var body io.Reader = nil
  2590  	c.urlParams_.Set("alt", alt)
  2591  	c.urlParams_.Set("prettyPrint", "false")
  2592  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
  2593  	urls += "?" + c.urlParams_.Encode()
  2594  	req, err := http.NewRequest("GET", urls, body)
  2595  	if err != nil {
  2596  		return nil, err
  2597  	}
  2598  	req.Header = reqHeaders
  2599  	googleapi.Expand(req.URL, map[string]string{
  2600  		"name": c.name,
  2601  	})
  2602  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2603  }
  2604  
  2605  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findings.get" call.
  2606  // Any non-2xx status code is an error. Response headers are in either
  2607  // *Finding.ServerResponse.Header or (if a response was returned at all) in
  2608  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2609  // whether the returned error was because http.StatusNotModified was returned.
  2610  func (c *ProjectsScanConfigsScanRunsFindingsGetCall) Do(opts ...googleapi.CallOption) (*Finding, error) {
  2611  	gensupport.SetOptions(c.urlParams_, opts...)
  2612  	res, err := c.doRequest("json")
  2613  	if res != nil && res.StatusCode == http.StatusNotModified {
  2614  		if res.Body != nil {
  2615  			res.Body.Close()
  2616  		}
  2617  		return nil, gensupport.WrapError(&googleapi.Error{
  2618  			Code:   res.StatusCode,
  2619  			Header: res.Header,
  2620  		})
  2621  	}
  2622  	if err != nil {
  2623  		return nil, err
  2624  	}
  2625  	defer googleapi.CloseBody(res)
  2626  	if err := googleapi.CheckResponse(res); err != nil {
  2627  		return nil, gensupport.WrapError(err)
  2628  	}
  2629  	ret := &Finding{
  2630  		ServerResponse: googleapi.ServerResponse{
  2631  			Header:         res.Header,
  2632  			HTTPStatusCode: res.StatusCode,
  2633  		},
  2634  	}
  2635  	target := &ret
  2636  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2637  		return nil, err
  2638  	}
  2639  	return ret, nil
  2640  }
  2641  
  2642  type ProjectsScanConfigsScanRunsFindingsListCall struct {
  2643  	s            *Service
  2644  	parent       string
  2645  	urlParams_   gensupport.URLParams
  2646  	ifNoneMatch_ string
  2647  	ctx_         context.Context
  2648  	header_      http.Header
  2649  }
  2650  
  2651  // List: List Findings under a given ScanRun.
  2652  //
  2653  //   - parent: The parent resource name, which should be a scan run resource name
  2654  //     in the format
  2655  //     'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  2656  func (r *ProjectsScanConfigsScanRunsFindingsService) List(parent string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2657  	c := &ProjectsScanConfigsScanRunsFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2658  	c.parent = parent
  2659  	return c
  2660  }
  2661  
  2662  // Filter sets the optional parameter "filter": Required. The filter
  2663  // expression. The expression must be in the format: . Supported field:
  2664  // 'finding_type'. Supported operator: '='.
  2665  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Filter(filter string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2666  	c.urlParams_.Set("filter", filter)
  2667  	return c
  2668  }
  2669  
  2670  // PageSize sets the optional parameter "pageSize": The maximum number of
  2671  // Findings to return, can be limited by server. If not specified or not
  2672  // positive, the implementation will select a reasonable value.
  2673  func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageSize(pageSize int64) *ProjectsScanConfigsScanRunsFindingsListCall {
  2674  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2675  	return c
  2676  }
  2677  
  2678  // PageToken sets the optional parameter "pageToken": A token identifying a
  2679  // page of results to be returned. This should be a `next_page_token` value
  2680  // returned from a previous List request. If unspecified, the first page of
  2681  // results is returned.
  2682  func (c *ProjectsScanConfigsScanRunsFindingsListCall) PageToken(pageToken string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2683  	c.urlParams_.Set("pageToken", pageToken)
  2684  	return c
  2685  }
  2686  
  2687  // Fields allows partial responses to be retrieved. See
  2688  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2689  // details.
  2690  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsScanRunsFindingsListCall {
  2691  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2692  	return c
  2693  }
  2694  
  2695  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2696  // object's ETag matches the given value. This is useful for getting updates
  2697  // only after the object has changed since the last request.
  2698  func (c *ProjectsScanConfigsScanRunsFindingsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsScanRunsFindingsListCall {
  2699  	c.ifNoneMatch_ = entityTag
  2700  	return c
  2701  }
  2702  
  2703  // Context sets the context to be used in this call's Do method.
  2704  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Context(ctx context.Context) *ProjectsScanConfigsScanRunsFindingsListCall {
  2705  	c.ctx_ = ctx
  2706  	return c
  2707  }
  2708  
  2709  // Header returns a http.Header that can be modified by the caller to add
  2710  // headers to the request.
  2711  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Header() http.Header {
  2712  	if c.header_ == nil {
  2713  		c.header_ = make(http.Header)
  2714  	}
  2715  	return c.header_
  2716  }
  2717  
  2718  func (c *ProjectsScanConfigsScanRunsFindingsListCall) doRequest(alt string) (*http.Response, error) {
  2719  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2720  	if c.ifNoneMatch_ != "" {
  2721  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2722  	}
  2723  	var body io.Reader = nil
  2724  	c.urlParams_.Set("alt", alt)
  2725  	c.urlParams_.Set("prettyPrint", "false")
  2726  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/findings")
  2727  	urls += "?" + c.urlParams_.Encode()
  2728  	req, err := http.NewRequest("GET", urls, body)
  2729  	if err != nil {
  2730  		return nil, err
  2731  	}
  2732  	req.Header = reqHeaders
  2733  	googleapi.Expand(req.URL, map[string]string{
  2734  		"parent": c.parent,
  2735  	})
  2736  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2737  }
  2738  
  2739  // Do executes the "websecurityscanner.projects.scanConfigs.scanRuns.findings.list" call.
  2740  // Any non-2xx status code is an error. Response headers are in either
  2741  // *ListFindingsResponse.ServerResponse.Header or (if a response was returned
  2742  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2743  // check whether the returned error was because http.StatusNotModified was
  2744  // returned.
  2745  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) {
  2746  	gensupport.SetOptions(c.urlParams_, opts...)
  2747  	res, err := c.doRequest("json")
  2748  	if res != nil && res.StatusCode == http.StatusNotModified {
  2749  		if res.Body != nil {
  2750  			res.Body.Close()
  2751  		}
  2752  		return nil, gensupport.WrapError(&googleapi.Error{
  2753  			Code:   res.StatusCode,
  2754  			Header: res.Header,
  2755  		})
  2756  	}
  2757  	if err != nil {
  2758  		return nil, err
  2759  	}
  2760  	defer googleapi.CloseBody(res)
  2761  	if err := googleapi.CheckResponse(res); err != nil {
  2762  		return nil, gensupport.WrapError(err)
  2763  	}
  2764  	ret := &ListFindingsResponse{
  2765  		ServerResponse: googleapi.ServerResponse{
  2766  			Header:         res.Header,
  2767  			HTTPStatusCode: res.StatusCode,
  2768  		},
  2769  	}
  2770  	target := &ret
  2771  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2772  		return nil, err
  2773  	}
  2774  	return ret, nil
  2775  }
  2776  
  2777  // Pages invokes f for each page of results.
  2778  // A non-nil error returned from f will halt the iteration.
  2779  // The provided context supersedes any context provided to the Context method.
  2780  func (c *ProjectsScanConfigsScanRunsFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error {
  2781  	c.ctx_ = ctx
  2782  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2783  	for {
  2784  		x, err := c.Do()
  2785  		if err != nil {
  2786  			return err
  2787  		}
  2788  		if err := f(x); err != nil {
  2789  			return err
  2790  		}
  2791  		if x.NextPageToken == "" {
  2792  			return nil
  2793  		}
  2794  		c.PageToken(x.NextPageToken)
  2795  	}
  2796  }
  2797  

View as plain text