...

Source file src/google.golang.org/api/safebrowsing/v4/safebrowsing-gen.go

Documentation: google.golang.org/api/safebrowsing/v4

     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 safebrowsing provides access to the Safe Browsing API.
     8  //
     9  // For product documentation, see: https://developers.google.com/safe-browsing/
    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/safebrowsing/v4"
    27  //	...
    28  //	ctx := context.Background()
    29  //	safebrowsingService, err := safebrowsing.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  //	safebrowsingService, err := safebrowsing.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  //	safebrowsingService, err := safebrowsing.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package safebrowsing // import "google.golang.org/api/safebrowsing/v4"
    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 = "safebrowsing:v4"
    90  const apiName = "safebrowsing"
    91  const apiVersion = "v4"
    92  const basePath = "https://safebrowsing.googleapis.com/"
    93  const basePathTemplate = "https://safebrowsing.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://safebrowsing.mtls.googleapis.com/"
    95  
    96  // NewService creates a new Service.
    97  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    98  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    99  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   100  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   101  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   102  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	s, err := New(client)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	if endpoint != "" {
   111  		s.BasePath = endpoint
   112  	}
   113  	return s, nil
   114  }
   115  
   116  // New creates a new Service. It uses the provided http.Client for requests.
   117  //
   118  // Deprecated: please use NewService instead.
   119  // To provide a custom HTTP client, use option.WithHTTPClient.
   120  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   121  func New(client *http.Client) (*Service, error) {
   122  	if client == nil {
   123  		return nil, errors.New("client is nil")
   124  	}
   125  	s := &Service{client: client, BasePath: basePath}
   126  	s.EncodedFullHashes = NewEncodedFullHashesService(s)
   127  	s.EncodedUpdates = NewEncodedUpdatesService(s)
   128  	s.FullHashes = NewFullHashesService(s)
   129  	s.ThreatHits = NewThreatHitsService(s)
   130  	s.ThreatListUpdates = NewThreatListUpdatesService(s)
   131  	s.ThreatLists = NewThreatListsService(s)
   132  	s.ThreatMatches = NewThreatMatchesService(s)
   133  	return s, nil
   134  }
   135  
   136  type Service struct {
   137  	client    *http.Client
   138  	BasePath  string // API endpoint base URL
   139  	UserAgent string // optional additional User-Agent fragment
   140  
   141  	EncodedFullHashes *EncodedFullHashesService
   142  
   143  	EncodedUpdates *EncodedUpdatesService
   144  
   145  	FullHashes *FullHashesService
   146  
   147  	ThreatHits *ThreatHitsService
   148  
   149  	ThreatListUpdates *ThreatListUpdatesService
   150  
   151  	ThreatLists *ThreatListsService
   152  
   153  	ThreatMatches *ThreatMatchesService
   154  }
   155  
   156  func (s *Service) userAgent() string {
   157  	if s.UserAgent == "" {
   158  		return googleapi.UserAgent
   159  	}
   160  	return googleapi.UserAgent + " " + s.UserAgent
   161  }
   162  
   163  func NewEncodedFullHashesService(s *Service) *EncodedFullHashesService {
   164  	rs := &EncodedFullHashesService{s: s}
   165  	return rs
   166  }
   167  
   168  type EncodedFullHashesService struct {
   169  	s *Service
   170  }
   171  
   172  func NewEncodedUpdatesService(s *Service) *EncodedUpdatesService {
   173  	rs := &EncodedUpdatesService{s: s}
   174  	return rs
   175  }
   176  
   177  type EncodedUpdatesService struct {
   178  	s *Service
   179  }
   180  
   181  func NewFullHashesService(s *Service) *FullHashesService {
   182  	rs := &FullHashesService{s: s}
   183  	return rs
   184  }
   185  
   186  type FullHashesService struct {
   187  	s *Service
   188  }
   189  
   190  func NewThreatHitsService(s *Service) *ThreatHitsService {
   191  	rs := &ThreatHitsService{s: s}
   192  	return rs
   193  }
   194  
   195  type ThreatHitsService struct {
   196  	s *Service
   197  }
   198  
   199  func NewThreatListUpdatesService(s *Service) *ThreatListUpdatesService {
   200  	rs := &ThreatListUpdatesService{s: s}
   201  	return rs
   202  }
   203  
   204  type ThreatListUpdatesService 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 NewThreatMatchesService(s *Service) *ThreatMatchesService {
   218  	rs := &ThreatMatchesService{s: s}
   219  	return rs
   220  }
   221  
   222  type ThreatMatchesService struct {
   223  	s *Service
   224  }
   225  
   226  // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid
   227  // defining duplicated empty messages in your APIs. A typical example is to use
   228  // it as the request or the response type of an API method. For instance:
   229  // service Foo { rpc Bar(google.protobuf.Empty) returns
   230  // (google.protobuf.Empty); }
   231  type GoogleProtobufEmpty struct {
   232  	// ServerResponse contains the HTTP response code and headers from the server.
   233  	googleapi.ServerResponse `json:"-"`
   234  }
   235  
   236  // GoogleSecuritySafebrowsingV4Checksum: The expected state of a client's local
   237  // database.
   238  type GoogleSecuritySafebrowsingV4Checksum struct {
   239  	// Sha256: The SHA256 hash of the client state; that is, of the sorted list of
   240  	// all hashes present in the database.
   241  	Sha256 string `json:"sha256,omitempty"`
   242  	// ForceSendFields is a list of field names (e.g. "Sha256") to unconditionally
   243  	// include in API requests. By default, fields with empty or default values are
   244  	// omitted from API requests. See
   245  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   246  	// details.
   247  	ForceSendFields []string `json:"-"`
   248  	// NullFields is a list of field names (e.g. "Sha256") to include in API
   249  	// requests with the JSON null value. By default, fields with empty values are
   250  	// omitted from API requests. See
   251  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   252  	NullFields []string `json:"-"`
   253  }
   254  
   255  func (s *GoogleSecuritySafebrowsingV4Checksum) MarshalJSON() ([]byte, error) {
   256  	type NoMethod GoogleSecuritySafebrowsingV4Checksum
   257  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   258  }
   259  
   260  // GoogleSecuritySafebrowsingV4ClientInfo: The client metadata associated with
   261  // Safe Browsing API requests.
   262  type GoogleSecuritySafebrowsingV4ClientInfo struct {
   263  	// ClientId: A client ID that (hopefully) uniquely identifies the client
   264  	// implementation of the Safe Browsing API.
   265  	ClientId string `json:"clientId,omitempty"`
   266  	// ClientVersion: The version of the client implementation.
   267  	ClientVersion string `json:"clientVersion,omitempty"`
   268  	// ForceSendFields is a list of field names (e.g. "ClientId") to
   269  	// unconditionally include in API requests. By default, fields with empty or
   270  	// default values are omitted from API requests. See
   271  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   272  	// details.
   273  	ForceSendFields []string `json:"-"`
   274  	// NullFields is a list of field names (e.g. "ClientId") to include in API
   275  	// requests with the JSON null value. By default, fields with empty values are
   276  	// omitted from API requests. See
   277  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   278  	NullFields []string `json:"-"`
   279  }
   280  
   281  func (s *GoogleSecuritySafebrowsingV4ClientInfo) MarshalJSON() ([]byte, error) {
   282  	type NoMethod GoogleSecuritySafebrowsingV4ClientInfo
   283  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   284  }
   285  
   286  // GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest: Describes a Safe
   287  // Browsing API update request. Clients can request updates for multiple lists
   288  // in a single request. The server may not respond to all requests, if the
   289  // server has no updates for that list. NOTE: Field index 2 is unused. NEXT: 5
   290  type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest struct {
   291  	// Client: The client metadata.
   292  	Client *GoogleSecuritySafebrowsingV4ClientInfo `json:"client,omitempty"`
   293  	// ListUpdateRequests: The requested threat list updates.
   294  	ListUpdateRequests []*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest `json:"listUpdateRequests,omitempty"`
   295  	// ForceSendFields is a list of field names (e.g. "Client") to unconditionally
   296  	// include in API requests. By default, fields with empty or default values are
   297  	// omitted from API requests. See
   298  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   299  	// details.
   300  	ForceSendFields []string `json:"-"`
   301  	// NullFields is a list of field names (e.g. "Client") to include in API
   302  	// requests with the JSON null value. By default, fields with empty values are
   303  	// omitted from API requests. See
   304  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   305  	NullFields []string `json:"-"`
   306  }
   307  
   308  func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest) MarshalJSON() ([]byte, error) {
   309  	type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest
   310  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   311  }
   312  
   313  // GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest:
   314  // A single list update request.
   315  type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest struct {
   316  	// Constraints: The constraints associated with this request.
   317  	Constraints *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints `json:"constraints,omitempty"`
   318  	// PlatformType: The type of platform at risk by entries present in the list.
   319  	//
   320  	// Possible values:
   321  	//   "PLATFORM_TYPE_UNSPECIFIED" - Unknown platform.
   322  	//   "WINDOWS" - Threat posed to Windows.
   323  	//   "LINUX" - Threat posed to Linux.
   324  	//   "ANDROID" - Threat posed to Android.
   325  	//   "OSX" - Threat posed to OS X.
   326  	//   "IOS" - Threat posed to iOS.
   327  	//   "ANY_PLATFORM" - Threat posed to at least one of the defined platforms.
   328  	//   "ALL_PLATFORMS" - Threat posed to all defined platforms.
   329  	//   "CHROME" - Threat posed to Chrome.
   330  	PlatformType string `json:"platformType,omitempty"`
   331  	// State: The current state of the client for the requested list (the encrypted
   332  	// client state that was received from the last successful list update).
   333  	State string `json:"state,omitempty"`
   334  	// ThreatEntryType: The types of entries present in the list.
   335  	//
   336  	// Possible values:
   337  	//   "THREAT_ENTRY_TYPE_UNSPECIFIED" - Unspecified.
   338  	//   "URL" - A URL.
   339  	//   "EXECUTABLE" - An executable program.
   340  	//   "IP_RANGE" - An IP range.
   341  	//   "CHROME_EXTENSION" - Chrome extension.
   342  	//   "FILENAME" - Filename.
   343  	//   "CERT" - CERT
   344  	ThreatEntryType string `json:"threatEntryType,omitempty"`
   345  	// ThreatType: The type of threat posed by entries present in the list.
   346  	//
   347  	// Possible values:
   348  	//   "THREAT_TYPE_UNSPECIFIED" - Unknown.
   349  	//   "MALWARE" - Malware threat type.
   350  	//   "SOCIAL_ENGINEERING" - Social engineering threat type.
   351  	//   "UNWANTED_SOFTWARE" - Unwanted software threat type.
   352  	//   "POTENTIALLY_HARMFUL_APPLICATION" - Potentially harmful application threat
   353  	// type.
   354  	//   "SOCIAL_ENGINEERING_INTERNAL" - Social engineering threat type for
   355  	// internal use.
   356  	//   "API_ABUSE" - API abuse threat type.
   357  	//   "MALICIOUS_BINARY" - Malicious binary threat type.
   358  	//   "CSD_WHITELIST" - Client side detection whitelist threat type.
   359  	//   "CSD_DOWNLOAD_WHITELIST" - Client side download detection whitelist threat
   360  	// type.
   361  	//   "CLIENT_INCIDENT" - Client incident threat type.
   362  	//   "CLIENT_INCIDENT_WHITELIST" - Whitelist used when detecting client
   363  	// incident threats.
   364  	//   "APK_MALWARE_OFFLINE" - List used for offline APK checks in PAM.
   365  	//   "SUBRESOURCE_FILTER" - Patterns to be used for activating the subresource
   366  	// filter.
   367  	//   "SUSPICIOUS" - Entities that are suspected to present a threat.
   368  	//   "TRICK_TO_BILL" - Trick-to-bill threat type.
   369  	//   "HIGH_CONFIDENCE_ALLOWLIST" - URL expressions that are very likely to be
   370  	// safe.
   371  	//   "ACCURACY_TIPS" - An experimental threat type related to Jigsaw. See
   372  	// https://jigsaw.google.com/.
   373  	ThreatType string `json:"threatType,omitempty"`
   374  	// ForceSendFields is a list of field names (e.g. "Constraints") to
   375  	// unconditionally include in API requests. By default, fields with empty or
   376  	// default values are omitted from API requests. See
   377  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   378  	// details.
   379  	ForceSendFields []string `json:"-"`
   380  	// NullFields is a list of field names (e.g. "Constraints") to include in API
   381  	// requests with the JSON null value. By default, fields with empty values are
   382  	// omitted from API requests. See
   383  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   384  	NullFields []string `json:"-"`
   385  }
   386  
   387  func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest) MarshalJSON() ([]byte, error) {
   388  	type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest
   389  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   390  }
   391  
   392  // GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestCon
   393  // straints: The constraints for this update.
   394  type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints struct {
   395  	// DeviceLocation: A client's physical location, expressed as a ISO 31166-1
   396  	// alpha-2 region code.
   397  	DeviceLocation string `json:"deviceLocation,omitempty"`
   398  	// Language: Requests the lists for a specific language. Expects ISO 639
   399  	// alpha-2 format.
   400  	Language string `json:"language,omitempty"`
   401  	// MaxDatabaseEntries: Sets the maximum number of entries that the client is
   402  	// willing to have in the local database for the specified list. This should be
   403  	// a power of 2 between 2**10 and 2**20. If zero, no database size limit is
   404  	// set.
   405  	MaxDatabaseEntries int64 `json:"maxDatabaseEntries,omitempty"`
   406  	// MaxUpdateEntries: The maximum size in number of entries. The update will not
   407  	// contain more entries than this value. This should be a power of 2 between
   408  	// 2**10 and 2**20. If zero, no update size limit is set.
   409  	MaxUpdateEntries int64 `json:"maxUpdateEntries,omitempty"`
   410  	// Region: Requests the list for a specific geographic location. If not set the
   411  	// server may pick that value based on the user's IP address. Expects ISO
   412  	// 3166-1 alpha-2 format.
   413  	Region string `json:"region,omitempty"`
   414  	// SupportedCompressions: The compression types supported by the client.
   415  	//
   416  	// Possible values:
   417  	//   "COMPRESSION_TYPE_UNSPECIFIED" - Unknown.
   418  	//   "RAW" - Raw, uncompressed data.
   419  	//   "RICE" - Rice-Golomb encoded data.
   420  	SupportedCompressions []string `json:"supportedCompressions,omitempty"`
   421  	// ForceSendFields is a list of field names (e.g. "DeviceLocation") to
   422  	// unconditionally include in API requests. By default, fields with empty or
   423  	// default values are omitted from API requests. See
   424  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   425  	// details.
   426  	ForceSendFields []string `json:"-"`
   427  	// NullFields is a list of field names (e.g. "DeviceLocation") to include in
   428  	// API requests with the JSON null value. By default, fields with empty values
   429  	// are omitted from API requests. See
   430  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   431  	NullFields []string `json:"-"`
   432  }
   433  
   434  func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints) MarshalJSON() ([]byte, error) {
   435  	type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints
   436  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   437  }
   438  
   439  type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse struct {
   440  	// ListUpdateResponses: The list updates requested by the clients. The number
   441  	// of responses here may be less than the number of requests sent by clients.
   442  	// This is the case, for example, if the server has no updates for a particular
   443  	// list.
   444  	ListUpdateResponses []*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse `json:"listUpdateResponses,omitempty"`
   445  	// MinimumWaitDuration: The minimum duration the client must wait before
   446  	// issuing any update request. If this field is not set clients may update as
   447  	// soon as they want.
   448  	MinimumWaitDuration string `json:"minimumWaitDuration,omitempty"`
   449  
   450  	// ServerResponse contains the HTTP response code and headers from the server.
   451  	googleapi.ServerResponse `json:"-"`
   452  	// ForceSendFields is a list of field names (e.g. "ListUpdateResponses") to
   453  	// unconditionally include in API requests. By default, fields with empty or
   454  	// default values are omitted from API requests. See
   455  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   456  	// details.
   457  	ForceSendFields []string `json:"-"`
   458  	// NullFields is a list of field names (e.g. "ListUpdateResponses") to include
   459  	// in API requests with the JSON null value. By default, fields with empty
   460  	// values are omitted from API requests. See
   461  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   462  	NullFields []string `json:"-"`
   463  }
   464  
   465  func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse) MarshalJSON() ([]byte, error) {
   466  	type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse
   467  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   468  }
   469  
   470  // GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse:
   471  //
   472  //	An update to an individual list.
   473  type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse struct {
   474  	// Additions: A set of entries to add to a local threat type's list. Repeated
   475  	// to allow for a combination of compressed and raw data to be sent in a single
   476  	// response.
   477  	Additions []*GoogleSecuritySafebrowsingV4ThreatEntrySet `json:"additions,omitempty"`
   478  	// Checksum: The expected SHA256 hash of the client state; that is, of the
   479  	// sorted list of all hashes present in the database after applying the
   480  	// provided update. If the client state doesn't match the expected state, the
   481  	// client must disregard this update and retry later.
   482  	Checksum *GoogleSecuritySafebrowsingV4Checksum `json:"checksum,omitempty"`
   483  	// NewClientState: The new client state, in encrypted format. Opaque to
   484  	// clients.
   485  	NewClientState string `json:"newClientState,omitempty"`
   486  	// PlatformType: The platform type for which data is returned.
   487  	//
   488  	// Possible values:
   489  	//   "PLATFORM_TYPE_UNSPECIFIED" - Unknown platform.
   490  	//   "WINDOWS" - Threat posed to Windows.
   491  	//   "LINUX" - Threat posed to Linux.
   492  	//   "ANDROID" - Threat posed to Android.
   493  	//   "OSX" - Threat posed to OS X.
   494  	//   "IOS" - Threat posed to iOS.
   495  	//   "ANY_PLATFORM" - Threat posed to at least one of the defined platforms.
   496  	//   "ALL_PLATFORMS" - Threat posed to all defined platforms.
   497  	//   "CHROME" - Threat posed to Chrome.
   498  	PlatformType string `json:"platformType,omitempty"`
   499  	// Removals: A set of entries to remove from a local threat type's list. In
   500  	// practice, this field is empty or contains exactly one ThreatEntrySet.
   501  	Removals []*GoogleSecuritySafebrowsingV4ThreatEntrySet `json:"removals,omitempty"`
   502  	// ResponseType: The type of response. This may indicate that an action is
   503  	// required by the client when the response is received.
   504  	//
   505  	// Possible values:
   506  	//   "RESPONSE_TYPE_UNSPECIFIED" - Unknown.
   507  	//   "PARTIAL_UPDATE" - Partial updates are applied to the client's existing
   508  	// local database.
   509  	//   "FULL_UPDATE" - Full updates replace the client's entire local database.
   510  	// This means that either the client was seriously out-of-date or the client is
   511  	// believed to be corrupt.
   512  	ResponseType string `json:"responseType,omitempty"`
   513  	// ThreatEntryType: The format of the threats.
   514  	//
   515  	// Possible values:
   516  	//   "THREAT_ENTRY_TYPE_UNSPECIFIED" - Unspecified.
   517  	//   "URL" - A URL.
   518  	//   "EXECUTABLE" - An executable program.
   519  	//   "IP_RANGE" - An IP range.
   520  	//   "CHROME_EXTENSION" - Chrome extension.
   521  	//   "FILENAME" - Filename.
   522  	//   "CERT" - CERT
   523  	ThreatEntryType string `json:"threatEntryType,omitempty"`
   524  	// ThreatType: The threat type for which data is returned.
   525  	//
   526  	// Possible values:
   527  	//   "THREAT_TYPE_UNSPECIFIED" - Unknown.
   528  	//   "MALWARE" - Malware threat type.
   529  	//   "SOCIAL_ENGINEERING" - Social engineering threat type.
   530  	//   "UNWANTED_SOFTWARE" - Unwanted software threat type.
   531  	//   "POTENTIALLY_HARMFUL_APPLICATION" - Potentially harmful application threat
   532  	// type.
   533  	//   "SOCIAL_ENGINEERING_INTERNAL" - Social engineering threat type for
   534  	// internal use.
   535  	//   "API_ABUSE" - API abuse threat type.
   536  	//   "MALICIOUS_BINARY" - Malicious binary threat type.
   537  	//   "CSD_WHITELIST" - Client side detection whitelist threat type.
   538  	//   "CSD_DOWNLOAD_WHITELIST" - Client side download detection whitelist threat
   539  	// type.
   540  	//   "CLIENT_INCIDENT" - Client incident threat type.
   541  	//   "CLIENT_INCIDENT_WHITELIST" - Whitelist used when detecting client
   542  	// incident threats.
   543  	//   "APK_MALWARE_OFFLINE" - List used for offline APK checks in PAM.
   544  	//   "SUBRESOURCE_FILTER" - Patterns to be used for activating the subresource
   545  	// filter.
   546  	//   "SUSPICIOUS" - Entities that are suspected to present a threat.
   547  	//   "TRICK_TO_BILL" - Trick-to-bill threat type.
   548  	//   "HIGH_CONFIDENCE_ALLOWLIST" - URL expressions that are very likely to be
   549  	// safe.
   550  	//   "ACCURACY_TIPS" - An experimental threat type related to Jigsaw. See
   551  	// https://jigsaw.google.com/.
   552  	ThreatType string `json:"threatType,omitempty"`
   553  	// ForceSendFields is a list of field names (e.g. "Additions") to
   554  	// unconditionally include in API requests. By default, fields with empty or
   555  	// default values are omitted from API requests. See
   556  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   557  	// details.
   558  	ForceSendFields []string `json:"-"`
   559  	// NullFields is a list of field names (e.g. "Additions") to include in API
   560  	// requests with the JSON null value. By default, fields with empty values are
   561  	// omitted from API requests. See
   562  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   563  	NullFields []string `json:"-"`
   564  }
   565  
   566  func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse) MarshalJSON() ([]byte, error) {
   567  	type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse
   568  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   569  }
   570  
   571  // GoogleSecuritySafebrowsingV4FindFullHashesRequest: Request to return full
   572  // hashes matched by the provided hash prefixes.
   573  type GoogleSecuritySafebrowsingV4FindFullHashesRequest struct {
   574  	// ApiClient: Client metadata associated with callers of higher-level APIs
   575  	// built on top of the client's implementation.
   576  	ApiClient *GoogleSecuritySafebrowsingV4ClientInfo `json:"apiClient,omitempty"`
   577  	// Client: The client metadata.
   578  	Client *GoogleSecuritySafebrowsingV4ClientInfo `json:"client,omitempty"`
   579  	// ClientStates: The current client states for each of the client's local
   580  	// threat lists.
   581  	ClientStates []string `json:"clientStates,omitempty"`
   582  	// ThreatInfo: The lists and hashes to be checked.
   583  	ThreatInfo *GoogleSecuritySafebrowsingV4ThreatInfo `json:"threatInfo,omitempty"`
   584  	// ForceSendFields is a list of field names (e.g. "ApiClient") to
   585  	// unconditionally include in API requests. By default, fields with empty or
   586  	// default values are omitted from API requests. See
   587  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   588  	// details.
   589  	ForceSendFields []string `json:"-"`
   590  	// NullFields is a list of field names (e.g. "ApiClient") to include in API
   591  	// requests with the JSON null value. By default, fields with empty values are
   592  	// omitted from API requests. See
   593  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   594  	NullFields []string `json:"-"`
   595  }
   596  
   597  func (s *GoogleSecuritySafebrowsingV4FindFullHashesRequest) MarshalJSON() ([]byte, error) {
   598  	type NoMethod GoogleSecuritySafebrowsingV4FindFullHashesRequest
   599  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   600  }
   601  
   602  type GoogleSecuritySafebrowsingV4FindFullHashesResponse struct {
   603  	// Matches: The full hashes that matched the requested prefixes.
   604  	Matches []*GoogleSecuritySafebrowsingV4ThreatMatch `json:"matches,omitempty"`
   605  	// MinimumWaitDuration: The minimum duration the client must wait before
   606  	// issuing any find hashes request. If this field is not set, clients can issue
   607  	// a request as soon as they want.
   608  	MinimumWaitDuration string `json:"minimumWaitDuration,omitempty"`
   609  	// NegativeCacheDuration: For requested entities that did not match the threat
   610  	// list, how long to cache the response.
   611  	NegativeCacheDuration string `json:"negativeCacheDuration,omitempty"`
   612  
   613  	// ServerResponse contains the HTTP response code and headers from the server.
   614  	googleapi.ServerResponse `json:"-"`
   615  	// ForceSendFields is a list of field names (e.g. "Matches") to unconditionally
   616  	// include in API requests. By default, fields with empty or default values are
   617  	// omitted from API requests. See
   618  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   619  	// details.
   620  	ForceSendFields []string `json:"-"`
   621  	// NullFields is a list of field names (e.g. "Matches") to include in API
   622  	// requests with the JSON null value. By default, fields with empty values are
   623  	// omitted from API requests. See
   624  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   625  	NullFields []string `json:"-"`
   626  }
   627  
   628  func (s *GoogleSecuritySafebrowsingV4FindFullHashesResponse) MarshalJSON() ([]byte, error) {
   629  	type NoMethod GoogleSecuritySafebrowsingV4FindFullHashesResponse
   630  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   631  }
   632  
   633  // GoogleSecuritySafebrowsingV4FindThreatMatchesRequest: Request to check
   634  // entries against lists.
   635  type GoogleSecuritySafebrowsingV4FindThreatMatchesRequest struct {
   636  	// Client: The client metadata.
   637  	Client *GoogleSecuritySafebrowsingV4ClientInfo `json:"client,omitempty"`
   638  	// ThreatInfo: The lists and entries to be checked for matches.
   639  	ThreatInfo *GoogleSecuritySafebrowsingV4ThreatInfo `json:"threatInfo,omitempty"`
   640  	// ForceSendFields is a list of field names (e.g. "Client") to unconditionally
   641  	// include in API requests. By default, fields with empty or default values are
   642  	// omitted from API requests. See
   643  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   644  	// details.
   645  	ForceSendFields []string `json:"-"`
   646  	// NullFields is a list of field names (e.g. "Client") to include in API
   647  	// requests with the JSON null value. By default, fields with empty values are
   648  	// omitted from API requests. See
   649  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   650  	NullFields []string `json:"-"`
   651  }
   652  
   653  func (s *GoogleSecuritySafebrowsingV4FindThreatMatchesRequest) MarshalJSON() ([]byte, error) {
   654  	type NoMethod GoogleSecuritySafebrowsingV4FindThreatMatchesRequest
   655  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   656  }
   657  
   658  type GoogleSecuritySafebrowsingV4FindThreatMatchesResponse struct {
   659  	// Matches: The threat list matches.
   660  	Matches []*GoogleSecuritySafebrowsingV4ThreatMatch `json:"matches,omitempty"`
   661  
   662  	// ServerResponse contains the HTTP response code and headers from the server.
   663  	googleapi.ServerResponse `json:"-"`
   664  	// ForceSendFields is a list of field names (e.g. "Matches") to unconditionally
   665  	// include in API requests. By default, fields with empty or default values are
   666  	// omitted from API requests. See
   667  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   668  	// details.
   669  	ForceSendFields []string `json:"-"`
   670  	// NullFields is a list of field names (e.g. "Matches") to include in API
   671  	// requests with the JSON null value. By default, fields with empty values are
   672  	// omitted from API requests. See
   673  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   674  	NullFields []string `json:"-"`
   675  }
   676  
   677  func (s *GoogleSecuritySafebrowsingV4FindThreatMatchesResponse) MarshalJSON() ([]byte, error) {
   678  	type NoMethod GoogleSecuritySafebrowsingV4FindThreatMatchesResponse
   679  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   680  }
   681  
   682  type GoogleSecuritySafebrowsingV4ListThreatListsResponse struct {
   683  	// ThreatLists: The lists available for download by the client.
   684  	ThreatLists []*GoogleSecuritySafebrowsingV4ThreatListDescriptor `json:"threatLists,omitempty"`
   685  
   686  	// ServerResponse contains the HTTP response code and headers from the server.
   687  	googleapi.ServerResponse `json:"-"`
   688  	// ForceSendFields is a list of field names (e.g. "ThreatLists") to
   689  	// unconditionally include in API requests. By default, fields with empty or
   690  	// default values are omitted from API requests. See
   691  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   692  	// details.
   693  	ForceSendFields []string `json:"-"`
   694  	// NullFields is a list of field names (e.g. "ThreatLists") to include in API
   695  	// requests with the JSON null value. By default, fields with empty values are
   696  	// omitted from API requests. See
   697  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   698  	NullFields []string `json:"-"`
   699  }
   700  
   701  func (s *GoogleSecuritySafebrowsingV4ListThreatListsResponse) MarshalJSON() ([]byte, error) {
   702  	type NoMethod GoogleSecuritySafebrowsingV4ListThreatListsResponse
   703  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   704  }
   705  
   706  // GoogleSecuritySafebrowsingV4RawHashes: The uncompressed threat entries in
   707  // hash format of a particular prefix length. Hashes can be anywhere from 4 to
   708  // 32 bytes in size. A large majority are 4 bytes, but some hashes are
   709  // lengthened if they collide with the hash of a popular URL. Used for sending
   710  // ThreatEntrySet to clients that do not support compression, or when sending
   711  // non-4-byte hashes to clients that do support compression.
   712  type GoogleSecuritySafebrowsingV4RawHashes struct {
   713  	// PrefixSize: The number of bytes for each prefix encoded below. This field
   714  	// can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
   715  	PrefixSize int64 `json:"prefixSize,omitempty"`
   716  	// RawHashes: The hashes, in binary format, concatenated into one long string.
   717  	// Hashes are sorted in lexicographic order. For JSON API users, hashes are
   718  	// base64-encoded.
   719  	RawHashes string `json:"rawHashes,omitempty"`
   720  	// ForceSendFields is a list of field names (e.g. "PrefixSize") to
   721  	// unconditionally include in API requests. By default, fields with empty or
   722  	// default values are omitted from API requests. See
   723  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   724  	// details.
   725  	ForceSendFields []string `json:"-"`
   726  	// NullFields is a list of field names (e.g. "PrefixSize") to include in API
   727  	// requests with the JSON null value. By default, fields with empty values are
   728  	// omitted from API requests. See
   729  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   730  	NullFields []string `json:"-"`
   731  }
   732  
   733  func (s *GoogleSecuritySafebrowsingV4RawHashes) MarshalJSON() ([]byte, error) {
   734  	type NoMethod GoogleSecuritySafebrowsingV4RawHashes
   735  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   736  }
   737  
   738  // GoogleSecuritySafebrowsingV4RawIndices: A set of raw indices to remove from
   739  // a local list.
   740  type GoogleSecuritySafebrowsingV4RawIndices struct {
   741  	// Indices: The indices to remove from a lexicographically-sorted local list.
   742  	Indices []int64 `json:"indices,omitempty"`
   743  	// ForceSendFields is a list of field names (e.g. "Indices") to unconditionally
   744  	// include in API requests. By default, fields with empty or default values are
   745  	// omitted from API requests. See
   746  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   747  	// details.
   748  	ForceSendFields []string `json:"-"`
   749  	// NullFields is a list of field names (e.g. "Indices") to include in API
   750  	// requests with the JSON null value. By default, fields with empty values are
   751  	// omitted from API requests. See
   752  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   753  	NullFields []string `json:"-"`
   754  }
   755  
   756  func (s *GoogleSecuritySafebrowsingV4RawIndices) MarshalJSON() ([]byte, error) {
   757  	type NoMethod GoogleSecuritySafebrowsingV4RawIndices
   758  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   759  }
   760  
   761  // GoogleSecuritySafebrowsingV4RiceDeltaEncoding: The Rice-Golomb encoded data.
   762  // Used for sending compressed 4-byte hashes or compressed removal indices.
   763  type GoogleSecuritySafebrowsingV4RiceDeltaEncoding struct {
   764  	// EncodedData: The encoded deltas that are encoded using the Golomb-Rice
   765  	// coder.
   766  	EncodedData string `json:"encodedData,omitempty"`
   767  	// FirstValue: The offset of the first entry in the encoded data, or, if only a
   768  	// single integer was encoded, that single integer's value. If the field is
   769  	// empty or missing, assume zero.
   770  	FirstValue int64 `json:"firstValue,omitempty,string"`
   771  	// NumEntries: The number of entries that are delta encoded in the encoded
   772  	// data. If only a single integer was encoded, this will be zero and the single
   773  	// value will be stored in `first_value`.
   774  	NumEntries int64 `json:"numEntries,omitempty"`
   775  	// RiceParameter: The Golomb-Rice parameter, which is a number between 2 and
   776  	// 28. This field is missing (that is, zero) if `num_entries` is zero.
   777  	RiceParameter int64 `json:"riceParameter,omitempty"`
   778  	// ForceSendFields is a list of field names (e.g. "EncodedData") to
   779  	// unconditionally include in API requests. By default, fields with empty or
   780  	// default values are omitted from API requests. See
   781  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   782  	// details.
   783  	ForceSendFields []string `json:"-"`
   784  	// NullFields is a list of field names (e.g. "EncodedData") to include in API
   785  	// requests with the JSON null value. By default, fields with empty values are
   786  	// omitted from API requests. See
   787  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   788  	NullFields []string `json:"-"`
   789  }
   790  
   791  func (s *GoogleSecuritySafebrowsingV4RiceDeltaEncoding) MarshalJSON() ([]byte, error) {
   792  	type NoMethod GoogleSecuritySafebrowsingV4RiceDeltaEncoding
   793  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   794  }
   795  
   796  // GoogleSecuritySafebrowsingV4ThreatEntry: An individual threat; for example,
   797  // a malicious URL or its hash representation. Only one of these fields should
   798  // be set.
   799  type GoogleSecuritySafebrowsingV4ThreatEntry struct {
   800  	// Digest: The digest of an executable in SHA256 format. The API supports both
   801  	// binary and hex digests. For JSON requests, digests are base64-encoded.
   802  	Digest string `json:"digest,omitempty"`
   803  	// Hash: A hash prefix, consisting of the most significant 4-32 bytes of a
   804  	// SHA256 hash. This field is in binary format. For JSON requests, hashes are
   805  	// base64-encoded.
   806  	Hash string `json:"hash,omitempty"`
   807  	// Url: A URL.
   808  	Url string `json:"url,omitempty"`
   809  	// ForceSendFields is a list of field names (e.g. "Digest") to unconditionally
   810  	// include in API requests. By default, fields with empty or default values are
   811  	// omitted from API requests. See
   812  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   813  	// details.
   814  	ForceSendFields []string `json:"-"`
   815  	// NullFields is a list of field names (e.g. "Digest") to include in API
   816  	// requests with the JSON null value. By default, fields with empty values are
   817  	// omitted from API requests. See
   818  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   819  	NullFields []string `json:"-"`
   820  }
   821  
   822  func (s *GoogleSecuritySafebrowsingV4ThreatEntry) MarshalJSON() ([]byte, error) {
   823  	type NoMethod GoogleSecuritySafebrowsingV4ThreatEntry
   824  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   825  }
   826  
   827  // GoogleSecuritySafebrowsingV4ThreatEntryMetadata: The metadata associated
   828  // with a specific threat entry. The client is expected to know the metadata
   829  // key/value pairs associated with each threat type.
   830  type GoogleSecuritySafebrowsingV4ThreatEntryMetadata struct {
   831  	// Entries: The metadata entries.
   832  	Entries []*GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry `json:"entries,omitempty"`
   833  	// ForceSendFields is a list of field names (e.g. "Entries") to unconditionally
   834  	// include in API requests. By default, fields with empty or default values are
   835  	// omitted from API requests. See
   836  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   837  	// details.
   838  	ForceSendFields []string `json:"-"`
   839  	// NullFields is a list of field names (e.g. "Entries") to include in API
   840  	// requests with the JSON null value. By default, fields with empty values are
   841  	// omitted from API requests. See
   842  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   843  	NullFields []string `json:"-"`
   844  }
   845  
   846  func (s *GoogleSecuritySafebrowsingV4ThreatEntryMetadata) MarshalJSON() ([]byte, error) {
   847  	type NoMethod GoogleSecuritySafebrowsingV4ThreatEntryMetadata
   848  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   849  }
   850  
   851  // GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry: A single
   852  // metadata entry.
   853  type GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry struct {
   854  	// Key: The metadata entry key. For JSON requests, the key is base64-encoded.
   855  	Key string `json:"key,omitempty"`
   856  	// Value: The metadata entry value. For JSON requests, the value is
   857  	// base64-encoded.
   858  	Value string `json:"value,omitempty"`
   859  	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
   860  	// include in API requests. By default, fields with empty or default values are
   861  	// omitted from API requests. See
   862  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   863  	// details.
   864  	ForceSendFields []string `json:"-"`
   865  	// NullFields is a list of field names (e.g. "Key") to include in API requests
   866  	// with the JSON null value. By default, fields with empty values are omitted
   867  	// from API requests. See
   868  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   869  	NullFields []string `json:"-"`
   870  }
   871  
   872  func (s *GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry) MarshalJSON() ([]byte, error) {
   873  	type NoMethod GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry
   874  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   875  }
   876  
   877  // GoogleSecuritySafebrowsingV4ThreatEntrySet: A set of threats that should be
   878  // added or removed from a client's local database.
   879  type GoogleSecuritySafebrowsingV4ThreatEntrySet struct {
   880  	// CompressionType: The compression type for the entries in this set.
   881  	//
   882  	// Possible values:
   883  	//   "COMPRESSION_TYPE_UNSPECIFIED" - Unknown.
   884  	//   "RAW" - Raw, uncompressed data.
   885  	//   "RICE" - Rice-Golomb encoded data.
   886  	CompressionType string `json:"compressionType,omitempty"`
   887  	// RawHashes: The raw SHA256-formatted entries.
   888  	RawHashes *GoogleSecuritySafebrowsingV4RawHashes `json:"rawHashes,omitempty"`
   889  	// RawIndices: The raw removal indices for a local list.
   890  	RawIndices *GoogleSecuritySafebrowsingV4RawIndices `json:"rawIndices,omitempty"`
   891  	// RiceHashes: The encoded 4-byte prefixes of SHA256-formatted entries, using a
   892  	// Golomb-Rice encoding. The hashes are converted to uint32, sorted in
   893  	// ascending order, then delta encoded and stored as encoded_data.
   894  	RiceHashes *GoogleSecuritySafebrowsingV4RiceDeltaEncoding `json:"riceHashes,omitempty"`
   895  	// RiceIndices: The encoded local, lexicographically-sorted list indices, using
   896  	// a Golomb-Rice encoding. Used for sending compressed removal indices. The
   897  	// removal indices (uint32) are sorted in ascending order, then delta encoded
   898  	// and stored as encoded_data.
   899  	RiceIndices *GoogleSecuritySafebrowsingV4RiceDeltaEncoding `json:"riceIndices,omitempty"`
   900  	// ForceSendFields is a list of field names (e.g. "CompressionType") to
   901  	// unconditionally include in API requests. By default, fields with empty or
   902  	// default values are omitted from API requests. See
   903  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   904  	// details.
   905  	ForceSendFields []string `json:"-"`
   906  	// NullFields is a list of field names (e.g. "CompressionType") to include in
   907  	// API requests with the JSON null value. By default, fields with empty values
   908  	// are omitted from API requests. See
   909  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   910  	NullFields []string `json:"-"`
   911  }
   912  
   913  func (s *GoogleSecuritySafebrowsingV4ThreatEntrySet) MarshalJSON() ([]byte, error) {
   914  	type NoMethod GoogleSecuritySafebrowsingV4ThreatEntrySet
   915  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   916  }
   917  
   918  type GoogleSecuritySafebrowsingV4ThreatHit struct {
   919  	// ClientInfo: Client-reported identification.
   920  	ClientInfo *GoogleSecuritySafebrowsingV4ClientInfo `json:"clientInfo,omitempty"`
   921  	// Entry: The threat entry responsible for the hit. Full hash should be
   922  	// reported for hash-based hits.
   923  	Entry *GoogleSecuritySafebrowsingV4ThreatEntry `json:"entry,omitempty"`
   924  	// PlatformType: The platform type reported.
   925  	//
   926  	// Possible values:
   927  	//   "PLATFORM_TYPE_UNSPECIFIED" - Unknown platform.
   928  	//   "WINDOWS" - Threat posed to Windows.
   929  	//   "LINUX" - Threat posed to Linux.
   930  	//   "ANDROID" - Threat posed to Android.
   931  	//   "OSX" - Threat posed to OS X.
   932  	//   "IOS" - Threat posed to iOS.
   933  	//   "ANY_PLATFORM" - Threat posed to at least one of the defined platforms.
   934  	//   "ALL_PLATFORMS" - Threat posed to all defined platforms.
   935  	//   "CHROME" - Threat posed to Chrome.
   936  	PlatformType string `json:"platformType,omitempty"`
   937  	// Resources: The resources related to the threat hit.
   938  	Resources []*GoogleSecuritySafebrowsingV4ThreatHitThreatSource `json:"resources,omitempty"`
   939  	// ThreatType: The threat type reported.
   940  	//
   941  	// Possible values:
   942  	//   "THREAT_TYPE_UNSPECIFIED" - Unknown.
   943  	//   "MALWARE" - Malware threat type.
   944  	//   "SOCIAL_ENGINEERING" - Social engineering threat type.
   945  	//   "UNWANTED_SOFTWARE" - Unwanted software threat type.
   946  	//   "POTENTIALLY_HARMFUL_APPLICATION" - Potentially harmful application threat
   947  	// type.
   948  	//   "SOCIAL_ENGINEERING_INTERNAL" - Social engineering threat type for
   949  	// internal use.
   950  	//   "API_ABUSE" - API abuse threat type.
   951  	//   "MALICIOUS_BINARY" - Malicious binary threat type.
   952  	//   "CSD_WHITELIST" - Client side detection whitelist threat type.
   953  	//   "CSD_DOWNLOAD_WHITELIST" - Client side download detection whitelist threat
   954  	// type.
   955  	//   "CLIENT_INCIDENT" - Client incident threat type.
   956  	//   "CLIENT_INCIDENT_WHITELIST" - Whitelist used when detecting client
   957  	// incident threats.
   958  	//   "APK_MALWARE_OFFLINE" - List used for offline APK checks in PAM.
   959  	//   "SUBRESOURCE_FILTER" - Patterns to be used for activating the subresource
   960  	// filter.
   961  	//   "SUSPICIOUS" - Entities that are suspected to present a threat.
   962  	//   "TRICK_TO_BILL" - Trick-to-bill threat type.
   963  	//   "HIGH_CONFIDENCE_ALLOWLIST" - URL expressions that are very likely to be
   964  	// safe.
   965  	//   "ACCURACY_TIPS" - An experimental threat type related to Jigsaw. See
   966  	// https://jigsaw.google.com/.
   967  	ThreatType string `json:"threatType,omitempty"`
   968  	// UserInfo: Details about the user that encountered the threat.
   969  	UserInfo *GoogleSecuritySafebrowsingV4ThreatHitUserInfo `json:"userInfo,omitempty"`
   970  	// ForceSendFields is a list of field names (e.g. "ClientInfo") to
   971  	// unconditionally include in API requests. By default, fields with empty or
   972  	// default values are omitted from API requests. See
   973  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   974  	// details.
   975  	ForceSendFields []string `json:"-"`
   976  	// NullFields is a list of field names (e.g. "ClientInfo") to include in API
   977  	// requests with the JSON null value. By default, fields with empty values are
   978  	// omitted from API requests. See
   979  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   980  	NullFields []string `json:"-"`
   981  }
   982  
   983  func (s *GoogleSecuritySafebrowsingV4ThreatHit) MarshalJSON() ([]byte, error) {
   984  	type NoMethod GoogleSecuritySafebrowsingV4ThreatHit
   985  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   986  }
   987  
   988  // GoogleSecuritySafebrowsingV4ThreatHitThreatSource: A single resource related
   989  // to a threat hit.
   990  type GoogleSecuritySafebrowsingV4ThreatHitThreatSource struct {
   991  	// Referrer: Referrer of the resource. Only set if the referrer is available.
   992  	Referrer string `json:"referrer,omitempty"`
   993  	// RemoteIp: The remote IP of the resource in ASCII format. Either IPv4 or
   994  	// IPv6.
   995  	RemoteIp string `json:"remoteIp,omitempty"`
   996  	// Type: The type of source reported.
   997  	//
   998  	// Possible values:
   999  	//   "THREAT_SOURCE_TYPE_UNSPECIFIED" - Unknown.
  1000  	//   "MATCHING_URL" - The URL that matched the threat list (for which
  1001  	// GetFullHash returned a valid hash).
  1002  	//   "TAB_URL" - The final top-level URL of the tab that the client was
  1003  	// browsing when the match occurred.
  1004  	//   "TAB_REDIRECT" - A redirect URL that was fetched before hitting the final
  1005  	// TAB_URL.
  1006  	//   "TAB_RESOURCE" - A resource loaded within the final TAB_URL.
  1007  	Type string `json:"type,omitempty"`
  1008  	// Url: The URL of the resource.
  1009  	Url string `json:"url,omitempty"`
  1010  	// ForceSendFields is a list of field names (e.g. "Referrer") to
  1011  	// unconditionally include in API requests. By default, fields with empty or
  1012  	// default values are omitted from API requests. See
  1013  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1014  	// details.
  1015  	ForceSendFields []string `json:"-"`
  1016  	// NullFields is a list of field names (e.g. "Referrer") to include in API
  1017  	// requests with the JSON null value. By default, fields with empty values are
  1018  	// omitted from API requests. See
  1019  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1020  	NullFields []string `json:"-"`
  1021  }
  1022  
  1023  func (s *GoogleSecuritySafebrowsingV4ThreatHitThreatSource) MarshalJSON() ([]byte, error) {
  1024  	type NoMethod GoogleSecuritySafebrowsingV4ThreatHitThreatSource
  1025  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1026  }
  1027  
  1028  // GoogleSecuritySafebrowsingV4ThreatHitUserInfo: Details about the user that
  1029  // encountered the threat.
  1030  type GoogleSecuritySafebrowsingV4ThreatHitUserInfo struct {
  1031  	// RegionCode: The UN M.49 region code associated with the user's location.
  1032  	RegionCode string `json:"regionCode,omitempty"`
  1033  	// UserId: Unique user identifier defined by the client.
  1034  	UserId string `json:"userId,omitempty"`
  1035  	// ForceSendFields is a list of field names (e.g. "RegionCode") to
  1036  	// unconditionally include in API requests. By default, fields with empty or
  1037  	// default values are omitted from API requests. See
  1038  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1039  	// details.
  1040  	ForceSendFields []string `json:"-"`
  1041  	// NullFields is a list of field names (e.g. "RegionCode") to include in API
  1042  	// requests with the JSON null value. By default, fields with empty values are
  1043  	// omitted from API requests. See
  1044  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1045  	NullFields []string `json:"-"`
  1046  }
  1047  
  1048  func (s *GoogleSecuritySafebrowsingV4ThreatHitUserInfo) MarshalJSON() ([]byte, error) {
  1049  	type NoMethod GoogleSecuritySafebrowsingV4ThreatHitUserInfo
  1050  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1051  }
  1052  
  1053  // GoogleSecuritySafebrowsingV4ThreatInfo: The information regarding one or
  1054  // more threats that a client submits when checking for matches in threat
  1055  // lists.
  1056  type GoogleSecuritySafebrowsingV4ThreatInfo struct {
  1057  	// PlatformTypes: The platform types to be checked.
  1058  	//
  1059  	// Possible values:
  1060  	//   "PLATFORM_TYPE_UNSPECIFIED" - Unknown platform.
  1061  	//   "WINDOWS" - Threat posed to Windows.
  1062  	//   "LINUX" - Threat posed to Linux.
  1063  	//   "ANDROID" - Threat posed to Android.
  1064  	//   "OSX" - Threat posed to OS X.
  1065  	//   "IOS" - Threat posed to iOS.
  1066  	//   "ANY_PLATFORM" - Threat posed to at least one of the defined platforms.
  1067  	//   "ALL_PLATFORMS" - Threat posed to all defined platforms.
  1068  	//   "CHROME" - Threat posed to Chrome.
  1069  	PlatformTypes []string `json:"platformTypes,omitempty"`
  1070  	// ThreatEntries: The threat entries to be checked.
  1071  	ThreatEntries []*GoogleSecuritySafebrowsingV4ThreatEntry `json:"threatEntries,omitempty"`
  1072  	// ThreatEntryTypes: The entry types to be checked.
  1073  	//
  1074  	// Possible values:
  1075  	//   "THREAT_ENTRY_TYPE_UNSPECIFIED" - Unspecified.
  1076  	//   "URL" - A URL.
  1077  	//   "EXECUTABLE" - An executable program.
  1078  	//   "IP_RANGE" - An IP range.
  1079  	//   "CHROME_EXTENSION" - Chrome extension.
  1080  	//   "FILENAME" - Filename.
  1081  	//   "CERT" - CERT
  1082  	ThreatEntryTypes []string `json:"threatEntryTypes,omitempty"`
  1083  	// ThreatTypes: The threat types to be checked.
  1084  	//
  1085  	// Possible values:
  1086  	//   "THREAT_TYPE_UNSPECIFIED" - Unknown.
  1087  	//   "MALWARE" - Malware threat type.
  1088  	//   "SOCIAL_ENGINEERING" - Social engineering threat type.
  1089  	//   "UNWANTED_SOFTWARE" - Unwanted software threat type.
  1090  	//   "POTENTIALLY_HARMFUL_APPLICATION" - Potentially harmful application threat
  1091  	// type.
  1092  	//   "SOCIAL_ENGINEERING_INTERNAL" - Social engineering threat type for
  1093  	// internal use.
  1094  	//   "API_ABUSE" - API abuse threat type.
  1095  	//   "MALICIOUS_BINARY" - Malicious binary threat type.
  1096  	//   "CSD_WHITELIST" - Client side detection whitelist threat type.
  1097  	//   "CSD_DOWNLOAD_WHITELIST" - Client side download detection whitelist threat
  1098  	// type.
  1099  	//   "CLIENT_INCIDENT" - Client incident threat type.
  1100  	//   "CLIENT_INCIDENT_WHITELIST" - Whitelist used when detecting client
  1101  	// incident threats.
  1102  	//   "APK_MALWARE_OFFLINE" - List used for offline APK checks in PAM.
  1103  	//   "SUBRESOURCE_FILTER" - Patterns to be used for activating the subresource
  1104  	// filter.
  1105  	//   "SUSPICIOUS" - Entities that are suspected to present a threat.
  1106  	//   "TRICK_TO_BILL" - Trick-to-bill threat type.
  1107  	//   "HIGH_CONFIDENCE_ALLOWLIST" - URL expressions that are very likely to be
  1108  	// safe.
  1109  	//   "ACCURACY_TIPS" - An experimental threat type related to Jigsaw. See
  1110  	// https://jigsaw.google.com/.
  1111  	ThreatTypes []string `json:"threatTypes,omitempty"`
  1112  	// ForceSendFields is a list of field names (e.g. "PlatformTypes") to
  1113  	// unconditionally include in API requests. By default, fields with empty or
  1114  	// default values are omitted from API requests. See
  1115  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1116  	// details.
  1117  	ForceSendFields []string `json:"-"`
  1118  	// NullFields is a list of field names (e.g. "PlatformTypes") to include in API
  1119  	// requests with the JSON null value. By default, fields with empty values are
  1120  	// omitted from API requests. See
  1121  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1122  	NullFields []string `json:"-"`
  1123  }
  1124  
  1125  func (s *GoogleSecuritySafebrowsingV4ThreatInfo) MarshalJSON() ([]byte, error) {
  1126  	type NoMethod GoogleSecuritySafebrowsingV4ThreatInfo
  1127  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1128  }
  1129  
  1130  // GoogleSecuritySafebrowsingV4ThreatListDescriptor: Describes an individual
  1131  // threat list. A list is defined by three parameters: the type of threat
  1132  // posed, the type of platform targeted by the threat, and the type of entries
  1133  // in the list.
  1134  type GoogleSecuritySafebrowsingV4ThreatListDescriptor struct {
  1135  	// PlatformType: The platform type targeted by the list's entries.
  1136  	//
  1137  	// Possible values:
  1138  	//   "PLATFORM_TYPE_UNSPECIFIED" - Unknown platform.
  1139  	//   "WINDOWS" - Threat posed to Windows.
  1140  	//   "LINUX" - Threat posed to Linux.
  1141  	//   "ANDROID" - Threat posed to Android.
  1142  	//   "OSX" - Threat posed to OS X.
  1143  	//   "IOS" - Threat posed to iOS.
  1144  	//   "ANY_PLATFORM" - Threat posed to at least one of the defined platforms.
  1145  	//   "ALL_PLATFORMS" - Threat posed to all defined platforms.
  1146  	//   "CHROME" - Threat posed to Chrome.
  1147  	PlatformType string `json:"platformType,omitempty"`
  1148  	// ThreatEntryType: The entry types contained in the list.
  1149  	//
  1150  	// Possible values:
  1151  	//   "THREAT_ENTRY_TYPE_UNSPECIFIED" - Unspecified.
  1152  	//   "URL" - A URL.
  1153  	//   "EXECUTABLE" - An executable program.
  1154  	//   "IP_RANGE" - An IP range.
  1155  	//   "CHROME_EXTENSION" - Chrome extension.
  1156  	//   "FILENAME" - Filename.
  1157  	//   "CERT" - CERT
  1158  	ThreatEntryType string `json:"threatEntryType,omitempty"`
  1159  	// ThreatType: The threat type posed by the list's entries.
  1160  	//
  1161  	// Possible values:
  1162  	//   "THREAT_TYPE_UNSPECIFIED" - Unknown.
  1163  	//   "MALWARE" - Malware threat type.
  1164  	//   "SOCIAL_ENGINEERING" - Social engineering threat type.
  1165  	//   "UNWANTED_SOFTWARE" - Unwanted software threat type.
  1166  	//   "POTENTIALLY_HARMFUL_APPLICATION" - Potentially harmful application threat
  1167  	// type.
  1168  	//   "SOCIAL_ENGINEERING_INTERNAL" - Social engineering threat type for
  1169  	// internal use.
  1170  	//   "API_ABUSE" - API abuse threat type.
  1171  	//   "MALICIOUS_BINARY" - Malicious binary threat type.
  1172  	//   "CSD_WHITELIST" - Client side detection whitelist threat type.
  1173  	//   "CSD_DOWNLOAD_WHITELIST" - Client side download detection whitelist threat
  1174  	// type.
  1175  	//   "CLIENT_INCIDENT" - Client incident threat type.
  1176  	//   "CLIENT_INCIDENT_WHITELIST" - Whitelist used when detecting client
  1177  	// incident threats.
  1178  	//   "APK_MALWARE_OFFLINE" - List used for offline APK checks in PAM.
  1179  	//   "SUBRESOURCE_FILTER" - Patterns to be used for activating the subresource
  1180  	// filter.
  1181  	//   "SUSPICIOUS" - Entities that are suspected to present a threat.
  1182  	//   "TRICK_TO_BILL" - Trick-to-bill threat type.
  1183  	//   "HIGH_CONFIDENCE_ALLOWLIST" - URL expressions that are very likely to be
  1184  	// safe.
  1185  	//   "ACCURACY_TIPS" - An experimental threat type related to Jigsaw. See
  1186  	// https://jigsaw.google.com/.
  1187  	ThreatType string `json:"threatType,omitempty"`
  1188  	// ForceSendFields is a list of field names (e.g. "PlatformType") to
  1189  	// unconditionally include in API requests. By default, fields with empty or
  1190  	// default values are omitted from API requests. See
  1191  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1192  	// details.
  1193  	ForceSendFields []string `json:"-"`
  1194  	// NullFields is a list of field names (e.g. "PlatformType") to include in API
  1195  	// requests with the JSON null value. By default, fields with empty values are
  1196  	// omitted from API requests. See
  1197  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1198  	NullFields []string `json:"-"`
  1199  }
  1200  
  1201  func (s *GoogleSecuritySafebrowsingV4ThreatListDescriptor) MarshalJSON() ([]byte, error) {
  1202  	type NoMethod GoogleSecuritySafebrowsingV4ThreatListDescriptor
  1203  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1204  }
  1205  
  1206  // GoogleSecuritySafebrowsingV4ThreatMatch: A match when checking a threat
  1207  // entry in the Safe Browsing threat lists.
  1208  type GoogleSecuritySafebrowsingV4ThreatMatch struct {
  1209  	// CacheDuration: The cache lifetime for the returned match. Clients must not
  1210  	// cache this response for more than this duration to avoid false positives.
  1211  	CacheDuration string `json:"cacheDuration,omitempty"`
  1212  	// PlatformType: The platform type matching this threat.
  1213  	//
  1214  	// Possible values:
  1215  	//   "PLATFORM_TYPE_UNSPECIFIED" - Unknown platform.
  1216  	//   "WINDOWS" - Threat posed to Windows.
  1217  	//   "LINUX" - Threat posed to Linux.
  1218  	//   "ANDROID" - Threat posed to Android.
  1219  	//   "OSX" - Threat posed to OS X.
  1220  	//   "IOS" - Threat posed to iOS.
  1221  	//   "ANY_PLATFORM" - Threat posed to at least one of the defined platforms.
  1222  	//   "ALL_PLATFORMS" - Threat posed to all defined platforms.
  1223  	//   "CHROME" - Threat posed to Chrome.
  1224  	PlatformType string `json:"platformType,omitempty"`
  1225  	// Threat: The threat matching this threat.
  1226  	Threat *GoogleSecuritySafebrowsingV4ThreatEntry `json:"threat,omitempty"`
  1227  	// ThreatEntryMetadata: Optional metadata associated with this threat.
  1228  	ThreatEntryMetadata *GoogleSecuritySafebrowsingV4ThreatEntryMetadata `json:"threatEntryMetadata,omitempty"`
  1229  	// ThreatEntryType: The threat entry type matching this threat.
  1230  	//
  1231  	// Possible values:
  1232  	//   "THREAT_ENTRY_TYPE_UNSPECIFIED" - Unspecified.
  1233  	//   "URL" - A URL.
  1234  	//   "EXECUTABLE" - An executable program.
  1235  	//   "IP_RANGE" - An IP range.
  1236  	//   "CHROME_EXTENSION" - Chrome extension.
  1237  	//   "FILENAME" - Filename.
  1238  	//   "CERT" - CERT
  1239  	ThreatEntryType string `json:"threatEntryType,omitempty"`
  1240  	// ThreatType: The threat type matching this threat.
  1241  	//
  1242  	// Possible values:
  1243  	//   "THREAT_TYPE_UNSPECIFIED" - Unknown.
  1244  	//   "MALWARE" - Malware threat type.
  1245  	//   "SOCIAL_ENGINEERING" - Social engineering threat type.
  1246  	//   "UNWANTED_SOFTWARE" - Unwanted software threat type.
  1247  	//   "POTENTIALLY_HARMFUL_APPLICATION" - Potentially harmful application threat
  1248  	// type.
  1249  	//   "SOCIAL_ENGINEERING_INTERNAL" - Social engineering threat type for
  1250  	// internal use.
  1251  	//   "API_ABUSE" - API abuse threat type.
  1252  	//   "MALICIOUS_BINARY" - Malicious binary threat type.
  1253  	//   "CSD_WHITELIST" - Client side detection whitelist threat type.
  1254  	//   "CSD_DOWNLOAD_WHITELIST" - Client side download detection whitelist threat
  1255  	// type.
  1256  	//   "CLIENT_INCIDENT" - Client incident threat type.
  1257  	//   "CLIENT_INCIDENT_WHITELIST" - Whitelist used when detecting client
  1258  	// incident threats.
  1259  	//   "APK_MALWARE_OFFLINE" - List used for offline APK checks in PAM.
  1260  	//   "SUBRESOURCE_FILTER" - Patterns to be used for activating the subresource
  1261  	// filter.
  1262  	//   "SUSPICIOUS" - Entities that are suspected to present a threat.
  1263  	//   "TRICK_TO_BILL" - Trick-to-bill threat type.
  1264  	//   "HIGH_CONFIDENCE_ALLOWLIST" - URL expressions that are very likely to be
  1265  	// safe.
  1266  	//   "ACCURACY_TIPS" - An experimental threat type related to Jigsaw. See
  1267  	// https://jigsaw.google.com/.
  1268  	ThreatType string `json:"threatType,omitempty"`
  1269  	// ForceSendFields is a list of field names (e.g. "CacheDuration") to
  1270  	// unconditionally include in API requests. By default, fields with empty or
  1271  	// default values are omitted from API requests. See
  1272  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1273  	// details.
  1274  	ForceSendFields []string `json:"-"`
  1275  	// NullFields is a list of field names (e.g. "CacheDuration") to include in API
  1276  	// requests with the JSON null value. By default, fields with empty values are
  1277  	// omitted from API requests. See
  1278  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1279  	NullFields []string `json:"-"`
  1280  }
  1281  
  1282  func (s *GoogleSecuritySafebrowsingV4ThreatMatch) MarshalJSON() ([]byte, error) {
  1283  	type NoMethod GoogleSecuritySafebrowsingV4ThreatMatch
  1284  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1285  }
  1286  
  1287  type EncodedFullHashesGetCall struct {
  1288  	s              *Service
  1289  	encodedRequest string
  1290  	urlParams_     gensupport.URLParams
  1291  	ifNoneMatch_   string
  1292  	ctx_           context.Context
  1293  	header_        http.Header
  1294  }
  1295  
  1296  // Get:
  1297  //
  1298  // - encodedRequest: A serialized FindFullHashesRequest proto.
  1299  func (r *EncodedFullHashesService) Get(encodedRequest string) *EncodedFullHashesGetCall {
  1300  	c := &EncodedFullHashesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1301  	c.encodedRequest = encodedRequest
  1302  	return c
  1303  }
  1304  
  1305  // ClientId sets the optional parameter "clientId": A client ID that
  1306  // (hopefully) uniquely identifies the client implementation of the Safe
  1307  // Browsing API.
  1308  func (c *EncodedFullHashesGetCall) ClientId(clientId string) *EncodedFullHashesGetCall {
  1309  	c.urlParams_.Set("clientId", clientId)
  1310  	return c
  1311  }
  1312  
  1313  // ClientVersion sets the optional parameter "clientVersion": The version of
  1314  // the client implementation.
  1315  func (c *EncodedFullHashesGetCall) ClientVersion(clientVersion string) *EncodedFullHashesGetCall {
  1316  	c.urlParams_.Set("clientVersion", clientVersion)
  1317  	return c
  1318  }
  1319  
  1320  // Fields allows partial responses to be retrieved. See
  1321  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1322  // details.
  1323  func (c *EncodedFullHashesGetCall) Fields(s ...googleapi.Field) *EncodedFullHashesGetCall {
  1324  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1325  	return c
  1326  }
  1327  
  1328  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1329  // object's ETag matches the given value. This is useful for getting updates
  1330  // only after the object has changed since the last request.
  1331  func (c *EncodedFullHashesGetCall) IfNoneMatch(entityTag string) *EncodedFullHashesGetCall {
  1332  	c.ifNoneMatch_ = entityTag
  1333  	return c
  1334  }
  1335  
  1336  // Context sets the context to be used in this call's Do method.
  1337  func (c *EncodedFullHashesGetCall) Context(ctx context.Context) *EncodedFullHashesGetCall {
  1338  	c.ctx_ = ctx
  1339  	return c
  1340  }
  1341  
  1342  // Header returns a http.Header that can be modified by the caller to add
  1343  // headers to the request.
  1344  func (c *EncodedFullHashesGetCall) Header() http.Header {
  1345  	if c.header_ == nil {
  1346  		c.header_ = make(http.Header)
  1347  	}
  1348  	return c.header_
  1349  }
  1350  
  1351  func (c *EncodedFullHashesGetCall) doRequest(alt string) (*http.Response, error) {
  1352  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1353  	if c.ifNoneMatch_ != "" {
  1354  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1355  	}
  1356  	var body io.Reader = nil
  1357  	c.urlParams_.Set("alt", alt)
  1358  	c.urlParams_.Set("prettyPrint", "false")
  1359  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/encodedFullHashes/{encodedRequest}")
  1360  	urls += "?" + c.urlParams_.Encode()
  1361  	req, err := http.NewRequest("GET", urls, body)
  1362  	if err != nil {
  1363  		return nil, err
  1364  	}
  1365  	req.Header = reqHeaders
  1366  	googleapi.Expand(req.URL, map[string]string{
  1367  		"encodedRequest": c.encodedRequest,
  1368  	})
  1369  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1370  }
  1371  
  1372  // Do executes the "safebrowsing.encodedFullHashes.get" call.
  1373  // Any non-2xx status code is an error. Response headers are in either
  1374  // *GoogleSecuritySafebrowsingV4FindFullHashesResponse.ServerResponse.Header or
  1375  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  1376  // googleapi.IsNotModified to check whether the returned error was because
  1377  // http.StatusNotModified was returned.
  1378  func (c *EncodedFullHashesGetCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FindFullHashesResponse, error) {
  1379  	gensupport.SetOptions(c.urlParams_, opts...)
  1380  	res, err := c.doRequest("json")
  1381  	if res != nil && res.StatusCode == http.StatusNotModified {
  1382  		if res.Body != nil {
  1383  			res.Body.Close()
  1384  		}
  1385  		return nil, gensupport.WrapError(&googleapi.Error{
  1386  			Code:   res.StatusCode,
  1387  			Header: res.Header,
  1388  		})
  1389  	}
  1390  	if err != nil {
  1391  		return nil, err
  1392  	}
  1393  	defer googleapi.CloseBody(res)
  1394  	if err := googleapi.CheckResponse(res); err != nil {
  1395  		return nil, gensupport.WrapError(err)
  1396  	}
  1397  	ret := &GoogleSecuritySafebrowsingV4FindFullHashesResponse{
  1398  		ServerResponse: googleapi.ServerResponse{
  1399  			Header:         res.Header,
  1400  			HTTPStatusCode: res.StatusCode,
  1401  		},
  1402  	}
  1403  	target := &ret
  1404  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1405  		return nil, err
  1406  	}
  1407  	return ret, nil
  1408  }
  1409  
  1410  type EncodedUpdatesGetCall struct {
  1411  	s              *Service
  1412  	encodedRequest string
  1413  	urlParams_     gensupport.URLParams
  1414  	ifNoneMatch_   string
  1415  	ctx_           context.Context
  1416  	header_        http.Header
  1417  }
  1418  
  1419  // Get:
  1420  //
  1421  // - encodedRequest: A serialized FetchThreatListUpdatesRequest proto.
  1422  func (r *EncodedUpdatesService) Get(encodedRequest string) *EncodedUpdatesGetCall {
  1423  	c := &EncodedUpdatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1424  	c.encodedRequest = encodedRequest
  1425  	return c
  1426  }
  1427  
  1428  // ClientId sets the optional parameter "clientId": A client ID that uniquely
  1429  // identifies the client implementation of the Safe Browsing API.
  1430  func (c *EncodedUpdatesGetCall) ClientId(clientId string) *EncodedUpdatesGetCall {
  1431  	c.urlParams_.Set("clientId", clientId)
  1432  	return c
  1433  }
  1434  
  1435  // ClientVersion sets the optional parameter "clientVersion": The version of
  1436  // the client implementation.
  1437  func (c *EncodedUpdatesGetCall) ClientVersion(clientVersion string) *EncodedUpdatesGetCall {
  1438  	c.urlParams_.Set("clientVersion", clientVersion)
  1439  	return c
  1440  }
  1441  
  1442  // Fields allows partial responses to be retrieved. See
  1443  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1444  // details.
  1445  func (c *EncodedUpdatesGetCall) Fields(s ...googleapi.Field) *EncodedUpdatesGetCall {
  1446  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1447  	return c
  1448  }
  1449  
  1450  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1451  // object's ETag matches the given value. This is useful for getting updates
  1452  // only after the object has changed since the last request.
  1453  func (c *EncodedUpdatesGetCall) IfNoneMatch(entityTag string) *EncodedUpdatesGetCall {
  1454  	c.ifNoneMatch_ = entityTag
  1455  	return c
  1456  }
  1457  
  1458  // Context sets the context to be used in this call's Do method.
  1459  func (c *EncodedUpdatesGetCall) Context(ctx context.Context) *EncodedUpdatesGetCall {
  1460  	c.ctx_ = ctx
  1461  	return c
  1462  }
  1463  
  1464  // Header returns a http.Header that can be modified by the caller to add
  1465  // headers to the request.
  1466  func (c *EncodedUpdatesGetCall) Header() http.Header {
  1467  	if c.header_ == nil {
  1468  		c.header_ = make(http.Header)
  1469  	}
  1470  	return c.header_
  1471  }
  1472  
  1473  func (c *EncodedUpdatesGetCall) doRequest(alt string) (*http.Response, error) {
  1474  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1475  	if c.ifNoneMatch_ != "" {
  1476  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1477  	}
  1478  	var body io.Reader = nil
  1479  	c.urlParams_.Set("alt", alt)
  1480  	c.urlParams_.Set("prettyPrint", "false")
  1481  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/encodedUpdates/{encodedRequest}")
  1482  	urls += "?" + c.urlParams_.Encode()
  1483  	req, err := http.NewRequest("GET", urls, body)
  1484  	if err != nil {
  1485  		return nil, err
  1486  	}
  1487  	req.Header = reqHeaders
  1488  	googleapi.Expand(req.URL, map[string]string{
  1489  		"encodedRequest": c.encodedRequest,
  1490  	})
  1491  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1492  }
  1493  
  1494  // Do executes the "safebrowsing.encodedUpdates.get" call.
  1495  // Any non-2xx status code is an error. Response headers are in either
  1496  // *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse.ServerResponse.He
  1497  // ader or (if a response was returned at all) in
  1498  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1499  // whether the returned error was because http.StatusNotModified was returned.
  1500  func (c *EncodedUpdatesGetCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse, error) {
  1501  	gensupport.SetOptions(c.urlParams_, opts...)
  1502  	res, err := c.doRequest("json")
  1503  	if res != nil && res.StatusCode == http.StatusNotModified {
  1504  		if res.Body != nil {
  1505  			res.Body.Close()
  1506  		}
  1507  		return nil, gensupport.WrapError(&googleapi.Error{
  1508  			Code:   res.StatusCode,
  1509  			Header: res.Header,
  1510  		})
  1511  	}
  1512  	if err != nil {
  1513  		return nil, err
  1514  	}
  1515  	defer googleapi.CloseBody(res)
  1516  	if err := googleapi.CheckResponse(res); err != nil {
  1517  		return nil, gensupport.WrapError(err)
  1518  	}
  1519  	ret := &GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse{
  1520  		ServerResponse: googleapi.ServerResponse{
  1521  			Header:         res.Header,
  1522  			HTTPStatusCode: res.StatusCode,
  1523  		},
  1524  	}
  1525  	target := &ret
  1526  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1527  		return nil, err
  1528  	}
  1529  	return ret, nil
  1530  }
  1531  
  1532  type FullHashesFindCall struct {
  1533  	s                                                 *Service
  1534  	googlesecuritysafebrowsingv4findfullhashesrequest *GoogleSecuritySafebrowsingV4FindFullHashesRequest
  1535  	urlParams_                                        gensupport.URLParams
  1536  	ctx_                                              context.Context
  1537  	header_                                           http.Header
  1538  }
  1539  
  1540  // Find: Finds the full hashes that match the requested hash prefixes.
  1541  func (r *FullHashesService) Find(googlesecuritysafebrowsingv4findfullhashesrequest *GoogleSecuritySafebrowsingV4FindFullHashesRequest) *FullHashesFindCall {
  1542  	c := &FullHashesFindCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1543  	c.googlesecuritysafebrowsingv4findfullhashesrequest = googlesecuritysafebrowsingv4findfullhashesrequest
  1544  	return c
  1545  }
  1546  
  1547  // Fields allows partial responses to be retrieved. See
  1548  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1549  // details.
  1550  func (c *FullHashesFindCall) Fields(s ...googleapi.Field) *FullHashesFindCall {
  1551  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1552  	return c
  1553  }
  1554  
  1555  // Context sets the context to be used in this call's Do method.
  1556  func (c *FullHashesFindCall) Context(ctx context.Context) *FullHashesFindCall {
  1557  	c.ctx_ = ctx
  1558  	return c
  1559  }
  1560  
  1561  // Header returns a http.Header that can be modified by the caller to add
  1562  // headers to the request.
  1563  func (c *FullHashesFindCall) Header() http.Header {
  1564  	if c.header_ == nil {
  1565  		c.header_ = make(http.Header)
  1566  	}
  1567  	return c.header_
  1568  }
  1569  
  1570  func (c *FullHashesFindCall) doRequest(alt string) (*http.Response, error) {
  1571  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1572  	var body io.Reader = nil
  1573  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4findfullhashesrequest)
  1574  	if err != nil {
  1575  		return nil, err
  1576  	}
  1577  	c.urlParams_.Set("alt", alt)
  1578  	c.urlParams_.Set("prettyPrint", "false")
  1579  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/fullHashes:find")
  1580  	urls += "?" + c.urlParams_.Encode()
  1581  	req, err := http.NewRequest("POST", urls, body)
  1582  	if err != nil {
  1583  		return nil, err
  1584  	}
  1585  	req.Header = reqHeaders
  1586  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1587  }
  1588  
  1589  // Do executes the "safebrowsing.fullHashes.find" call.
  1590  // Any non-2xx status code is an error. Response headers are in either
  1591  // *GoogleSecuritySafebrowsingV4FindFullHashesResponse.ServerResponse.Header or
  1592  // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
  1593  // googleapi.IsNotModified to check whether the returned error was because
  1594  // http.StatusNotModified was returned.
  1595  func (c *FullHashesFindCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FindFullHashesResponse, error) {
  1596  	gensupport.SetOptions(c.urlParams_, opts...)
  1597  	res, err := c.doRequest("json")
  1598  	if res != nil && res.StatusCode == http.StatusNotModified {
  1599  		if res.Body != nil {
  1600  			res.Body.Close()
  1601  		}
  1602  		return nil, gensupport.WrapError(&googleapi.Error{
  1603  			Code:   res.StatusCode,
  1604  			Header: res.Header,
  1605  		})
  1606  	}
  1607  	if err != nil {
  1608  		return nil, err
  1609  	}
  1610  	defer googleapi.CloseBody(res)
  1611  	if err := googleapi.CheckResponse(res); err != nil {
  1612  		return nil, gensupport.WrapError(err)
  1613  	}
  1614  	ret := &GoogleSecuritySafebrowsingV4FindFullHashesResponse{
  1615  		ServerResponse: googleapi.ServerResponse{
  1616  			Header:         res.Header,
  1617  			HTTPStatusCode: res.StatusCode,
  1618  		},
  1619  	}
  1620  	target := &ret
  1621  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1622  		return nil, err
  1623  	}
  1624  	return ret, nil
  1625  }
  1626  
  1627  type ThreatHitsCreateCall struct {
  1628  	s                                     *Service
  1629  	googlesecuritysafebrowsingv4threathit *GoogleSecuritySafebrowsingV4ThreatHit
  1630  	urlParams_                            gensupport.URLParams
  1631  	ctx_                                  context.Context
  1632  	header_                               http.Header
  1633  }
  1634  
  1635  // Create: Reports a Safe Browsing threat list hit to Google. Only projects
  1636  // with TRUSTED_REPORTER visibility can use this method.
  1637  func (r *ThreatHitsService) Create(googlesecuritysafebrowsingv4threathit *GoogleSecuritySafebrowsingV4ThreatHit) *ThreatHitsCreateCall {
  1638  	c := &ThreatHitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1639  	c.googlesecuritysafebrowsingv4threathit = googlesecuritysafebrowsingv4threathit
  1640  	return c
  1641  }
  1642  
  1643  // Fields allows partial responses to be retrieved. See
  1644  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1645  // details.
  1646  func (c *ThreatHitsCreateCall) Fields(s ...googleapi.Field) *ThreatHitsCreateCall {
  1647  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1648  	return c
  1649  }
  1650  
  1651  // Context sets the context to be used in this call's Do method.
  1652  func (c *ThreatHitsCreateCall) Context(ctx context.Context) *ThreatHitsCreateCall {
  1653  	c.ctx_ = ctx
  1654  	return c
  1655  }
  1656  
  1657  // Header returns a http.Header that can be modified by the caller to add
  1658  // headers to the request.
  1659  func (c *ThreatHitsCreateCall) Header() http.Header {
  1660  	if c.header_ == nil {
  1661  		c.header_ = make(http.Header)
  1662  	}
  1663  	return c.header_
  1664  }
  1665  
  1666  func (c *ThreatHitsCreateCall) doRequest(alt string) (*http.Response, error) {
  1667  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1668  	var body io.Reader = nil
  1669  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4threathit)
  1670  	if err != nil {
  1671  		return nil, err
  1672  	}
  1673  	c.urlParams_.Set("alt", alt)
  1674  	c.urlParams_.Set("prettyPrint", "false")
  1675  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/threatHits")
  1676  	urls += "?" + c.urlParams_.Encode()
  1677  	req, err := http.NewRequest("POST", urls, body)
  1678  	if err != nil {
  1679  		return nil, err
  1680  	}
  1681  	req.Header = reqHeaders
  1682  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1683  }
  1684  
  1685  // Do executes the "safebrowsing.threatHits.create" call.
  1686  // Any non-2xx status code is an error. Response headers are in either
  1687  // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
  1688  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1689  // check whether the returned error was because http.StatusNotModified was
  1690  // returned.
  1691  func (c *ThreatHitsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  1692  	gensupport.SetOptions(c.urlParams_, opts...)
  1693  	res, err := c.doRequest("json")
  1694  	if res != nil && res.StatusCode == http.StatusNotModified {
  1695  		if res.Body != nil {
  1696  			res.Body.Close()
  1697  		}
  1698  		return nil, gensupport.WrapError(&googleapi.Error{
  1699  			Code:   res.StatusCode,
  1700  			Header: res.Header,
  1701  		})
  1702  	}
  1703  	if err != nil {
  1704  		return nil, err
  1705  	}
  1706  	defer googleapi.CloseBody(res)
  1707  	if err := googleapi.CheckResponse(res); err != nil {
  1708  		return nil, gensupport.WrapError(err)
  1709  	}
  1710  	ret := &GoogleProtobufEmpty{
  1711  		ServerResponse: googleapi.ServerResponse{
  1712  			Header:         res.Header,
  1713  			HTTPStatusCode: res.StatusCode,
  1714  		},
  1715  	}
  1716  	target := &ret
  1717  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1718  		return nil, err
  1719  	}
  1720  	return ret, nil
  1721  }
  1722  
  1723  type ThreatListUpdatesFetchCall struct {
  1724  	s                                                         *Service
  1725  	googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest
  1726  	urlParams_                                                gensupport.URLParams
  1727  	ctx_                                                      context.Context
  1728  	header_                                                   http.Header
  1729  }
  1730  
  1731  // Fetch: Fetches the most recent threat list updates. A client can request
  1732  // updates for multiple lists at once.
  1733  func (r *ThreatListUpdatesService) Fetch(googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest) *ThreatListUpdatesFetchCall {
  1734  	c := &ThreatListUpdatesFetchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1735  	c.googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest = googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest
  1736  	return c
  1737  }
  1738  
  1739  // Fields allows partial responses to be retrieved. See
  1740  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1741  // details.
  1742  func (c *ThreatListUpdatesFetchCall) Fields(s ...googleapi.Field) *ThreatListUpdatesFetchCall {
  1743  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1744  	return c
  1745  }
  1746  
  1747  // Context sets the context to be used in this call's Do method.
  1748  func (c *ThreatListUpdatesFetchCall) Context(ctx context.Context) *ThreatListUpdatesFetchCall {
  1749  	c.ctx_ = ctx
  1750  	return c
  1751  }
  1752  
  1753  // Header returns a http.Header that can be modified by the caller to add
  1754  // headers to the request.
  1755  func (c *ThreatListUpdatesFetchCall) Header() http.Header {
  1756  	if c.header_ == nil {
  1757  		c.header_ = make(http.Header)
  1758  	}
  1759  	return c.header_
  1760  }
  1761  
  1762  func (c *ThreatListUpdatesFetchCall) doRequest(alt string) (*http.Response, error) {
  1763  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1764  	var body io.Reader = nil
  1765  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest)
  1766  	if err != nil {
  1767  		return nil, err
  1768  	}
  1769  	c.urlParams_.Set("alt", alt)
  1770  	c.urlParams_.Set("prettyPrint", "false")
  1771  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/threatListUpdates:fetch")
  1772  	urls += "?" + c.urlParams_.Encode()
  1773  	req, err := http.NewRequest("POST", urls, body)
  1774  	if err != nil {
  1775  		return nil, err
  1776  	}
  1777  	req.Header = reqHeaders
  1778  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1779  }
  1780  
  1781  // Do executes the "safebrowsing.threatListUpdates.fetch" call.
  1782  // Any non-2xx status code is an error. Response headers are in either
  1783  // *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse.ServerResponse.He
  1784  // ader or (if a response was returned at all) in
  1785  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1786  // whether the returned error was because http.StatusNotModified was returned.
  1787  func (c *ThreatListUpdatesFetchCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse, error) {
  1788  	gensupport.SetOptions(c.urlParams_, opts...)
  1789  	res, err := c.doRequest("json")
  1790  	if res != nil && res.StatusCode == http.StatusNotModified {
  1791  		if res.Body != nil {
  1792  			res.Body.Close()
  1793  		}
  1794  		return nil, gensupport.WrapError(&googleapi.Error{
  1795  			Code:   res.StatusCode,
  1796  			Header: res.Header,
  1797  		})
  1798  	}
  1799  	if err != nil {
  1800  		return nil, err
  1801  	}
  1802  	defer googleapi.CloseBody(res)
  1803  	if err := googleapi.CheckResponse(res); err != nil {
  1804  		return nil, gensupport.WrapError(err)
  1805  	}
  1806  	ret := &GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse{
  1807  		ServerResponse: googleapi.ServerResponse{
  1808  			Header:         res.Header,
  1809  			HTTPStatusCode: res.StatusCode,
  1810  		},
  1811  	}
  1812  	target := &ret
  1813  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1814  		return nil, err
  1815  	}
  1816  	return ret, nil
  1817  }
  1818  
  1819  type ThreatListsListCall struct {
  1820  	s            *Service
  1821  	urlParams_   gensupport.URLParams
  1822  	ifNoneMatch_ string
  1823  	ctx_         context.Context
  1824  	header_      http.Header
  1825  }
  1826  
  1827  // List: Lists the Safe Browsing threat lists available for download.
  1828  func (r *ThreatListsService) List() *ThreatListsListCall {
  1829  	c := &ThreatListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1830  	return c
  1831  }
  1832  
  1833  // Fields allows partial responses to be retrieved. See
  1834  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1835  // details.
  1836  func (c *ThreatListsListCall) Fields(s ...googleapi.Field) *ThreatListsListCall {
  1837  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1838  	return c
  1839  }
  1840  
  1841  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1842  // object's ETag matches the given value. This is useful for getting updates
  1843  // only after the object has changed since the last request.
  1844  func (c *ThreatListsListCall) IfNoneMatch(entityTag string) *ThreatListsListCall {
  1845  	c.ifNoneMatch_ = entityTag
  1846  	return c
  1847  }
  1848  
  1849  // Context sets the context to be used in this call's Do method.
  1850  func (c *ThreatListsListCall) Context(ctx context.Context) *ThreatListsListCall {
  1851  	c.ctx_ = ctx
  1852  	return c
  1853  }
  1854  
  1855  // Header returns a http.Header that can be modified by the caller to add
  1856  // headers to the request.
  1857  func (c *ThreatListsListCall) Header() http.Header {
  1858  	if c.header_ == nil {
  1859  		c.header_ = make(http.Header)
  1860  	}
  1861  	return c.header_
  1862  }
  1863  
  1864  func (c *ThreatListsListCall) doRequest(alt string) (*http.Response, error) {
  1865  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1866  	if c.ifNoneMatch_ != "" {
  1867  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1868  	}
  1869  	var body io.Reader = nil
  1870  	c.urlParams_.Set("alt", alt)
  1871  	c.urlParams_.Set("prettyPrint", "false")
  1872  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/threatLists")
  1873  	urls += "?" + c.urlParams_.Encode()
  1874  	req, err := http.NewRequest("GET", urls, body)
  1875  	if err != nil {
  1876  		return nil, err
  1877  	}
  1878  	req.Header = reqHeaders
  1879  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1880  }
  1881  
  1882  // Do executes the "safebrowsing.threatLists.list" call.
  1883  // Any non-2xx status code is an error. Response headers are in either
  1884  // *GoogleSecuritySafebrowsingV4ListThreatListsResponse.ServerResponse.Header
  1885  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  1886  // Use googleapi.IsNotModified to check whether the returned error was because
  1887  // http.StatusNotModified was returned.
  1888  func (c *ThreatListsListCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4ListThreatListsResponse, error) {
  1889  	gensupport.SetOptions(c.urlParams_, opts...)
  1890  	res, err := c.doRequest("json")
  1891  	if res != nil && res.StatusCode == http.StatusNotModified {
  1892  		if res.Body != nil {
  1893  			res.Body.Close()
  1894  		}
  1895  		return nil, gensupport.WrapError(&googleapi.Error{
  1896  			Code:   res.StatusCode,
  1897  			Header: res.Header,
  1898  		})
  1899  	}
  1900  	if err != nil {
  1901  		return nil, err
  1902  	}
  1903  	defer googleapi.CloseBody(res)
  1904  	if err := googleapi.CheckResponse(res); err != nil {
  1905  		return nil, gensupport.WrapError(err)
  1906  	}
  1907  	ret := &GoogleSecuritySafebrowsingV4ListThreatListsResponse{
  1908  		ServerResponse: googleapi.ServerResponse{
  1909  			Header:         res.Header,
  1910  			HTTPStatusCode: res.StatusCode,
  1911  		},
  1912  	}
  1913  	target := &ret
  1914  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1915  		return nil, err
  1916  	}
  1917  	return ret, nil
  1918  }
  1919  
  1920  type ThreatMatchesFindCall struct {
  1921  	s                                                    *Service
  1922  	googlesecuritysafebrowsingv4findthreatmatchesrequest *GoogleSecuritySafebrowsingV4FindThreatMatchesRequest
  1923  	urlParams_                                           gensupport.URLParams
  1924  	ctx_                                                 context.Context
  1925  	header_                                              http.Header
  1926  }
  1927  
  1928  // Find: Finds the threat entries that match the Safe Browsing lists.
  1929  func (r *ThreatMatchesService) Find(googlesecuritysafebrowsingv4findthreatmatchesrequest *GoogleSecuritySafebrowsingV4FindThreatMatchesRequest) *ThreatMatchesFindCall {
  1930  	c := &ThreatMatchesFindCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1931  	c.googlesecuritysafebrowsingv4findthreatmatchesrequest = googlesecuritysafebrowsingv4findthreatmatchesrequest
  1932  	return c
  1933  }
  1934  
  1935  // Fields allows partial responses to be retrieved. See
  1936  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1937  // details.
  1938  func (c *ThreatMatchesFindCall) Fields(s ...googleapi.Field) *ThreatMatchesFindCall {
  1939  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1940  	return c
  1941  }
  1942  
  1943  // Context sets the context to be used in this call's Do method.
  1944  func (c *ThreatMatchesFindCall) Context(ctx context.Context) *ThreatMatchesFindCall {
  1945  	c.ctx_ = ctx
  1946  	return c
  1947  }
  1948  
  1949  // Header returns a http.Header that can be modified by the caller to add
  1950  // headers to the request.
  1951  func (c *ThreatMatchesFindCall) Header() http.Header {
  1952  	if c.header_ == nil {
  1953  		c.header_ = make(http.Header)
  1954  	}
  1955  	return c.header_
  1956  }
  1957  
  1958  func (c *ThreatMatchesFindCall) doRequest(alt string) (*http.Response, error) {
  1959  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1960  	var body io.Reader = nil
  1961  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4findthreatmatchesrequest)
  1962  	if err != nil {
  1963  		return nil, err
  1964  	}
  1965  	c.urlParams_.Set("alt", alt)
  1966  	c.urlParams_.Set("prettyPrint", "false")
  1967  	urls := googleapi.ResolveRelative(c.s.BasePath, "v4/threatMatches:find")
  1968  	urls += "?" + c.urlParams_.Encode()
  1969  	req, err := http.NewRequest("POST", urls, body)
  1970  	if err != nil {
  1971  		return nil, err
  1972  	}
  1973  	req.Header = reqHeaders
  1974  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1975  }
  1976  
  1977  // Do executes the "safebrowsing.threatMatches.find" call.
  1978  // Any non-2xx status code is an error. Response headers are in either
  1979  // *GoogleSecuritySafebrowsingV4FindThreatMatchesResponse.ServerResponse.Header
  1980  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  1981  // Use googleapi.IsNotModified to check whether the returned error was because
  1982  // http.StatusNotModified was returned.
  1983  func (c *ThreatMatchesFindCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FindThreatMatchesResponse, error) {
  1984  	gensupport.SetOptions(c.urlParams_, opts...)
  1985  	res, err := c.doRequest("json")
  1986  	if res != nil && res.StatusCode == http.StatusNotModified {
  1987  		if res.Body != nil {
  1988  			res.Body.Close()
  1989  		}
  1990  		return nil, gensupport.WrapError(&googleapi.Error{
  1991  			Code:   res.StatusCode,
  1992  			Header: res.Header,
  1993  		})
  1994  	}
  1995  	if err != nil {
  1996  		return nil, err
  1997  	}
  1998  	defer googleapi.CloseBody(res)
  1999  	if err := googleapi.CheckResponse(res); err != nil {
  2000  		return nil, gensupport.WrapError(err)
  2001  	}
  2002  	ret := &GoogleSecuritySafebrowsingV4FindThreatMatchesResponse{
  2003  		ServerResponse: googleapi.ServerResponse{
  2004  			Header:         res.Header,
  2005  			HTTPStatusCode: res.StatusCode,
  2006  		},
  2007  	}
  2008  	target := &ret
  2009  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2010  		return nil, err
  2011  	}
  2012  	return ret, nil
  2013  }
  2014  

View as plain text