...

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

Documentation: google.golang.org/api/webrisk/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 webrisk provides access to the Web Risk API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/web-risk/
    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/webrisk/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	webriskService, err := webrisk.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  //	webriskService, err := webrisk.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  //	webriskService, err := webrisk.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package webrisk // import "google.golang.org/api/webrisk/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 = "webrisk:v1"
    90  const apiName = "webrisk"
    91  const apiVersion = "v1"
    92  const basePath = "https://webrisk.googleapis.com/"
    93  const basePathTemplate = "https://webrisk.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://webrisk.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.Hashes = NewHashesService(s)
   139  	s.Projects = NewProjectsService(s)
   140  	s.ThreatLists = NewThreatListsService(s)
   141  	s.Uris = NewUrisService(s)
   142  	return s, nil
   143  }
   144  
   145  type Service struct {
   146  	client    *http.Client
   147  	BasePath  string // API endpoint base URL
   148  	UserAgent string // optional additional User-Agent fragment
   149  
   150  	Hashes *HashesService
   151  
   152  	Projects *ProjectsService
   153  
   154  	ThreatLists *ThreatListsService
   155  
   156  	Uris *UrisService
   157  }
   158  
   159  func (s *Service) userAgent() string {
   160  	if s.UserAgent == "" {
   161  		return googleapi.UserAgent
   162  	}
   163  	return googleapi.UserAgent + " " + s.UserAgent
   164  }
   165  
   166  func NewHashesService(s *Service) *HashesService {
   167  	rs := &HashesService{s: s}
   168  	return rs
   169  }
   170  
   171  type HashesService struct {
   172  	s *Service
   173  }
   174  
   175  func NewProjectsService(s *Service) *ProjectsService {
   176  	rs := &ProjectsService{s: s}
   177  	rs.Operations = NewProjectsOperationsService(s)
   178  	rs.Submissions = NewProjectsSubmissionsService(s)
   179  	return rs
   180  }
   181  
   182  type ProjectsService struct {
   183  	s *Service
   184  
   185  	Operations *ProjectsOperationsService
   186  
   187  	Submissions *ProjectsSubmissionsService
   188  }
   189  
   190  func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
   191  	rs := &ProjectsOperationsService{s: s}
   192  	return rs
   193  }
   194  
   195  type ProjectsOperationsService struct {
   196  	s *Service
   197  }
   198  
   199  func NewProjectsSubmissionsService(s *Service) *ProjectsSubmissionsService {
   200  	rs := &ProjectsSubmissionsService{s: s}
   201  	return rs
   202  }
   203  
   204  type ProjectsSubmissionsService struct {
   205  	s *Service
   206  }
   207  
   208  func NewThreatListsService(s *Service) *ThreatListsService {
   209  	rs := &ThreatListsService{s: s}
   210  	return rs
   211  }
   212  
   213  type ThreatListsService struct {
   214  	s *Service
   215  }
   216  
   217  func NewUrisService(s *Service) *UrisService {
   218  	rs := &UrisService{s: s}
   219  	return rs
   220  }
   221  
   222  type UrisService struct {
   223  	s *Service
   224  }
   225  
   226  type GoogleCloudWebriskV1ComputeThreatListDiffResponse struct {
   227  	// Additions: A set of entries to add to a local threat type's list.
   228  	Additions *GoogleCloudWebriskV1ThreatEntryAdditions `json:"additions,omitempty"`
   229  	// Checksum: The expected SHA256 hash of the client state; that is, of the
   230  	// sorted list of all hashes present in the database after applying the
   231  	// provided diff. If the client state doesn't match the expected state, the
   232  	// client must discard this diff and retry later.
   233  	Checksum *GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum `json:"checksum,omitempty"`
   234  	// NewVersionToken: The new opaque client version token. This should be
   235  	// retained by the client and passed into the next call of
   236  	// ComputeThreatListDiff as 'version_token'. A separate version token should be
   237  	// stored and used for each threatList.
   238  	NewVersionToken string `json:"newVersionToken,omitempty"`
   239  	// RecommendedNextDiff: The soonest the client should wait before issuing any
   240  	// diff request. Querying sooner is unlikely to produce a meaningful diff.
   241  	// Waiting longer is acceptable considering the use case. If this field is not
   242  	// set clients may update as soon as they want.
   243  	RecommendedNextDiff string `json:"recommendedNextDiff,omitempty"`
   244  	// Removals: A set of entries to remove from a local threat type's list. This
   245  	// field may be empty.
   246  	Removals *GoogleCloudWebriskV1ThreatEntryRemovals `json:"removals,omitempty"`
   247  	// ResponseType: The type of response. This may indicate that an action must be
   248  	// taken by the client when the response is received.
   249  	//
   250  	// Possible values:
   251  	//   "RESPONSE_TYPE_UNSPECIFIED" - Unknown.
   252  	//   "DIFF" - Partial updates are applied to the client's existing local
   253  	// database.
   254  	//   "RESET" - Full updates resets the client's entire local database. This
   255  	// means that either the client had no state, was seriously out-of-date, or the
   256  	// client is believed to be corrupt.
   257  	ResponseType string `json:"responseType,omitempty"`
   258  
   259  	// ServerResponse contains the HTTP response code and headers from the server.
   260  	googleapi.ServerResponse `json:"-"`
   261  	// ForceSendFields is a list of field names (e.g. "Additions") to
   262  	// unconditionally include in API requests. By default, fields with empty or
   263  	// default values are omitted from API requests. See
   264  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   265  	// details.
   266  	ForceSendFields []string `json:"-"`
   267  	// NullFields is a list of field names (e.g. "Additions") to include in API
   268  	// requests with the JSON null value. By default, fields with empty values are
   269  	// omitted from API requests. See
   270  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   271  	NullFields []string `json:"-"`
   272  }
   273  
   274  func (s *GoogleCloudWebriskV1ComputeThreatListDiffResponse) MarshalJSON() ([]byte, error) {
   275  	type NoMethod GoogleCloudWebriskV1ComputeThreatListDiffResponse
   276  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   277  }
   278  
   279  // GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum: The expected
   280  // state of a client's local database.
   281  type GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum struct {
   282  	// Sha256: The SHA256 hash of the client state; that is, of the sorted list of
   283  	// all hashes present in the database.
   284  	Sha256 string `json:"sha256,omitempty"`
   285  	// ForceSendFields is a list of field names (e.g. "Sha256") to unconditionally
   286  	// include in API requests. By default, fields with empty or default values are
   287  	// omitted from API requests. See
   288  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   289  	// details.
   290  	ForceSendFields []string `json:"-"`
   291  	// NullFields is a list of field names (e.g. "Sha256") to include in API
   292  	// requests with the JSON null value. By default, fields with empty values are
   293  	// omitted from API requests. See
   294  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   295  	NullFields []string `json:"-"`
   296  }
   297  
   298  func (s *GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum) MarshalJSON() ([]byte, error) {
   299  	type NoMethod GoogleCloudWebriskV1ComputeThreatListDiffResponseChecksum
   300  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   301  }
   302  
   303  // GoogleCloudWebriskV1RawHashes: The uncompressed threat entries in hash
   304  // format. Hashes can be anywhere from 4 to 32 bytes in size. A large majority
   305  // are 4 bytes, but some hashes are lengthened if they collide with the hash of
   306  // a popular URI. Used for sending ThreatEntryAdditons to clients that do not
   307  // support compression, or when sending non-4-byte hashes to clients that do
   308  // support compression.
   309  type GoogleCloudWebriskV1RawHashes struct {
   310  	// PrefixSize: The number of bytes for each prefix encoded below. This field
   311  	// can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). In
   312  	// practice this is almost always 4, except in exceptional circumstances.
   313  	PrefixSize int64 `json:"prefixSize,omitempty"`
   314  	// RawHashes: The hashes, in binary format, concatenated into one long string.
   315  	// Hashes are sorted in lexicographic order. For JSON API users, hashes are
   316  	// base64-encoded.
   317  	RawHashes string `json:"rawHashes,omitempty"`
   318  	// ForceSendFields is a list of field names (e.g. "PrefixSize") to
   319  	// unconditionally include in API requests. By default, fields with empty or
   320  	// default values are omitted from API requests. See
   321  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   322  	// details.
   323  	ForceSendFields []string `json:"-"`
   324  	// NullFields is a list of field names (e.g. "PrefixSize") to include in API
   325  	// requests with the JSON null value. By default, fields with empty values are
   326  	// omitted from API requests. See
   327  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   328  	NullFields []string `json:"-"`
   329  }
   330  
   331  func (s *GoogleCloudWebriskV1RawHashes) MarshalJSON() ([]byte, error) {
   332  	type NoMethod GoogleCloudWebriskV1RawHashes
   333  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   334  }
   335  
   336  // GoogleCloudWebriskV1RawIndices: A set of raw indices to remove from a local
   337  // list.
   338  type GoogleCloudWebriskV1RawIndices struct {
   339  	// Indices: The indices to remove from a lexicographically-sorted local list.
   340  	Indices []int64 `json:"indices,omitempty"`
   341  	// ForceSendFields is a list of field names (e.g. "Indices") to unconditionally
   342  	// include in API requests. By default, fields with empty or default values are
   343  	// omitted from API requests. See
   344  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   345  	// details.
   346  	ForceSendFields []string `json:"-"`
   347  	// NullFields is a list of field names (e.g. "Indices") to include in API
   348  	// requests with the JSON null value. By default, fields with empty values are
   349  	// omitted from API requests. See
   350  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   351  	NullFields []string `json:"-"`
   352  }
   353  
   354  func (s *GoogleCloudWebriskV1RawIndices) MarshalJSON() ([]byte, error) {
   355  	type NoMethod GoogleCloudWebriskV1RawIndices
   356  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   357  }
   358  
   359  // GoogleCloudWebriskV1RiceDeltaEncoding: The Rice-Golomb encoded data. Used
   360  // for sending compressed 4-byte hashes or compressed removal indices.
   361  type GoogleCloudWebriskV1RiceDeltaEncoding struct {
   362  	// EncodedData: The encoded deltas that are encoded using the Golomb-Rice
   363  	// coder.
   364  	EncodedData string `json:"encodedData,omitempty"`
   365  	// EntryCount: The number of entries that are delta encoded in the encoded
   366  	// data. If only a single integer was encoded, this will be zero and the single
   367  	// value will be stored in `first_value`.
   368  	EntryCount int64 `json:"entryCount,omitempty"`
   369  	// FirstValue: The offset of the first entry in the encoded data, or, if only a
   370  	// single integer was encoded, that single integer's value. If the field is
   371  	// empty or missing, assume zero.
   372  	FirstValue int64 `json:"firstValue,omitempty,string"`
   373  	// RiceParameter: The Golomb-Rice parameter, which is a number between 2 and
   374  	// 28. This field is missing (that is, zero) if `num_entries` is zero.
   375  	RiceParameter int64 `json:"riceParameter,omitempty"`
   376  	// ForceSendFields is a list of field names (e.g. "EncodedData") to
   377  	// unconditionally include in API requests. By default, fields with empty or
   378  	// default values are omitted from API requests. See
   379  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   380  	// details.
   381  	ForceSendFields []string `json:"-"`
   382  	// NullFields is a list of field names (e.g. "EncodedData") to include in API
   383  	// requests with the JSON null value. By default, fields with empty values are
   384  	// omitted from API requests. See
   385  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   386  	NullFields []string `json:"-"`
   387  }
   388  
   389  func (s *GoogleCloudWebriskV1RiceDeltaEncoding) MarshalJSON() ([]byte, error) {
   390  	type NoMethod GoogleCloudWebriskV1RiceDeltaEncoding
   391  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   392  }
   393  
   394  type GoogleCloudWebriskV1SearchHashesResponse struct {
   395  	// NegativeExpireTime: For requested entities that did not match the threat
   396  	// list, how long to cache the response until.
   397  	NegativeExpireTime string `json:"negativeExpireTime,omitempty"`
   398  	// Threats: The full hashes that matched the requested prefixes. The hash will
   399  	// be populated in the key.
   400  	Threats []*GoogleCloudWebriskV1SearchHashesResponseThreatHash `json:"threats,omitempty"`
   401  
   402  	// ServerResponse contains the HTTP response code and headers from the server.
   403  	googleapi.ServerResponse `json:"-"`
   404  	// ForceSendFields is a list of field names (e.g. "NegativeExpireTime") to
   405  	// unconditionally include in API requests. By default, fields with empty or
   406  	// default values are omitted from API requests. See
   407  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   408  	// details.
   409  	ForceSendFields []string `json:"-"`
   410  	// NullFields is a list of field names (e.g. "NegativeExpireTime") to include
   411  	// in API requests with the JSON null value. By default, fields with empty
   412  	// values are omitted from API requests. See
   413  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   414  	NullFields []string `json:"-"`
   415  }
   416  
   417  func (s *GoogleCloudWebriskV1SearchHashesResponse) MarshalJSON() ([]byte, error) {
   418  	type NoMethod GoogleCloudWebriskV1SearchHashesResponse
   419  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   420  }
   421  
   422  // GoogleCloudWebriskV1SearchHashesResponseThreatHash: Contains threat
   423  // information on a matching hash.
   424  type GoogleCloudWebriskV1SearchHashesResponseThreatHash struct {
   425  	// ExpireTime: The cache lifetime for the returned match. Clients must not
   426  	// cache this response past this timestamp to avoid false positives.
   427  	ExpireTime string `json:"expireTime,omitempty"`
   428  	// Hash: A 32 byte SHA256 hash. This field is in binary format. For JSON
   429  	// requests, hashes are base64-encoded.
   430  	Hash string `json:"hash,omitempty"`
   431  	// ThreatTypes: The ThreatList this threat belongs to. This must contain at
   432  	// least one entry.
   433  	//
   434  	// Possible values:
   435  	//   "THREAT_TYPE_UNSPECIFIED" - No entries should match this threat type. This
   436  	// threat type is unused.
   437  	//   "MALWARE" - Malware targeting any platform.
   438  	//   "SOCIAL_ENGINEERING" - Social engineering targeting any platform.
   439  	//   "UNWANTED_SOFTWARE" - Unwanted software targeting any platform.
   440  	//   "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended coverage
   441  	// social engineering URIs targeting any platform.
   442  	ThreatTypes []string `json:"threatTypes,omitempty"`
   443  	// ForceSendFields is a list of field names (e.g. "ExpireTime") to
   444  	// unconditionally include in API requests. By default, fields with empty or
   445  	// default values are omitted from API requests. See
   446  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   447  	// details.
   448  	ForceSendFields []string `json:"-"`
   449  	// NullFields is a list of field names (e.g. "ExpireTime") to include in API
   450  	// requests with the JSON null value. By default, fields with empty values are
   451  	// omitted from API requests. See
   452  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   453  	NullFields []string `json:"-"`
   454  }
   455  
   456  func (s *GoogleCloudWebriskV1SearchHashesResponseThreatHash) MarshalJSON() ([]byte, error) {
   457  	type NoMethod GoogleCloudWebriskV1SearchHashesResponseThreatHash
   458  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   459  }
   460  
   461  type GoogleCloudWebriskV1SearchUrisResponse struct {
   462  	// Threat: The threat list matches. This might be empty if the URI is on no
   463  	// list.
   464  	Threat *GoogleCloudWebriskV1SearchUrisResponseThreatUri `json:"threat,omitempty"`
   465  
   466  	// ServerResponse contains the HTTP response code and headers from the server.
   467  	googleapi.ServerResponse `json:"-"`
   468  	// ForceSendFields is a list of field names (e.g. "Threat") to unconditionally
   469  	// include in API requests. By default, fields with empty or default values are
   470  	// omitted from API requests. See
   471  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   472  	// details.
   473  	ForceSendFields []string `json:"-"`
   474  	// NullFields is a list of field names (e.g. "Threat") to include in API
   475  	// requests with the JSON null value. By default, fields with empty values are
   476  	// omitted from API requests. See
   477  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   478  	NullFields []string `json:"-"`
   479  }
   480  
   481  func (s *GoogleCloudWebriskV1SearchUrisResponse) MarshalJSON() ([]byte, error) {
   482  	type NoMethod GoogleCloudWebriskV1SearchUrisResponse
   483  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   484  }
   485  
   486  // GoogleCloudWebriskV1SearchUrisResponseThreatUri: Contains threat information
   487  // on a matching uri.
   488  type GoogleCloudWebriskV1SearchUrisResponseThreatUri struct {
   489  	// ExpireTime: The cache lifetime for the returned match. Clients must not
   490  	// cache this response past this timestamp to avoid false positives.
   491  	ExpireTime string `json:"expireTime,omitempty"`
   492  	// ThreatTypes: The ThreatList this threat belongs to.
   493  	//
   494  	// Possible values:
   495  	//   "THREAT_TYPE_UNSPECIFIED" - No entries should match this threat type. This
   496  	// threat type is unused.
   497  	//   "MALWARE" - Malware targeting any platform.
   498  	//   "SOCIAL_ENGINEERING" - Social engineering targeting any platform.
   499  	//   "UNWANTED_SOFTWARE" - Unwanted software targeting any platform.
   500  	//   "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended coverage
   501  	// social engineering URIs targeting any platform.
   502  	ThreatTypes []string `json:"threatTypes,omitempty"`
   503  	// ForceSendFields is a list of field names (e.g. "ExpireTime") to
   504  	// unconditionally include in API requests. By default, fields with empty or
   505  	// default values are omitted from API requests. See
   506  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   507  	// details.
   508  	ForceSendFields []string `json:"-"`
   509  	// NullFields is a list of field names (e.g. "ExpireTime") to include in API
   510  	// requests with the JSON null value. By default, fields with empty values are
   511  	// omitted from API requests. See
   512  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   513  	NullFields []string `json:"-"`
   514  }
   515  
   516  func (s *GoogleCloudWebriskV1SearchUrisResponseThreatUri) MarshalJSON() ([]byte, error) {
   517  	type NoMethod GoogleCloudWebriskV1SearchUrisResponseThreatUri
   518  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   519  }
   520  
   521  // GoogleCloudWebriskV1Submission: Wraps a URI that might be displaying
   522  // malicious content.
   523  type GoogleCloudWebriskV1Submission struct {
   524  	// Uri: Required. The URI that is being reported for malicious content to be
   525  	// analyzed.
   526  	Uri string `json:"uri,omitempty"`
   527  
   528  	// ServerResponse contains the HTTP response code and headers from the server.
   529  	googleapi.ServerResponse `json:"-"`
   530  	// ForceSendFields is a list of field names (e.g. "Uri") to unconditionally
   531  	// include in API requests. By default, fields with empty or default values are
   532  	// omitted from API requests. See
   533  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   534  	// details.
   535  	ForceSendFields []string `json:"-"`
   536  	// NullFields is a list of field names (e.g. "Uri") to include in API requests
   537  	// with the JSON null value. By default, fields with empty values are omitted
   538  	// from API requests. See
   539  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   540  	NullFields []string `json:"-"`
   541  }
   542  
   543  func (s *GoogleCloudWebriskV1Submission) MarshalJSON() ([]byte, error) {
   544  	type NoMethod GoogleCloudWebriskV1Submission
   545  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   546  }
   547  
   548  // GoogleCloudWebriskV1ThreatEntryAdditions: Contains the set of entries to add
   549  // to a local database. May contain a combination of compressed and raw data in
   550  // a single response.
   551  type GoogleCloudWebriskV1ThreatEntryAdditions struct {
   552  	// RawHashes: The raw SHA256-formatted entries. Repeated to allow returning
   553  	// sets of hashes with different prefix sizes.
   554  	RawHashes []*GoogleCloudWebriskV1RawHashes `json:"rawHashes,omitempty"`
   555  	// RiceHashes: The encoded 4-byte prefixes of SHA256-formatted entries, using a
   556  	// Golomb-Rice encoding. The hashes are converted to uint32, sorted in
   557  	// ascending order, then delta encoded and stored as encoded_data.
   558  	RiceHashes *GoogleCloudWebriskV1RiceDeltaEncoding `json:"riceHashes,omitempty"`
   559  	// ForceSendFields is a list of field names (e.g. "RawHashes") to
   560  	// unconditionally include in API requests. By default, fields with empty or
   561  	// default values are omitted from API requests. See
   562  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   563  	// details.
   564  	ForceSendFields []string `json:"-"`
   565  	// NullFields is a list of field names (e.g. "RawHashes") to include in API
   566  	// requests with the JSON null value. By default, fields with empty values are
   567  	// omitted from API requests. See
   568  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   569  	NullFields []string `json:"-"`
   570  }
   571  
   572  func (s *GoogleCloudWebriskV1ThreatEntryAdditions) MarshalJSON() ([]byte, error) {
   573  	type NoMethod GoogleCloudWebriskV1ThreatEntryAdditions
   574  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   575  }
   576  
   577  // GoogleCloudWebriskV1ThreatEntryRemovals: Contains the set of entries to
   578  // remove from a local database.
   579  type GoogleCloudWebriskV1ThreatEntryRemovals struct {
   580  	// RawIndices: The raw removal indices for a local list.
   581  	RawIndices *GoogleCloudWebriskV1RawIndices `json:"rawIndices,omitempty"`
   582  	// RiceIndices: The encoded local, lexicographically-sorted list indices, using
   583  	// a Golomb-Rice encoding. Used for sending compressed removal indices. The
   584  	// removal indices (uint32) are sorted in ascending order, then delta encoded
   585  	// and stored as encoded_data.
   586  	RiceIndices *GoogleCloudWebriskV1RiceDeltaEncoding `json:"riceIndices,omitempty"`
   587  	// ForceSendFields is a list of field names (e.g. "RawIndices") to
   588  	// unconditionally include in API requests. By default, fields with empty or
   589  	// default values are omitted from API requests. See
   590  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   591  	// details.
   592  	ForceSendFields []string `json:"-"`
   593  	// NullFields is a list of field names (e.g. "RawIndices") to include in API
   594  	// requests with the JSON null value. By default, fields with empty values are
   595  	// omitted from API requests. See
   596  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   597  	NullFields []string `json:"-"`
   598  }
   599  
   600  func (s *GoogleCloudWebriskV1ThreatEntryRemovals) MarshalJSON() ([]byte, error) {
   601  	type NoMethod GoogleCloudWebriskV1ThreatEntryRemovals
   602  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   603  }
   604  
   605  // GoogleLongrunningCancelOperationRequest: The request message for
   606  // Operations.CancelOperation.
   607  type GoogleLongrunningCancelOperationRequest struct {
   608  }
   609  
   610  // GoogleLongrunningListOperationsResponse: The response message for
   611  // Operations.ListOperations.
   612  type GoogleLongrunningListOperationsResponse struct {
   613  	// NextPageToken: The standard List next-page token.
   614  	NextPageToken string `json:"nextPageToken,omitempty"`
   615  	// Operations: A list of operations that matches the specified filter in the
   616  	// request.
   617  	Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
   618  
   619  	// ServerResponse contains the HTTP response code and headers from the server.
   620  	googleapi.ServerResponse `json:"-"`
   621  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   622  	// unconditionally include in API requests. By default, fields with empty or
   623  	// default values are omitted from API requests. See
   624  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   625  	// details.
   626  	ForceSendFields []string `json:"-"`
   627  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   628  	// requests with the JSON null value. By default, fields with empty values are
   629  	// omitted from API requests. See
   630  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   631  	NullFields []string `json:"-"`
   632  }
   633  
   634  func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
   635  	type NoMethod GoogleLongrunningListOperationsResponse
   636  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   637  }
   638  
   639  // GoogleLongrunningOperation: This resource represents a long-running
   640  // operation that is the result of a network API call.
   641  type GoogleLongrunningOperation struct {
   642  	// Done: If the value is `false`, it means the operation is still in progress.
   643  	// If `true`, the operation is completed, and either `error` or `response` is
   644  	// available.
   645  	Done bool `json:"done,omitempty"`
   646  	// Error: The error result of the operation in case of failure or cancellation.
   647  	Error *GoogleRpcStatus `json:"error,omitempty"`
   648  	// Metadata: Contains a `SubmitUriMetadata` object.
   649  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   650  	// Name: Matches the `/v1/{project-name}/operations/{operation-id}` pattern.
   651  	Name string `json:"name,omitempty"`
   652  	// Response: The normal, successful response of the operation. If the original
   653  	// method returns no data on success, such as `Delete`, the response is
   654  	// `google.protobuf.Empty`. If the original method is standard
   655  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   656  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   657  	// original method name. For example, if the original method name is
   658  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   659  	Response googleapi.RawMessage `json:"response,omitempty"`
   660  
   661  	// ServerResponse contains the HTTP response code and headers from the server.
   662  	googleapi.ServerResponse `json:"-"`
   663  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   664  	// include in API requests. By default, fields with empty or default values are
   665  	// omitted from API requests. See
   666  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   667  	// details.
   668  	ForceSendFields []string `json:"-"`
   669  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   670  	// with the JSON null value. By default, fields with empty values are omitted
   671  	// from API requests. See
   672  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   673  	NullFields []string `json:"-"`
   674  }
   675  
   676  func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
   677  	type NoMethod GoogleLongrunningOperation
   678  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   679  }
   680  
   681  // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid
   682  // defining duplicated empty messages in your APIs. A typical example is to use
   683  // it as the request or the response type of an API method. For instance:
   684  // service Foo { rpc Bar(google.protobuf.Empty) returns
   685  // (google.protobuf.Empty); }
   686  type GoogleProtobufEmpty struct {
   687  	// ServerResponse contains the HTTP response code and headers from the server.
   688  	googleapi.ServerResponse `json:"-"`
   689  }
   690  
   691  // GoogleRpcStatus: The `Status` type defines a logical error model that is
   692  // suitable for different programming environments, including REST APIs and RPC
   693  // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
   694  // contains three pieces of data: error code, error message, and error details.
   695  // You can find out more about this error model and how to work with it in the
   696  // API Design Guide (https://cloud.google.com/apis/design/errors).
   697  type GoogleRpcStatus struct {
   698  	// Code: The status code, which should be an enum value of google.rpc.Code.
   699  	Code int64 `json:"code,omitempty"`
   700  	// Details: A list of messages that carry the error details. There is a common
   701  	// set of message types for APIs to use.
   702  	Details []googleapi.RawMessage `json:"details,omitempty"`
   703  	// Message: A developer-facing error message, which should be in English. Any
   704  	// user-facing error message should be localized and sent in the
   705  	// google.rpc.Status.details field, or localized by the client.
   706  	Message string `json:"message,omitempty"`
   707  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   708  	// include in API requests. By default, fields with empty or default values are
   709  	// omitted from API requests. See
   710  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   711  	// details.
   712  	ForceSendFields []string `json:"-"`
   713  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   714  	// with the JSON null value. By default, fields with empty values are omitted
   715  	// from API requests. See
   716  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   717  	NullFields []string `json:"-"`
   718  }
   719  
   720  func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
   721  	type NoMethod GoogleRpcStatus
   722  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   723  }
   724  
   725  type HashesSearchCall struct {
   726  	s            *Service
   727  	urlParams_   gensupport.URLParams
   728  	ifNoneMatch_ string
   729  	ctx_         context.Context
   730  	header_      http.Header
   731  }
   732  
   733  // Search: Gets the full hashes that match the requested hash prefix. This is
   734  // used after a hash prefix is looked up in a threatList and there is a match.
   735  // The client side threatList only holds partial hashes so the client must
   736  // query this method to determine if there is a full hash match of a threat.
   737  func (r *HashesService) Search() *HashesSearchCall {
   738  	c := &HashesSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   739  	return c
   740  }
   741  
   742  // HashPrefix sets the optional parameter "hashPrefix": A hash prefix,
   743  // consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON
   744  // requests, this field is base64-encoded. Note that if this parameter is
   745  // provided by a URI, it must be encoded using the web safe base64 variant (RFC
   746  // 4648).
   747  func (c *HashesSearchCall) HashPrefix(hashPrefix string) *HashesSearchCall {
   748  	c.urlParams_.Set("hashPrefix", hashPrefix)
   749  	return c
   750  }
   751  
   752  // ThreatTypes sets the optional parameter "threatTypes": Required. The
   753  // ThreatLists to search in. Multiple ThreatLists may be specified.
   754  //
   755  // Possible values:
   756  //
   757  //	"THREAT_TYPE_UNSPECIFIED" - No entries should match this threat type. This
   758  //
   759  // threat type is unused.
   760  //
   761  //	"MALWARE" - Malware targeting any platform.
   762  //	"SOCIAL_ENGINEERING" - Social engineering targeting any platform.
   763  //	"UNWANTED_SOFTWARE" - Unwanted software targeting any platform.
   764  //	"SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended coverage
   765  //
   766  // social engineering URIs targeting any platform.
   767  func (c *HashesSearchCall) ThreatTypes(threatTypes ...string) *HashesSearchCall {
   768  	c.urlParams_.SetMulti("threatTypes", append([]string{}, threatTypes...))
   769  	return c
   770  }
   771  
   772  // Fields allows partial responses to be retrieved. See
   773  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   774  // details.
   775  func (c *HashesSearchCall) Fields(s ...googleapi.Field) *HashesSearchCall {
   776  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   777  	return c
   778  }
   779  
   780  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   781  // object's ETag matches the given value. This is useful for getting updates
   782  // only after the object has changed since the last request.
   783  func (c *HashesSearchCall) IfNoneMatch(entityTag string) *HashesSearchCall {
   784  	c.ifNoneMatch_ = entityTag
   785  	return c
   786  }
   787  
   788  // Context sets the context to be used in this call's Do method.
   789  func (c *HashesSearchCall) Context(ctx context.Context) *HashesSearchCall {
   790  	c.ctx_ = ctx
   791  	return c
   792  }
   793  
   794  // Header returns a http.Header that can be modified by the caller to add
   795  // headers to the request.
   796  func (c *HashesSearchCall) Header() http.Header {
   797  	if c.header_ == nil {
   798  		c.header_ = make(http.Header)
   799  	}
   800  	return c.header_
   801  }
   802  
   803  func (c *HashesSearchCall) doRequest(alt string) (*http.Response, error) {
   804  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   805  	if c.ifNoneMatch_ != "" {
   806  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   807  	}
   808  	var body io.Reader = nil
   809  	c.urlParams_.Set("alt", alt)
   810  	c.urlParams_.Set("prettyPrint", "false")
   811  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/hashes:search")
   812  	urls += "?" + c.urlParams_.Encode()
   813  	req, err := http.NewRequest("GET", urls, body)
   814  	if err != nil {
   815  		return nil, err
   816  	}
   817  	req.Header = reqHeaders
   818  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   819  }
   820  
   821  // Do executes the "webrisk.hashes.search" call.
   822  // Any non-2xx status code is an error. Response headers are in either
   823  // *GoogleCloudWebriskV1SearchHashesResponse.ServerResponse.Header or (if a
   824  // response was returned at all) in error.(*googleapi.Error).Header. Use
   825  // googleapi.IsNotModified to check whether the returned error was because
   826  // http.StatusNotModified was returned.
   827  func (c *HashesSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebriskV1SearchHashesResponse, error) {
   828  	gensupport.SetOptions(c.urlParams_, opts...)
   829  	res, err := c.doRequest("json")
   830  	if res != nil && res.StatusCode == http.StatusNotModified {
   831  		if res.Body != nil {
   832  			res.Body.Close()
   833  		}
   834  		return nil, gensupport.WrapError(&googleapi.Error{
   835  			Code:   res.StatusCode,
   836  			Header: res.Header,
   837  		})
   838  	}
   839  	if err != nil {
   840  		return nil, err
   841  	}
   842  	defer googleapi.CloseBody(res)
   843  	if err := googleapi.CheckResponse(res); err != nil {
   844  		return nil, gensupport.WrapError(err)
   845  	}
   846  	ret := &GoogleCloudWebriskV1SearchHashesResponse{
   847  		ServerResponse: googleapi.ServerResponse{
   848  			Header:         res.Header,
   849  			HTTPStatusCode: res.StatusCode,
   850  		},
   851  	}
   852  	target := &ret
   853  	if err := gensupport.DecodeResponse(target, res); err != nil {
   854  		return nil, err
   855  	}
   856  	return ret, nil
   857  }
   858  
   859  type ProjectsOperationsCancelCall struct {
   860  	s                                       *Service
   861  	name                                    string
   862  	googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest
   863  	urlParams_                              gensupport.URLParams
   864  	ctx_                                    context.Context
   865  	header_                                 http.Header
   866  }
   867  
   868  // Cancel: Starts asynchronous cancellation on a long-running operation. The
   869  // server makes a best effort to cancel the operation, but success is not
   870  // guaranteed. If the server doesn't support this method, it returns
   871  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
   872  // other methods to check whether the cancellation succeeded or whether the
   873  // operation completed despite cancellation. On successful cancellation, the
   874  // operation is not deleted; instead, it becomes an operation with an
   875  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
   876  // `Code.CANCELLED`.
   877  //
   878  // - name: The name of the operation resource to be cancelled.
   879  func (r *ProjectsOperationsService) Cancel(name string, googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest) *ProjectsOperationsCancelCall {
   880  	c := &ProjectsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   881  	c.name = name
   882  	c.googlelongrunningcanceloperationrequest = googlelongrunningcanceloperationrequest
   883  	return c
   884  }
   885  
   886  // Fields allows partial responses to be retrieved. See
   887  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   888  // details.
   889  func (c *ProjectsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsOperationsCancelCall {
   890  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   891  	return c
   892  }
   893  
   894  // Context sets the context to be used in this call's Do method.
   895  func (c *ProjectsOperationsCancelCall) Context(ctx context.Context) *ProjectsOperationsCancelCall {
   896  	c.ctx_ = ctx
   897  	return c
   898  }
   899  
   900  // Header returns a http.Header that can be modified by the caller to add
   901  // headers to the request.
   902  func (c *ProjectsOperationsCancelCall) Header() http.Header {
   903  	if c.header_ == nil {
   904  		c.header_ = make(http.Header)
   905  	}
   906  	return c.header_
   907  }
   908  
   909  func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
   910  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   911  	var body io.Reader = nil
   912  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest)
   913  	if err != nil {
   914  		return nil, err
   915  	}
   916  	c.urlParams_.Set("alt", alt)
   917  	c.urlParams_.Set("prettyPrint", "false")
   918  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
   919  	urls += "?" + c.urlParams_.Encode()
   920  	req, err := http.NewRequest("POST", urls, body)
   921  	if err != nil {
   922  		return nil, err
   923  	}
   924  	req.Header = reqHeaders
   925  	googleapi.Expand(req.URL, map[string]string{
   926  		"name": c.name,
   927  	})
   928  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   929  }
   930  
   931  // Do executes the "webrisk.projects.operations.cancel" call.
   932  // Any non-2xx status code is an error. Response headers are in either
   933  // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
   934  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   935  // check whether the returned error was because http.StatusNotModified was
   936  // returned.
   937  func (c *ProjectsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
   938  	gensupport.SetOptions(c.urlParams_, opts...)
   939  	res, err := c.doRequest("json")
   940  	if res != nil && res.StatusCode == http.StatusNotModified {
   941  		if res.Body != nil {
   942  			res.Body.Close()
   943  		}
   944  		return nil, gensupport.WrapError(&googleapi.Error{
   945  			Code:   res.StatusCode,
   946  			Header: res.Header,
   947  		})
   948  	}
   949  	if err != nil {
   950  		return nil, err
   951  	}
   952  	defer googleapi.CloseBody(res)
   953  	if err := googleapi.CheckResponse(res); err != nil {
   954  		return nil, gensupport.WrapError(err)
   955  	}
   956  	ret := &GoogleProtobufEmpty{
   957  		ServerResponse: googleapi.ServerResponse{
   958  			Header:         res.Header,
   959  			HTTPStatusCode: res.StatusCode,
   960  		},
   961  	}
   962  	target := &ret
   963  	if err := gensupport.DecodeResponse(target, res); err != nil {
   964  		return nil, err
   965  	}
   966  	return ret, nil
   967  }
   968  
   969  type ProjectsOperationsDeleteCall struct {
   970  	s          *Service
   971  	name       string
   972  	urlParams_ gensupport.URLParams
   973  	ctx_       context.Context
   974  	header_    http.Header
   975  }
   976  
   977  // Delete: Deletes a long-running operation. This method indicates that the
   978  // client is no longer interested in the operation result. It does not cancel
   979  // the operation. If the server doesn't support this method, it returns
   980  // `google.rpc.Code.UNIMPLEMENTED`.
   981  //
   982  // - name: The name of the operation resource to be deleted.
   983  func (r *ProjectsOperationsService) Delete(name string) *ProjectsOperationsDeleteCall {
   984  	c := &ProjectsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   985  	c.name = name
   986  	return c
   987  }
   988  
   989  // Fields allows partial responses to be retrieved. See
   990  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   991  // details.
   992  func (c *ProjectsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsOperationsDeleteCall {
   993  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   994  	return c
   995  }
   996  
   997  // Context sets the context to be used in this call's Do method.
   998  func (c *ProjectsOperationsDeleteCall) Context(ctx context.Context) *ProjectsOperationsDeleteCall {
   999  	c.ctx_ = ctx
  1000  	return c
  1001  }
  1002  
  1003  // Header returns a http.Header that can be modified by the caller to add
  1004  // headers to the request.
  1005  func (c *ProjectsOperationsDeleteCall) Header() http.Header {
  1006  	if c.header_ == nil {
  1007  		c.header_ = make(http.Header)
  1008  	}
  1009  	return c.header_
  1010  }
  1011  
  1012  func (c *ProjectsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1013  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1014  	var body io.Reader = nil
  1015  	c.urlParams_.Set("alt", alt)
  1016  	c.urlParams_.Set("prettyPrint", "false")
  1017  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1018  	urls += "?" + c.urlParams_.Encode()
  1019  	req, err := http.NewRequest("DELETE", urls, body)
  1020  	if err != nil {
  1021  		return nil, err
  1022  	}
  1023  	req.Header = reqHeaders
  1024  	googleapi.Expand(req.URL, map[string]string{
  1025  		"name": c.name,
  1026  	})
  1027  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1028  }
  1029  
  1030  // Do executes the "webrisk.projects.operations.delete" call.
  1031  // Any non-2xx status code is an error. Response headers are in either
  1032  // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
  1033  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1034  // check whether the returned error was because http.StatusNotModified was
  1035  // returned.
  1036  func (c *ProjectsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  1037  	gensupport.SetOptions(c.urlParams_, opts...)
  1038  	res, err := c.doRequest("json")
  1039  	if res != nil && res.StatusCode == http.StatusNotModified {
  1040  		if res.Body != nil {
  1041  			res.Body.Close()
  1042  		}
  1043  		return nil, gensupport.WrapError(&googleapi.Error{
  1044  			Code:   res.StatusCode,
  1045  			Header: res.Header,
  1046  		})
  1047  	}
  1048  	if err != nil {
  1049  		return nil, err
  1050  	}
  1051  	defer googleapi.CloseBody(res)
  1052  	if err := googleapi.CheckResponse(res); err != nil {
  1053  		return nil, gensupport.WrapError(err)
  1054  	}
  1055  	ret := &GoogleProtobufEmpty{
  1056  		ServerResponse: googleapi.ServerResponse{
  1057  			Header:         res.Header,
  1058  			HTTPStatusCode: res.StatusCode,
  1059  		},
  1060  	}
  1061  	target := &ret
  1062  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1063  		return nil, err
  1064  	}
  1065  	return ret, nil
  1066  }
  1067  
  1068  type ProjectsOperationsGetCall struct {
  1069  	s            *Service
  1070  	name         string
  1071  	urlParams_   gensupport.URLParams
  1072  	ifNoneMatch_ string
  1073  	ctx_         context.Context
  1074  	header_      http.Header
  1075  }
  1076  
  1077  // Get: Gets the latest state of a long-running operation. Clients can use this
  1078  // method to poll the operation result at intervals as recommended by the API
  1079  // service.
  1080  //
  1081  // - name: The name of the operation resource.
  1082  func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  1083  	c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1084  	c.name = name
  1085  	return c
  1086  }
  1087  
  1088  // Fields allows partial responses to be retrieved. See
  1089  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1090  // details.
  1091  func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  1092  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1093  	return c
  1094  }
  1095  
  1096  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1097  // object's ETag matches the given value. This is useful for getting updates
  1098  // only after the object has changed since the last request.
  1099  func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  1100  	c.ifNoneMatch_ = entityTag
  1101  	return c
  1102  }
  1103  
  1104  // Context sets the context to be used in this call's Do method.
  1105  func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  1106  	c.ctx_ = ctx
  1107  	return c
  1108  }
  1109  
  1110  // Header returns a http.Header that can be modified by the caller to add
  1111  // headers to the request.
  1112  func (c *ProjectsOperationsGetCall) Header() http.Header {
  1113  	if c.header_ == nil {
  1114  		c.header_ = make(http.Header)
  1115  	}
  1116  	return c.header_
  1117  }
  1118  
  1119  func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1120  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1121  	if c.ifNoneMatch_ != "" {
  1122  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1123  	}
  1124  	var body io.Reader = nil
  1125  	c.urlParams_.Set("alt", alt)
  1126  	c.urlParams_.Set("prettyPrint", "false")
  1127  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1128  	urls += "?" + c.urlParams_.Encode()
  1129  	req, err := http.NewRequest("GET", urls, body)
  1130  	if err != nil {
  1131  		return nil, err
  1132  	}
  1133  	req.Header = reqHeaders
  1134  	googleapi.Expand(req.URL, map[string]string{
  1135  		"name": c.name,
  1136  	})
  1137  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1138  }
  1139  
  1140  // Do executes the "webrisk.projects.operations.get" call.
  1141  // Any non-2xx status code is an error. Response headers are in either
  1142  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1143  // returned at all) in error.(*googleapi.Error).Header. Use
  1144  // googleapi.IsNotModified to check whether the returned error was because
  1145  // http.StatusNotModified was returned.
  1146  func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1147  	gensupport.SetOptions(c.urlParams_, opts...)
  1148  	res, err := c.doRequest("json")
  1149  	if res != nil && res.StatusCode == http.StatusNotModified {
  1150  		if res.Body != nil {
  1151  			res.Body.Close()
  1152  		}
  1153  		return nil, gensupport.WrapError(&googleapi.Error{
  1154  			Code:   res.StatusCode,
  1155  			Header: res.Header,
  1156  		})
  1157  	}
  1158  	if err != nil {
  1159  		return nil, err
  1160  	}
  1161  	defer googleapi.CloseBody(res)
  1162  	if err := googleapi.CheckResponse(res); err != nil {
  1163  		return nil, gensupport.WrapError(err)
  1164  	}
  1165  	ret := &GoogleLongrunningOperation{
  1166  		ServerResponse: googleapi.ServerResponse{
  1167  			Header:         res.Header,
  1168  			HTTPStatusCode: res.StatusCode,
  1169  		},
  1170  	}
  1171  	target := &ret
  1172  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1173  		return nil, err
  1174  	}
  1175  	return ret, nil
  1176  }
  1177  
  1178  type ProjectsOperationsListCall struct {
  1179  	s            *Service
  1180  	name         string
  1181  	urlParams_   gensupport.URLParams
  1182  	ifNoneMatch_ string
  1183  	ctx_         context.Context
  1184  	header_      http.Header
  1185  }
  1186  
  1187  // List: Lists operations that match the specified filter in the request. If
  1188  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  1189  //
  1190  // - name: The name of the operation's parent resource.
  1191  func (r *ProjectsOperationsService) List(name string) *ProjectsOperationsListCall {
  1192  	c := &ProjectsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1193  	c.name = name
  1194  	return c
  1195  }
  1196  
  1197  // Filter sets the optional parameter "filter": The standard list filter.
  1198  func (c *ProjectsOperationsListCall) Filter(filter string) *ProjectsOperationsListCall {
  1199  	c.urlParams_.Set("filter", filter)
  1200  	return c
  1201  }
  1202  
  1203  // PageSize sets the optional parameter "pageSize": The standard list page
  1204  // size.
  1205  func (c *ProjectsOperationsListCall) PageSize(pageSize int64) *ProjectsOperationsListCall {
  1206  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1207  	return c
  1208  }
  1209  
  1210  // PageToken sets the optional parameter "pageToken": The standard list page
  1211  // token.
  1212  func (c *ProjectsOperationsListCall) PageToken(pageToken string) *ProjectsOperationsListCall {
  1213  	c.urlParams_.Set("pageToken", pageToken)
  1214  	return c
  1215  }
  1216  
  1217  // Fields allows partial responses to be retrieved. See
  1218  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1219  // details.
  1220  func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall {
  1221  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1222  	return c
  1223  }
  1224  
  1225  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1226  // object's ETag matches the given value. This is useful for getting updates
  1227  // only after the object has changed since the last request.
  1228  func (c *ProjectsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsOperationsListCall {
  1229  	c.ifNoneMatch_ = entityTag
  1230  	return c
  1231  }
  1232  
  1233  // Context sets the context to be used in this call's Do method.
  1234  func (c *ProjectsOperationsListCall) Context(ctx context.Context) *ProjectsOperationsListCall {
  1235  	c.ctx_ = ctx
  1236  	return c
  1237  }
  1238  
  1239  // Header returns a http.Header that can be modified by the caller to add
  1240  // headers to the request.
  1241  func (c *ProjectsOperationsListCall) Header() http.Header {
  1242  	if c.header_ == nil {
  1243  		c.header_ = make(http.Header)
  1244  	}
  1245  	return c.header_
  1246  }
  1247  
  1248  func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1249  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1250  	if c.ifNoneMatch_ != "" {
  1251  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1252  	}
  1253  	var body io.Reader = nil
  1254  	c.urlParams_.Set("alt", alt)
  1255  	c.urlParams_.Set("prettyPrint", "false")
  1256  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  1257  	urls += "?" + c.urlParams_.Encode()
  1258  	req, err := http.NewRequest("GET", urls, body)
  1259  	if err != nil {
  1260  		return nil, err
  1261  	}
  1262  	req.Header = reqHeaders
  1263  	googleapi.Expand(req.URL, map[string]string{
  1264  		"name": c.name,
  1265  	})
  1266  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1267  }
  1268  
  1269  // Do executes the "webrisk.projects.operations.list" call.
  1270  // Any non-2xx status code is an error. Response headers are in either
  1271  // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
  1272  // response was returned at all) in error.(*googleapi.Error).Header. Use
  1273  // googleapi.IsNotModified to check whether the returned error was because
  1274  // http.StatusNotModified was returned.
  1275  func (c *ProjectsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  1276  	gensupport.SetOptions(c.urlParams_, opts...)
  1277  	res, err := c.doRequest("json")
  1278  	if res != nil && res.StatusCode == http.StatusNotModified {
  1279  		if res.Body != nil {
  1280  			res.Body.Close()
  1281  		}
  1282  		return nil, gensupport.WrapError(&googleapi.Error{
  1283  			Code:   res.StatusCode,
  1284  			Header: res.Header,
  1285  		})
  1286  	}
  1287  	if err != nil {
  1288  		return nil, err
  1289  	}
  1290  	defer googleapi.CloseBody(res)
  1291  	if err := googleapi.CheckResponse(res); err != nil {
  1292  		return nil, gensupport.WrapError(err)
  1293  	}
  1294  	ret := &GoogleLongrunningListOperationsResponse{
  1295  		ServerResponse: googleapi.ServerResponse{
  1296  			Header:         res.Header,
  1297  			HTTPStatusCode: res.StatusCode,
  1298  		},
  1299  	}
  1300  	target := &ret
  1301  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1302  		return nil, err
  1303  	}
  1304  	return ret, nil
  1305  }
  1306  
  1307  // Pages invokes f for each page of results.
  1308  // A non-nil error returned from f will halt the iteration.
  1309  // The provided context supersedes any context provided to the Context method.
  1310  func (c *ProjectsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  1311  	c.ctx_ = ctx
  1312  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1313  	for {
  1314  		x, err := c.Do()
  1315  		if err != nil {
  1316  			return err
  1317  		}
  1318  		if err := f(x); err != nil {
  1319  			return err
  1320  		}
  1321  		if x.NextPageToken == "" {
  1322  			return nil
  1323  		}
  1324  		c.PageToken(x.NextPageToken)
  1325  	}
  1326  }
  1327  
  1328  type ProjectsSubmissionsCreateCall struct {
  1329  	s                              *Service
  1330  	parent                         string
  1331  	googlecloudwebriskv1submission *GoogleCloudWebriskV1Submission
  1332  	urlParams_                     gensupport.URLParams
  1333  	ctx_                           context.Context
  1334  	header_                        http.Header
  1335  }
  1336  
  1337  // Create: Creates a Submission of a URI suspected of containing phishing
  1338  // content to be reviewed. If the result verifies the existence of malicious
  1339  // phishing content, the site will be added to the Google's Social Engineering
  1340  // lists (https://support.google.com/webmasters/answer/6350487/) in order to
  1341  // protect users that could get exposed to this threat in the future. Only
  1342  // allowlisted projects can use this method during Early Access. Please reach
  1343  // out to Sales or your customer engineer to obtain access.
  1344  //
  1345  //   - parent: The name of the project that is making the submission. This string
  1346  //     is in the format "projects/{project_number}".
  1347  func (r *ProjectsSubmissionsService) Create(parent string, googlecloudwebriskv1submission *GoogleCloudWebriskV1Submission) *ProjectsSubmissionsCreateCall {
  1348  	c := &ProjectsSubmissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1349  	c.parent = parent
  1350  	c.googlecloudwebriskv1submission = googlecloudwebriskv1submission
  1351  	return c
  1352  }
  1353  
  1354  // Fields allows partial responses to be retrieved. See
  1355  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1356  // details.
  1357  func (c *ProjectsSubmissionsCreateCall) Fields(s ...googleapi.Field) *ProjectsSubmissionsCreateCall {
  1358  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1359  	return c
  1360  }
  1361  
  1362  // Context sets the context to be used in this call's Do method.
  1363  func (c *ProjectsSubmissionsCreateCall) Context(ctx context.Context) *ProjectsSubmissionsCreateCall {
  1364  	c.ctx_ = ctx
  1365  	return c
  1366  }
  1367  
  1368  // Header returns a http.Header that can be modified by the caller to add
  1369  // headers to the request.
  1370  func (c *ProjectsSubmissionsCreateCall) Header() http.Header {
  1371  	if c.header_ == nil {
  1372  		c.header_ = make(http.Header)
  1373  	}
  1374  	return c.header_
  1375  }
  1376  
  1377  func (c *ProjectsSubmissionsCreateCall) doRequest(alt string) (*http.Response, error) {
  1378  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1379  	var body io.Reader = nil
  1380  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudwebriskv1submission)
  1381  	if err != nil {
  1382  		return nil, err
  1383  	}
  1384  	c.urlParams_.Set("alt", alt)
  1385  	c.urlParams_.Set("prettyPrint", "false")
  1386  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/submissions")
  1387  	urls += "?" + c.urlParams_.Encode()
  1388  	req, err := http.NewRequest("POST", urls, body)
  1389  	if err != nil {
  1390  		return nil, err
  1391  	}
  1392  	req.Header = reqHeaders
  1393  	googleapi.Expand(req.URL, map[string]string{
  1394  		"parent": c.parent,
  1395  	})
  1396  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1397  }
  1398  
  1399  // Do executes the "webrisk.projects.submissions.create" call.
  1400  // Any non-2xx status code is an error. Response headers are in either
  1401  // *GoogleCloudWebriskV1Submission.ServerResponse.Header or (if a response was
  1402  // returned at all) in error.(*googleapi.Error).Header. Use
  1403  // googleapi.IsNotModified to check whether the returned error was because
  1404  // http.StatusNotModified was returned.
  1405  func (c *ProjectsSubmissionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebriskV1Submission, error) {
  1406  	gensupport.SetOptions(c.urlParams_, opts...)
  1407  	res, err := c.doRequest("json")
  1408  	if res != nil && res.StatusCode == http.StatusNotModified {
  1409  		if res.Body != nil {
  1410  			res.Body.Close()
  1411  		}
  1412  		return nil, gensupport.WrapError(&googleapi.Error{
  1413  			Code:   res.StatusCode,
  1414  			Header: res.Header,
  1415  		})
  1416  	}
  1417  	if err != nil {
  1418  		return nil, err
  1419  	}
  1420  	defer googleapi.CloseBody(res)
  1421  	if err := googleapi.CheckResponse(res); err != nil {
  1422  		return nil, gensupport.WrapError(err)
  1423  	}
  1424  	ret := &GoogleCloudWebriskV1Submission{
  1425  		ServerResponse: googleapi.ServerResponse{
  1426  			Header:         res.Header,
  1427  			HTTPStatusCode: res.StatusCode,
  1428  		},
  1429  	}
  1430  	target := &ret
  1431  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1432  		return nil, err
  1433  	}
  1434  	return ret, nil
  1435  }
  1436  
  1437  type ThreatListsComputeDiffCall struct {
  1438  	s            *Service
  1439  	urlParams_   gensupport.URLParams
  1440  	ifNoneMatch_ string
  1441  	ctx_         context.Context
  1442  	header_      http.Header
  1443  }
  1444  
  1445  // ComputeDiff: Gets the most recent threat list diffs. These diffs should be
  1446  // applied to a local database of hashes to keep it up-to-date. If the local
  1447  // database is empty or excessively out-of-date, a complete snapshot of the
  1448  // database will be returned. This Method only updates a single ThreatList at a
  1449  // time. To update multiple ThreatList databases, this method needs to be
  1450  // called once for each list.
  1451  func (r *ThreatListsService) ComputeDiff() *ThreatListsComputeDiffCall {
  1452  	c := &ThreatListsComputeDiffCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1453  	return c
  1454  }
  1455  
  1456  // ConstraintsMaxDatabaseEntries sets the optional parameter
  1457  // "constraints.maxDatabaseEntries": Sets the maximum number of entries that
  1458  // the client is willing to have in the local database. This should be a power
  1459  // of 2 between 2**10 and 2**20. If zero, no database size limit is set.
  1460  func (c *ThreatListsComputeDiffCall) ConstraintsMaxDatabaseEntries(constraintsMaxDatabaseEntries int64) *ThreatListsComputeDiffCall {
  1461  	c.urlParams_.Set("constraints.maxDatabaseEntries", fmt.Sprint(constraintsMaxDatabaseEntries))
  1462  	return c
  1463  }
  1464  
  1465  // ConstraintsMaxDiffEntries sets the optional parameter
  1466  // "constraints.maxDiffEntries": The maximum size in number of entries. The
  1467  // diff will not contain more entries than this value. This should be a power
  1468  // of 2 between 2**10 and 2**20. If zero, no diff size limit is set.
  1469  func (c *ThreatListsComputeDiffCall) ConstraintsMaxDiffEntries(constraintsMaxDiffEntries int64) *ThreatListsComputeDiffCall {
  1470  	c.urlParams_.Set("constraints.maxDiffEntries", fmt.Sprint(constraintsMaxDiffEntries))
  1471  	return c
  1472  }
  1473  
  1474  // ConstraintsSupportedCompressions sets the optional parameter
  1475  // "constraints.supportedCompressions": The compression types supported by the
  1476  // client.
  1477  //
  1478  // Possible values:
  1479  //
  1480  //	"COMPRESSION_TYPE_UNSPECIFIED" - Unknown.
  1481  //	"RAW" - Raw, uncompressed data.
  1482  //	"RICE" - Rice-Golomb encoded data.
  1483  func (c *ThreatListsComputeDiffCall) ConstraintsSupportedCompressions(constraintsSupportedCompressions ...string) *ThreatListsComputeDiffCall {
  1484  	c.urlParams_.SetMulti("constraints.supportedCompressions", append([]string{}, constraintsSupportedCompressions...))
  1485  	return c
  1486  }
  1487  
  1488  // ThreatType sets the optional parameter "threatType": Required. The threat
  1489  // list to update. Only a single ThreatType should be specified per request. If
  1490  // you want to handle multiple ThreatTypes, you must make one request per
  1491  // ThreatType.
  1492  //
  1493  // Possible values:
  1494  //
  1495  //	"THREAT_TYPE_UNSPECIFIED" - No entries should match this threat type. This
  1496  //
  1497  // threat type is unused.
  1498  //
  1499  //	"MALWARE" - Malware targeting any platform.
  1500  //	"SOCIAL_ENGINEERING" - Social engineering targeting any platform.
  1501  //	"UNWANTED_SOFTWARE" - Unwanted software targeting any platform.
  1502  //	"SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended coverage
  1503  //
  1504  // social engineering URIs targeting any platform.
  1505  func (c *ThreatListsComputeDiffCall) ThreatType(threatType string) *ThreatListsComputeDiffCall {
  1506  	c.urlParams_.Set("threatType", threatType)
  1507  	return c
  1508  }
  1509  
  1510  // VersionToken sets the optional parameter "versionToken": The current version
  1511  // token of the client for the requested list (the client version that was
  1512  // received from the last successful diff). If the client does not have a
  1513  // version token (this is the first time calling ComputeThreatListDiff), this
  1514  // may be left empty and a full database snapshot will be returned.
  1515  func (c *ThreatListsComputeDiffCall) VersionToken(versionToken string) *ThreatListsComputeDiffCall {
  1516  	c.urlParams_.Set("versionToken", versionToken)
  1517  	return c
  1518  }
  1519  
  1520  // Fields allows partial responses to be retrieved. See
  1521  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1522  // details.
  1523  func (c *ThreatListsComputeDiffCall) Fields(s ...googleapi.Field) *ThreatListsComputeDiffCall {
  1524  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1525  	return c
  1526  }
  1527  
  1528  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1529  // object's ETag matches the given value. This is useful for getting updates
  1530  // only after the object has changed since the last request.
  1531  func (c *ThreatListsComputeDiffCall) IfNoneMatch(entityTag string) *ThreatListsComputeDiffCall {
  1532  	c.ifNoneMatch_ = entityTag
  1533  	return c
  1534  }
  1535  
  1536  // Context sets the context to be used in this call's Do method.
  1537  func (c *ThreatListsComputeDiffCall) Context(ctx context.Context) *ThreatListsComputeDiffCall {
  1538  	c.ctx_ = ctx
  1539  	return c
  1540  }
  1541  
  1542  // Header returns a http.Header that can be modified by the caller to add
  1543  // headers to the request.
  1544  func (c *ThreatListsComputeDiffCall) Header() http.Header {
  1545  	if c.header_ == nil {
  1546  		c.header_ = make(http.Header)
  1547  	}
  1548  	return c.header_
  1549  }
  1550  
  1551  func (c *ThreatListsComputeDiffCall) doRequest(alt string) (*http.Response, error) {
  1552  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1553  	if c.ifNoneMatch_ != "" {
  1554  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1555  	}
  1556  	var body io.Reader = nil
  1557  	c.urlParams_.Set("alt", alt)
  1558  	c.urlParams_.Set("prettyPrint", "false")
  1559  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/threatLists:computeDiff")
  1560  	urls += "?" + c.urlParams_.Encode()
  1561  	req, err := http.NewRequest("GET", urls, body)
  1562  	if err != nil {
  1563  		return nil, err
  1564  	}
  1565  	req.Header = reqHeaders
  1566  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1567  }
  1568  
  1569  // Do executes the "webrisk.threatLists.computeDiff" call.
  1570  // Any non-2xx status code is an error. Response headers are in either
  1571  // *GoogleCloudWebriskV1ComputeThreatListDiffResponse.ServerResponse.Header or
  1572  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  1573  // googleapi.IsNotModified to check whether the returned error was because
  1574  // http.StatusNotModified was returned.
  1575  func (c *ThreatListsComputeDiffCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebriskV1ComputeThreatListDiffResponse, error) {
  1576  	gensupport.SetOptions(c.urlParams_, opts...)
  1577  	res, err := c.doRequest("json")
  1578  	if res != nil && res.StatusCode == http.StatusNotModified {
  1579  		if res.Body != nil {
  1580  			res.Body.Close()
  1581  		}
  1582  		return nil, gensupport.WrapError(&googleapi.Error{
  1583  			Code:   res.StatusCode,
  1584  			Header: res.Header,
  1585  		})
  1586  	}
  1587  	if err != nil {
  1588  		return nil, err
  1589  	}
  1590  	defer googleapi.CloseBody(res)
  1591  	if err := googleapi.CheckResponse(res); err != nil {
  1592  		return nil, gensupport.WrapError(err)
  1593  	}
  1594  	ret := &GoogleCloudWebriskV1ComputeThreatListDiffResponse{
  1595  		ServerResponse: googleapi.ServerResponse{
  1596  			Header:         res.Header,
  1597  			HTTPStatusCode: res.StatusCode,
  1598  		},
  1599  	}
  1600  	target := &ret
  1601  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1602  		return nil, err
  1603  	}
  1604  	return ret, nil
  1605  }
  1606  
  1607  type UrisSearchCall struct {
  1608  	s            *Service
  1609  	urlParams_   gensupport.URLParams
  1610  	ifNoneMatch_ string
  1611  	ctx_         context.Context
  1612  	header_      http.Header
  1613  }
  1614  
  1615  // Search: This method is used to check whether a URI is on a given threatList.
  1616  // Multiple threatLists may be searched in a single query. The response will
  1617  // list all requested threatLists the URI was found to match. If the URI is not
  1618  // found on any of the requested ThreatList an empty response will be returned.
  1619  func (r *UrisService) Search() *UrisSearchCall {
  1620  	c := &UrisSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1621  	return c
  1622  }
  1623  
  1624  // ThreatTypes sets the optional parameter "threatTypes": Required. The
  1625  // ThreatLists to search in. Multiple ThreatLists may be specified.
  1626  //
  1627  // Possible values:
  1628  //
  1629  //	"THREAT_TYPE_UNSPECIFIED" - No entries should match this threat type. This
  1630  //
  1631  // threat type is unused.
  1632  //
  1633  //	"MALWARE" - Malware targeting any platform.
  1634  //	"SOCIAL_ENGINEERING" - Social engineering targeting any platform.
  1635  //	"UNWANTED_SOFTWARE" - Unwanted software targeting any platform.
  1636  //	"SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended coverage
  1637  //
  1638  // social engineering URIs targeting any platform.
  1639  func (c *UrisSearchCall) ThreatTypes(threatTypes ...string) *UrisSearchCall {
  1640  	c.urlParams_.SetMulti("threatTypes", append([]string{}, threatTypes...))
  1641  	return c
  1642  }
  1643  
  1644  // Uri sets the optional parameter "uri": Required. The URI to be checked for
  1645  // matches.
  1646  func (c *UrisSearchCall) Uri(uri string) *UrisSearchCall {
  1647  	c.urlParams_.Set("uri", uri)
  1648  	return c
  1649  }
  1650  
  1651  // Fields allows partial responses to be retrieved. See
  1652  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1653  // details.
  1654  func (c *UrisSearchCall) Fields(s ...googleapi.Field) *UrisSearchCall {
  1655  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1656  	return c
  1657  }
  1658  
  1659  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1660  // object's ETag matches the given value. This is useful for getting updates
  1661  // only after the object has changed since the last request.
  1662  func (c *UrisSearchCall) IfNoneMatch(entityTag string) *UrisSearchCall {
  1663  	c.ifNoneMatch_ = entityTag
  1664  	return c
  1665  }
  1666  
  1667  // Context sets the context to be used in this call's Do method.
  1668  func (c *UrisSearchCall) Context(ctx context.Context) *UrisSearchCall {
  1669  	c.ctx_ = ctx
  1670  	return c
  1671  }
  1672  
  1673  // Header returns a http.Header that can be modified by the caller to add
  1674  // headers to the request.
  1675  func (c *UrisSearchCall) Header() http.Header {
  1676  	if c.header_ == nil {
  1677  		c.header_ = make(http.Header)
  1678  	}
  1679  	return c.header_
  1680  }
  1681  
  1682  func (c *UrisSearchCall) doRequest(alt string) (*http.Response, error) {
  1683  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1684  	if c.ifNoneMatch_ != "" {
  1685  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1686  	}
  1687  	var body io.Reader = nil
  1688  	c.urlParams_.Set("alt", alt)
  1689  	c.urlParams_.Set("prettyPrint", "false")
  1690  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/uris:search")
  1691  	urls += "?" + c.urlParams_.Encode()
  1692  	req, err := http.NewRequest("GET", urls, body)
  1693  	if err != nil {
  1694  		return nil, err
  1695  	}
  1696  	req.Header = reqHeaders
  1697  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1698  }
  1699  
  1700  // Do executes the "webrisk.uris.search" call.
  1701  // Any non-2xx status code is an error. Response headers are in either
  1702  // *GoogleCloudWebriskV1SearchUrisResponse.ServerResponse.Header or (if a
  1703  // response was returned at all) in error.(*googleapi.Error).Header. Use
  1704  // googleapi.IsNotModified to check whether the returned error was because
  1705  // http.StatusNotModified was returned.
  1706  func (c *UrisSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebriskV1SearchUrisResponse, error) {
  1707  	gensupport.SetOptions(c.urlParams_, opts...)
  1708  	res, err := c.doRequest("json")
  1709  	if res != nil && res.StatusCode == http.StatusNotModified {
  1710  		if res.Body != nil {
  1711  			res.Body.Close()
  1712  		}
  1713  		return nil, gensupport.WrapError(&googleapi.Error{
  1714  			Code:   res.StatusCode,
  1715  			Header: res.Header,
  1716  		})
  1717  	}
  1718  	if err != nil {
  1719  		return nil, err
  1720  	}
  1721  	defer googleapi.CloseBody(res)
  1722  	if err := googleapi.CheckResponse(res); err != nil {
  1723  		return nil, gensupport.WrapError(err)
  1724  	}
  1725  	ret := &GoogleCloudWebriskV1SearchUrisResponse{
  1726  		ServerResponse: googleapi.ServerResponse{
  1727  			Header:         res.Header,
  1728  			HTTPStatusCode: res.StatusCode,
  1729  		},
  1730  	}
  1731  	target := &ret
  1732  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1733  		return nil, err
  1734  	}
  1735  	return ret, nil
  1736  }
  1737  

View as plain text