...

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

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

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

View as plain text