blob: 084710d5fea1afadad3363b82cb87ab926690a83 [file] [log] [blame]
// Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package securitycenter provides access to the Security Command Center API.
//
// For product documentation, see: https://console.cloud.google.com/apis/api/securitycenter.googleapis.com/overview
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/securitycenter/v1beta2"
// ...
// ctx := context.Background()
// securitycenterService, err := securitycenter.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// securitycenterService, err := securitycenter.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// securitycenterService, err := securitycenter.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package securitycenter // import "google.golang.org/api/securitycenter/v1beta2"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "securitycenter:v1beta2"
const apiName = "securitycenter"
const apiVersion = "v1beta2"
const basePath = "https://securitycenter.googleapis.com/"
const mtlsBasePath = "https://securitycenter.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Folders = NewFoldersService(s)
s.Organizations = NewOrganizationsService(s)
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Folders *FoldersService
Organizations *OrganizationsService
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewFoldersService(s *Service) *FoldersService {
rs := &FoldersService{s: s}
rs.ContainerThreatDetectionSettings = NewFoldersContainerThreatDetectionSettingsService(s)
rs.EventThreatDetectionSettings = NewFoldersEventThreatDetectionSettingsService(s)
rs.SecurityHealthAnalyticsSettings = NewFoldersSecurityHealthAnalyticsSettingsService(s)
rs.WebSecurityScannerSettings = NewFoldersWebSecurityScannerSettingsService(s)
return rs
}
type FoldersService struct {
s *Service
ContainerThreatDetectionSettings *FoldersContainerThreatDetectionSettingsService
EventThreatDetectionSettings *FoldersEventThreatDetectionSettingsService
SecurityHealthAnalyticsSettings *FoldersSecurityHealthAnalyticsSettingsService
WebSecurityScannerSettings *FoldersWebSecurityScannerSettingsService
}
func NewFoldersContainerThreatDetectionSettingsService(s *Service) *FoldersContainerThreatDetectionSettingsService {
rs := &FoldersContainerThreatDetectionSettingsService{s: s}
return rs
}
type FoldersContainerThreatDetectionSettingsService struct {
s *Service
}
func NewFoldersEventThreatDetectionSettingsService(s *Service) *FoldersEventThreatDetectionSettingsService {
rs := &FoldersEventThreatDetectionSettingsService{s: s}
return rs
}
type FoldersEventThreatDetectionSettingsService struct {
s *Service
}
func NewFoldersSecurityHealthAnalyticsSettingsService(s *Service) *FoldersSecurityHealthAnalyticsSettingsService {
rs := &FoldersSecurityHealthAnalyticsSettingsService{s: s}
return rs
}
type FoldersSecurityHealthAnalyticsSettingsService struct {
s *Service
}
func NewFoldersWebSecurityScannerSettingsService(s *Service) *FoldersWebSecurityScannerSettingsService {
rs := &FoldersWebSecurityScannerSettingsService{s: s}
return rs
}
type FoldersWebSecurityScannerSettingsService struct {
s *Service
}
func NewOrganizationsService(s *Service) *OrganizationsService {
rs := &OrganizationsService{s: s}
rs.ContainerThreatDetectionSettings = NewOrganizationsContainerThreatDetectionSettingsService(s)
rs.EventThreatDetectionSettings = NewOrganizationsEventThreatDetectionSettingsService(s)
rs.SecurityHealthAnalyticsSettings = NewOrganizationsSecurityHealthAnalyticsSettingsService(s)
rs.WebSecurityScannerSettings = NewOrganizationsWebSecurityScannerSettingsService(s)
return rs
}
type OrganizationsService struct {
s *Service
ContainerThreatDetectionSettings *OrganizationsContainerThreatDetectionSettingsService
EventThreatDetectionSettings *OrganizationsEventThreatDetectionSettingsService
SecurityHealthAnalyticsSettings *OrganizationsSecurityHealthAnalyticsSettingsService
WebSecurityScannerSettings *OrganizationsWebSecurityScannerSettingsService
}
func NewOrganizationsContainerThreatDetectionSettingsService(s *Service) *OrganizationsContainerThreatDetectionSettingsService {
rs := &OrganizationsContainerThreatDetectionSettingsService{s: s}
return rs
}
type OrganizationsContainerThreatDetectionSettingsService struct {
s *Service
}
func NewOrganizationsEventThreatDetectionSettingsService(s *Service) *OrganizationsEventThreatDetectionSettingsService {
rs := &OrganizationsEventThreatDetectionSettingsService{s: s}
return rs
}
type OrganizationsEventThreatDetectionSettingsService struct {
s *Service
}
func NewOrganizationsSecurityHealthAnalyticsSettingsService(s *Service) *OrganizationsSecurityHealthAnalyticsSettingsService {
rs := &OrganizationsSecurityHealthAnalyticsSettingsService{s: s}
return rs
}
type OrganizationsSecurityHealthAnalyticsSettingsService struct {
s *Service
}
func NewOrganizationsWebSecurityScannerSettingsService(s *Service) *OrganizationsWebSecurityScannerSettingsService {
rs := &OrganizationsWebSecurityScannerSettingsService{s: s}
return rs
}
type OrganizationsWebSecurityScannerSettingsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.ContainerThreatDetectionSettings = NewProjectsContainerThreatDetectionSettingsService(s)
rs.EventThreatDetectionSettings = NewProjectsEventThreatDetectionSettingsService(s)
rs.Locations = NewProjectsLocationsService(s)
rs.SecurityHealthAnalyticsSettings = NewProjectsSecurityHealthAnalyticsSettingsService(s)
rs.WebSecurityScannerSettings = NewProjectsWebSecurityScannerSettingsService(s)
return rs
}
type ProjectsService struct {
s *Service
ContainerThreatDetectionSettings *ProjectsContainerThreatDetectionSettingsService
EventThreatDetectionSettings *ProjectsEventThreatDetectionSettingsService
Locations *ProjectsLocationsService
SecurityHealthAnalyticsSettings *ProjectsSecurityHealthAnalyticsSettingsService
WebSecurityScannerSettings *ProjectsWebSecurityScannerSettingsService
}
func NewProjectsContainerThreatDetectionSettingsService(s *Service) *ProjectsContainerThreatDetectionSettingsService {
rs := &ProjectsContainerThreatDetectionSettingsService{s: s}
return rs
}
type ProjectsContainerThreatDetectionSettingsService struct {
s *Service
}
func NewProjectsEventThreatDetectionSettingsService(s *Service) *ProjectsEventThreatDetectionSettingsService {
rs := &ProjectsEventThreatDetectionSettingsService{s: s}
return rs
}
type ProjectsEventThreatDetectionSettingsService struct {
s *Service
}
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.Clusters = NewProjectsLocationsClustersService(s)
return rs
}
type ProjectsLocationsService struct {
s *Service
Clusters *ProjectsLocationsClustersService
}
func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService {
rs := &ProjectsLocationsClustersService{s: s}
rs.ContainerThreatDetectionSettings = NewProjectsLocationsClustersContainerThreatDetectionSettingsService(s)
return rs
}
type ProjectsLocationsClustersService struct {
s *Service
ContainerThreatDetectionSettings *ProjectsLocationsClustersContainerThreatDetectionSettingsService
}
func NewProjectsLocationsClustersContainerThreatDetectionSettingsService(s *Service) *ProjectsLocationsClustersContainerThreatDetectionSettingsService {
rs := &ProjectsLocationsClustersContainerThreatDetectionSettingsService{s: s}
return rs
}
type ProjectsLocationsClustersContainerThreatDetectionSettingsService struct {
s *Service
}
func NewProjectsSecurityHealthAnalyticsSettingsService(s *Service) *ProjectsSecurityHealthAnalyticsSettingsService {
rs := &ProjectsSecurityHealthAnalyticsSettingsService{s: s}
return rs
}
type ProjectsSecurityHealthAnalyticsSettingsService struct {
s *Service
}
func NewProjectsWebSecurityScannerSettingsService(s *Service) *ProjectsWebSecurityScannerSettingsService {
rs := &ProjectsWebSecurityScannerSettingsService{s: s}
return rs
}
type ProjectsWebSecurityScannerSettingsService struct {
s *Service
}
// Config: Configuration of a module.
type Config struct {
// ModuleEnablementState: The state of enablement for the module at its
// level of the resource hierarchy.
//
// Possible values:
// "ENABLEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "INHERITED" - State is inherited from the parent resource.
// "ENABLED" - State is enabled.
// "DISABLED" - State is disabled.
ModuleEnablementState string `json:"moduleEnablementState,omitempty"`
// Value: The configuration value for the module. The absence of this
// field implies its inheritance from the parent.
Value googleapi.RawMessage `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ModuleEnablementState") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ModuleEnablementState") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Config) MarshalJSON() ([]byte, error) {
type NoMethod Config
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ContainerThreatDetectionSettings: Resource capturing the settings for
// the Container Threat Detection service.
type ContainerThreatDetectionSettings struct {
// Modules: The configurations including the state of enablement for the
// service's different modules. The absence of a module in the map
// implies its configuration is inherited from its parent's.
Modules map[string]Config `json:"modules,omitempty"`
// Name: The resource name of the ContainerThreatDetectionSettings.
// Formats: *
// organizations/{organization}/containerThreatDetectionSettings *
// folders/{folder}/containerThreatDetectionSettings *
// projects/{project}/containerThreatDetectionSettings *
// projects/{project}/locations/{location}/clusters/{cluster}/containerTh
// reatDetectionSettings
Name string `json:"name,omitempty"`
// ServiceAccount: Output only. The service account used by Container
// Threat Detection for scanning. Service accounts are scoped at the
// project level meaning this field will be empty at any level above a
// project.
ServiceAccount string `json:"serviceAccount,omitempty"`
// ServiceEnablementState: The state of enablement for the service at
// its level of the resource hierarchy. A DISABLED state will override
// all module enablement_states to DISABLED.
//
// Possible values:
// "ENABLEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "INHERITED" - State is inherited from the parent resource.
// "ENABLED" - State is enabled.
// "DISABLED" - State is disabled.
ServiceEnablementState string `json:"serviceEnablementState,omitempty"`
// UpdateTime: Output only. The time the settings were last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Modules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Modules") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ContainerThreatDetectionSettings) MarshalJSON() ([]byte, error) {
type NoMethod ContainerThreatDetectionSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Details: Details of a subscription.
type Details struct {
// EndTime: The time the subscription has or will end.
EndTime string `json:"endTime,omitempty"`
// StartTime: The time the subscription has or will start.
StartTime string `json:"startTime,omitempty"`
// Type: The type of subscription
//
// Possible values:
// "TYPE_UNSPECIFIED" - Default value. This value is unused.
// "STANDARD" - The standard subscription.
// "TRIAL" - The trial subscription.
// "ALPHA" - The alpha subscription.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EndTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Details) MarshalJSON() ([]byte, error) {
type NoMethod Details
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// EventThreatDetectionSettings: Resource capturing the settings for the
// Event Threat Detection service.
type EventThreatDetectionSettings struct {
// Modules: The configurations including the state of enablement for the
// service's different modules. The absence of a module in the map
// implies its configuration is inherited from its parent's.
Modules map[string]Config `json:"modules,omitempty"`
// Name: The resource name of the EventThreatDetectionSettings. Formats:
// * organizations/{organization}/eventThreatDetectionSettings *
// folders/{folder}/eventThreatDetectionSettings *
// projects/{project}/eventThreatDetectionSettings
Name string `json:"name,omitempty"`
// ServiceEnablementState: The state of enablement for the service at
// its level of the resource hierarchy. A DISABLED state will override
// all module enablement_states to DISABLED.
//
// Possible values:
// "ENABLEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "INHERITED" - State is inherited from the parent resource.
// "ENABLED" - State is enabled.
// "DISABLED" - State is disabled.
ServiceEnablementState string `json:"serviceEnablementState,omitempty"`
// UpdateTime: Output only. The time the settings were last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Modules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Modules") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EventThreatDetectionSettings) MarshalJSON() ([]byte, error) {
type NoMethod EventThreatDetectionSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Finding: Security Command Center finding. A finding is a record of
// assessment data like security, risk, health, or privacy, that is
// ingested into Security Command Center for presentation, notification,
// analysis, policy testing, and enforcement. For example, a cross-site
// scripting (XSS) vulnerability in an App Engine application is a
// finding.
type Finding struct {
// Category: The additional taxonomy group within findings from a given
// source. This field is immutable after creation time. Example:
// "XSS_FLASH_INJECTION"
Category string `json:"category,omitempty"`
// CreateTime: The time at which the finding was created in Security
// Command Center.
CreateTime string `json:"createTime,omitempty"`
// EventTime: The time at which the event took place, or when an update
// to the finding occurred. For example, if the finding represents an
// open firewall it would capture the time the detector believes the
// firewall became open. The accuracy is determined by the detector. If
// the finding were to be resolved afterward, this time would reflect
// when the finding was resolved.
EventTime string `json:"eventTime,omitempty"`
// ExternalUri: The URI that, if available, points to a web page outside
// of Security Command Center where additional information about the
// finding can be found. This field is guaranteed to be either empty or
// a well formed URL.
ExternalUri string `json:"externalUri,omitempty"`
// Name: The relative resource name of this finding. See:
// https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
// "organizations/{organization_id}/sources/{source_id}/findings/{finding
// _id}"
Name string `json:"name,omitempty"`
// Parent: The relative resource name of the source the finding belongs
// to. See:
// https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example:
// "organizations/{organization_id}/sources/{source_id}"
Parent string `json:"parent,omitempty"`
// ResourceName: For findings on Google Cloud resources, the full
// resource name of the Google Cloud resource this finding is for. See:
// https://cloud.google.com/apis/design/resource_names#full_resource_name When the finding is for a non-Google Cloud resource, the resourceName can be a customer or partner defined string. This field is immutable after creation
// time.
ResourceName string `json:"resourceName,omitempty"`
// SecurityMarks: Output only. User specified security marks. These
// marks are entirely managed by the user and come from the
// SecurityMarks resource that belongs to the finding.
SecurityMarks *SecurityMarks `json:"securityMarks,omitempty"`
// SourceProperties: Source specific properties. These properties are
// managed by the source that writes the finding. The key names in the
// source_properties map must be between 1 and 255 characters, and must
// start with a letter and contain alphanumeric characters or
// underscores only.
SourceProperties googleapi.RawMessage `json:"sourceProperties,omitempty"`
// State: The state of the finding.
//
// Possible values:
// "STATE_UNSPECIFIED" - Unspecified state.
// "ACTIVE" - The finding requires attention and has not been
// addressed yet.
// "INACTIVE" - The finding has been fixed, triaged as a non-issue or
// otherwise addressed and is no longer active.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "Category") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Category") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Finding) MarshalJSON() ([]byte, error) {
type NoMethod Finding
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1NotificationMessage: Cloud SCC's
// Notification
type GoogleCloudSecuritycenterV1NotificationMessage struct {
// Finding: If it's a Finding based notification config, this field will
// be populated.
Finding *Finding `json:"finding,omitempty"`
// NotificationConfigName: Name of the notification config that
// generated current notification.
NotificationConfigName string `json:"notificationConfigName,omitempty"`
// Resource: The Cloud resource tied to this notification's Finding.
Resource *GoogleCloudSecuritycenterV1Resource `json:"resource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Finding") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Finding") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1NotificationMessage) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1NotificationMessage
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1Resource: Information related to the
// Google Cloud resource.
type GoogleCloudSecuritycenterV1Resource struct {
// Name: The full resource name of the resource. See:
// https://cloud.google.com/apis/design/resource_names#full_resource_name
Name string `json:"name,omitempty"`
// Parent: The full resource name of resource's parent.
Parent string `json:"parent,omitempty"`
// ParentDisplayName: The human readable name of resource's parent.
ParentDisplayName string `json:"parentDisplayName,omitempty"`
// Project: The full resource name of project that the resource belongs
// to.
Project string `json:"project,omitempty"`
// ProjectDisplayName: The human readable name of project that the
// resource belongs to.
ProjectDisplayName string `json:"projectDisplayName,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1Resource) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1Resource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse: Response of
// asset discovery run
type GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse struct {
// Duration: The duration between asset discovery run start and end
Duration string `json:"duration,omitempty"`
// State: The state of an asset discovery run.
//
// Possible values:
// "STATE_UNSPECIFIED" - Asset discovery run state was unspecified.
// "COMPLETED" - Asset discovery run completed successfully.
// "SUPERSEDED" - Asset discovery run was cancelled with tasks still
// pending, as another run for the same organization was started with a
// higher priority.
// "TERMINATED" - Asset discovery run was killed and terminated.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "Duration") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Duration") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse: Response
// of asset discovery run
type GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse struct {
// Duration: The duration between asset discovery run start and end
Duration string `json:"duration,omitempty"`
// State: The state of an asset discovery run.
//
// Possible values:
// "STATE_UNSPECIFIED" - Asset discovery run state was unspecified.
// "COMPLETED" - Asset discovery run completed successfully.
// "SUPERSEDED" - Asset discovery run was cancelled with tasks still
// pending, as another run for the same organization was started with a
// higher priority.
// "TERMINATED" - Asset discovery run was killed and terminated.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "Duration") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Duration") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1p1beta1Finding: Security Command Center
// finding. A finding is a record of assessment data (security, risk,
// health or privacy) ingested into Security Command Center for
// presentation, notification, analysis, policy testing, and
// enforcement. For example, an XSS vulnerability in an App Engine
// application is a finding.
type GoogleCloudSecuritycenterV1p1beta1Finding struct {
// Category: The additional taxonomy group within findings from a given
// source. This field is immutable after creation time. Example:
// "XSS_FLASH_INJECTION"
Category string `json:"category,omitempty"`
// CreateTime: The time at which the finding was created in Security
// Command Center.
CreateTime string `json:"createTime,omitempty"`
// EventTime: The time at which the event took place, or when an update
// to the finding occurred. For example, if the finding represents an
// open firewall it would capture the time the detector believes the
// firewall became open. The accuracy is determined by the detector. If
// the finding were to be resolved afterward, this time would reflect
// when the finding was resolved.
EventTime string `json:"eventTime,omitempty"`
// ExternalUri: The URI that, if available, points to a web page outside
// of Security Command Center where additional information about the
// finding can be found. This field is guaranteed to be either empty or
// a well formed URL.
ExternalUri string `json:"externalUri,omitempty"`
// Name: The relative resource name of this finding. See:
// https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
// "organizations/{organization_id}/sources/{source_id}/findings/{finding
// _id}"
Name string `json:"name,omitempty"`
// Parent: The relative resource name of the source the finding belongs
// to. See:
// https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example:
// "organizations/{organization_id}/sources/{source_id}"
Parent string `json:"parent,omitempty"`
// ResourceName: For findings on Google Cloud resources, the full
// resource name of the Google Cloud resource this finding is for. See:
// https://cloud.google.com/apis/design/resource_names#full_resource_name When the finding is for a non-Google Cloud resource, the resourceName can be a customer or partner defined string. This field is immutable after creation
// time.
ResourceName string `json:"resourceName,omitempty"`
// SecurityMarks: Output only. User specified security marks. These
// marks are entirely managed by the user and come from the
// SecurityMarks resource that belongs to the finding.
SecurityMarks *GoogleCloudSecuritycenterV1p1beta1SecurityMarks `json:"securityMarks,omitempty"`
// Severity: The severity of the finding. This field is managed by the
// source that writes the finding.
//
// Possible values:
// "SEVERITY_UNSPECIFIED" - No severity specified. The default value.
// "CRITICAL" - Critical severity.
// "HIGH" - High severity.
// "MEDIUM" - Medium severity.
// "LOW" - Low severity.
Severity string `json:"severity,omitempty"`
// SourceProperties: Source specific properties. These properties are
// managed by the source that writes the finding. The key names in the
// source_properties map must be between 1 and 255 characters, and must
// start with a letter and contain alphanumeric characters or
// underscores only.
SourceProperties googleapi.RawMessage `json:"sourceProperties,omitempty"`
// State: The state of the finding.
//
// Possible values:
// "STATE_UNSPECIFIED" - Unspecified state.
// "ACTIVE" - The finding requires attention and has not been
// addressed yet.
// "INACTIVE" - The finding has been fixed, triaged as a non-issue or
// otherwise addressed and is no longer active.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "Category") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Category") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1p1beta1Finding) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1p1beta1Finding
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1p1beta1NotificationMessage: Security
// Command Center's Notification
type GoogleCloudSecuritycenterV1p1beta1NotificationMessage struct {
// Finding: If it's a Finding based notification config, this field will
// be populated.
Finding *GoogleCloudSecuritycenterV1p1beta1Finding `json:"finding,omitempty"`
// NotificationConfigName: Name of the notification config that
// generated current notification.
NotificationConfigName string `json:"notificationConfigName,omitempty"`
// Resource: The Cloud resource tied to the notification.
Resource *GoogleCloudSecuritycenterV1p1beta1Resource `json:"resource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Finding") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Finding") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1p1beta1NotificationMessage) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1p1beta1NotificationMessage
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1p1beta1Resource: Information related to
// the Google Cloud resource.
type GoogleCloudSecuritycenterV1p1beta1Resource struct {
// Name: The full resource name of the resource. See:
// https://cloud.google.com/apis/design/resource_names#full_resource_name
Name string `json:"name,omitempty"`
// Parent: The full resource name of resource's parent.
Parent string `json:"parent,omitempty"`
// ParentDisplayName: The human readable name of resource's parent.
ParentDisplayName string `json:"parentDisplayName,omitempty"`
// Project: The full resource name of project that the resource belongs
// to.
Project string `json:"project,omitempty"`
// ProjectDisplayName: The human readable name of project that the
// resource belongs to.
ProjectDisplayName string `json:"projectDisplayName,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1p1beta1Resource) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1p1beta1Resource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse: Response
// of asset discovery run
type GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse struct {
// Duration: The duration between asset discovery run start and end
Duration string `json:"duration,omitempty"`
// State: The state of an asset discovery run.
//
// Possible values:
// "STATE_UNSPECIFIED" - Asset discovery run state was unspecified.
// "COMPLETED" - Asset discovery run completed successfully.
// "SUPERSEDED" - Asset discovery run was cancelled with tasks still
// pending, as another run for the same organization was started with a
// higher priority.
// "TERMINATED" - Asset discovery run was killed and terminated.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "Duration") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Duration") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSecuritycenterV1p1beta1SecurityMarks: User specified
// security marks that are attached to the parent Security Command
// Center resource. Security marks are scoped within a Security Command
// Center organization -- they can be modified and viewed by all users
// who have proper permissions on the organization.
type GoogleCloudSecuritycenterV1p1beta1SecurityMarks struct {
// Marks: Mutable user specified security marks belonging to the parent
// resource. Constraints are as follows: * Keys and values are treated
// as case insensitive * Keys must be between 1 - 256 characters
// (inclusive) * Keys must be letters, numbers, underscores, or dashes *
// Values have leading and trailing whitespace trimmed, remaining
// characters must be between 1 - 4096 characters (inclusive)
Marks map[string]string `json:"marks,omitempty"`
// Name: The relative resource name of the SecurityMarks. See:
// https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks"
// "organizations/{organization_id}/sources/{source_id}/findings/{finding
// _id}/securityMarks".
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Marks") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Marks") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudSecuritycenterV1p1beta1SecurityMarks) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSecuritycenterV1p1beta1SecurityMarks
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SecurityCenterSettings: Resource capturing the settings for Security
// Center.
type SecurityCenterSettings struct {
// LogSinkProject: The resource name of the project to send logs to.
// This project must be part of the organization this resource resides
// in. The format is `projects/{project_id}`. An empty value disables
// logging. This value is only referenced by services that support log
// sink. Please refer to the documentation for an updated list of
// compatible services.
LogSinkProject string `json:"logSinkProject,omitempty"`
// Name: The resource name of the SecurityCenterSettings. Format:
// organizations/{organization}/securityCenterSettings
Name string `json:"name,omitempty"`
// OrgServiceAccount: The organization level service account to be used
// for security center components.
OrgServiceAccount string `json:"orgServiceAccount,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "LogSinkProject") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LogSinkProject") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SecurityCenterSettings) MarshalJSON() ([]byte, error) {
type NoMethod SecurityCenterSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SecurityHealthAnalyticsSettings: Resource capturing the settings for
// the Security Health Analytics service.
type SecurityHealthAnalyticsSettings struct {
// Modules: The configurations including the state of enablement for the
// service's different modules. The absence of a module in the map
// implies its configuration is inherited from its parent's.
Modules map[string]Config `json:"modules,omitempty"`
// Name: The resource name of the SecurityHealthAnalyticsSettings.
// Formats: *
// organizations/{organization}/securityHealthAnalyticsSettings *
// folders/{folder}/securityHealthAnalyticsSettings *
// projects/{project}/securityHealthAnalyticsSettings
Name string `json:"name,omitempty"`
// ServiceAccount: Output only. The service account used by Security
// Health Analytics detectors.
ServiceAccount string `json:"serviceAccount,omitempty"`
// ServiceEnablementState: The state of enablement for the service at
// its level of the resource hierarchy. A DISABLED state will override
// all module enablement_states to DISABLED.
//
// Possible values:
// "ENABLEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "INHERITED" - State is inherited from the parent resource.
// "ENABLED" - State is enabled.
// "DISABLED" - State is disabled.
ServiceEnablementState string `json:"serviceEnablementState,omitempty"`
// UpdateTime: Output only. The time the settings were last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Modules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Modules") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SecurityHealthAnalyticsSettings) MarshalJSON() ([]byte, error) {
type NoMethod SecurityHealthAnalyticsSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SecurityMarks: User specified security marks that are attached to the
// parent Security Command Center resource. Security marks are scoped
// within a Security Command Center organization -- they can be modified
// and viewed by all users who have proper permissions on the
// organization.
type SecurityMarks struct {
// Marks: Mutable user specified security marks belonging to the parent
// resource. Constraints are as follows: * Keys and values are treated
// as case insensitive * Keys must be between 1 - 256 characters
// (inclusive) * Keys must be letters, numbers, underscores, or dashes *
// Values have leading and trailing whitespace trimmed, remaining
// characters must be between 1 - 4096 characters (inclusive)
Marks map[string]string `json:"marks,omitempty"`
// Name: The relative resource name of the SecurityMarks. See:
// https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks"
// "organizations/{organization_id}/sources/{source_id}/findings/{finding
// _id}/securityMarks".
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Marks") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Marks") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SecurityMarks) MarshalJSON() ([]byte, error) {
type NoMethod SecurityMarks
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Subscription: Resource capturing the state of an organization's
// subscription.
type Subscription struct {
// Details: The details of the most recent active subscription. If there
// has never been a subscription this will be empty.
Details *Details `json:"details,omitempty"`
// Name: The resource name of the subscription. Format:
// organizations/{organization}/subscription
Name string `json:"name,omitempty"`
// Tier: The tier of SCC features this organization currently has access
// to.
//
// Possible values:
// "TIER_UNSPECIFIED" - Default value. This value is unused.
// "STANDARD" - The standard tier.
// "PREMIUM" - The premium tier.
Tier string `json:"tier,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Details") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Details") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Subscription) MarshalJSON() ([]byte, error) {
type NoMethod Subscription
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// WebSecurityScannerSettings: Resource capturing the settings for the
// Web Security Scanner service.
type WebSecurityScannerSettings struct {
// Modules: The configurations including the state of enablement for the
// service's different modules. The absence of a module in the map
// implies its configuration is inherited from its parent's.
Modules map[string]Config `json:"modules,omitempty"`
// Name: The resource name of the WebSecurityScannerSettings. Formats: *
// organizations/{organization}/webSecurityScannerSettings *
// folders/{folder}/webSecurityScannerSettings *
// projects/{project}/webSecurityScannerSettings
Name string `json:"name,omitempty"`
// ServiceEnablementState: The state of enablement for the service at
// its level of the resource hierarchy. A DISABLED state will override
// all module enablement_states to DISABLED.
//
// Possible values:
// "ENABLEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "INHERITED" - State is inherited from the parent resource.
// "ENABLED" - State is enabled.
// "DISABLED" - State is disabled.
ServiceEnablementState string `json:"serviceEnablementState,omitempty"`
// UpdateTime: Output only. The time the settings were last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Modules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Modules") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *WebSecurityScannerSettings) MarshalJSON() ([]byte, error) {
type NoMethod WebSecurityScannerSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "securitycenter.folders.getContainerThreatDetectionSettings":
type FoldersGetContainerThreatDetectionSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetContainerThreatDetectionSettings: Get the
// ContainerThreatDetectionSettings resource.
func (r *FoldersService) GetContainerThreatDetectionSettings(name string) *FoldersGetContainerThreatDetectionSettingsCall {
c := &FoldersGetContainerThreatDetectionSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersGetContainerThreatDetectionSettingsCall) Fields(s ...googleapi.Field) *FoldersGetContainerThreatDetectionSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersGetContainerThreatDetectionSettingsCall) IfNoneMatch(entityTag string) *FoldersGetContainerThreatDetectionSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersGetContainerThreatDetectionSettingsCall) Context(ctx context.Context) *FoldersGetContainerThreatDetectionSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersGetContainerThreatDetectionSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersGetContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.getContainerThreatDetectionSettings" call.
// Exactly one of *ContainerThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ContainerThreatDetectionSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersGetContainerThreatDetectionSettingsCall) Do(opts ...googleapi.CallOption) (*ContainerThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ContainerThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the ContainerThreatDetectionSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/containerThreatDetectionSettings",
// "httpMethod": "GET",
// "id": "securitycenter.folders.getContainerThreatDetectionSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the ContainerThreatDetectionSettings to retrieve. Formats: * organizations/{organization}/containerThreatDetectionSettings * folders/{folder}/containerThreatDetectionSettings * projects/{project}/containerThreatDetectionSettings * projects/{project}/locations/{location}/clusters/{cluster}/containerThreatDetectionSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/containerThreatDetectionSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "ContainerThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.getEventThreatDetectionSettings":
type FoldersGetEventThreatDetectionSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetEventThreatDetectionSettings: Get the EventThreatDetectionSettings
// resource.
func (r *FoldersService) GetEventThreatDetectionSettings(name string) *FoldersGetEventThreatDetectionSettingsCall {
c := &FoldersGetEventThreatDetectionSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersGetEventThreatDetectionSettingsCall) Fields(s ...googleapi.Field) *FoldersGetEventThreatDetectionSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersGetEventThreatDetectionSettingsCall) IfNoneMatch(entityTag string) *FoldersGetEventThreatDetectionSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersGetEventThreatDetectionSettingsCall) Context(ctx context.Context) *FoldersGetEventThreatDetectionSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersGetEventThreatDetectionSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersGetEventThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.getEventThreatDetectionSettings" call.
// Exactly one of *EventThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *EventThreatDetectionSettings.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersGetEventThreatDetectionSettingsCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EventThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the EventThreatDetectionSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/eventThreatDetectionSettings",
// "httpMethod": "GET",
// "id": "securitycenter.folders.getEventThreatDetectionSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the EventThreatDetectionSettings to retrieve. Formats: * organizations/{organization}/eventThreatDetectionSettings * folders/{folder}/eventThreatDetectionSettings * projects/{project}/eventThreatDetectionSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/eventThreatDetectionSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "EventThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.getSecurityHealthAnalyticsSettings":
type FoldersGetSecurityHealthAnalyticsSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetSecurityHealthAnalyticsSettings: Get the
// SecurityHealthAnalyticsSettings resource.
func (r *FoldersService) GetSecurityHealthAnalyticsSettings(name string) *FoldersGetSecurityHealthAnalyticsSettingsCall {
c := &FoldersGetSecurityHealthAnalyticsSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) Fields(s ...googleapi.Field) *FoldersGetSecurityHealthAnalyticsSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) IfNoneMatch(entityTag string) *FoldersGetSecurityHealthAnalyticsSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) Context(ctx context.Context) *FoldersGetSecurityHealthAnalyticsSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.getSecurityHealthAnalyticsSettings" call.
// Exactly one of *SecurityHealthAnalyticsSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SecurityHealthAnalyticsSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersGetSecurityHealthAnalyticsSettingsCall) Do(opts ...googleapi.CallOption) (*SecurityHealthAnalyticsSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SecurityHealthAnalyticsSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the SecurityHealthAnalyticsSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/securityHealthAnalyticsSettings",
// "httpMethod": "GET",
// "id": "securitycenter.folders.getSecurityHealthAnalyticsSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the SecurityHealthAnalyticsSettings to retrieve. Formats: * organizations/{organization}/securityHealthAnalyticsSettings * folders/{folder}/securityHealthAnalyticsSettings * projects/{project}/securityHealthAnalyticsSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "SecurityHealthAnalyticsSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.getWebSecurityScannerSettings":
type FoldersGetWebSecurityScannerSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetWebSecurityScannerSettings: Get the WebSecurityScannerSettings
// resource.
func (r *FoldersService) GetWebSecurityScannerSettings(name string) *FoldersGetWebSecurityScannerSettingsCall {
c := &FoldersGetWebSecurityScannerSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersGetWebSecurityScannerSettingsCall) Fields(s ...googleapi.Field) *FoldersGetWebSecurityScannerSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersGetWebSecurityScannerSettingsCall) IfNoneMatch(entityTag string) *FoldersGetWebSecurityScannerSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersGetWebSecurityScannerSettingsCall) Context(ctx context.Context) *FoldersGetWebSecurityScannerSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersGetWebSecurityScannerSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersGetWebSecurityScannerSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.getWebSecurityScannerSettings" call.
// Exactly one of *WebSecurityScannerSettings or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *WebSecurityScannerSettings.ServerResponse.Header or (if a response
// was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersGetWebSecurityScannerSettingsCall) Do(opts ...googleapi.CallOption) (*WebSecurityScannerSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &WebSecurityScannerSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the WebSecurityScannerSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/webSecurityScannerSettings",
// "httpMethod": "GET",
// "id": "securitycenter.folders.getWebSecurityScannerSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the WebSecurityScannerSettings to retrieve. Formats: * organizations/{organization}/webSecurityScannerSettings * folders/{folder}/webSecurityScannerSettings * projects/{project}/webSecurityScannerSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/webSecurityScannerSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "WebSecurityScannerSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.updateContainerThreatDetectionSettings":
type FoldersUpdateContainerThreatDetectionSettingsCall struct {
s *Service
name string
containerthreatdetectionsettings *ContainerThreatDetectionSettings
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// UpdateContainerThreatDetectionSettings: Update the
// ContainerThreatDetectionSettings resource.
func (r *FoldersService) UpdateContainerThreatDetectionSettings(name string, containerthreatdetectionsettings *ContainerThreatDetectionSettings) *FoldersUpdateContainerThreatDetectionSettingsCall {
c := &FoldersUpdateContainerThreatDetectionSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.containerthreatdetectionsettings = containerthreatdetectionsettings
return c
}
// UpdateMask sets the optional parameter "updateMask": The list of
// fields to be updated.
func (c *FoldersUpdateContainerThreatDetectionSettingsCall) UpdateMask(updateMask string) *FoldersUpdateContainerThreatDetectionSettingsCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersUpdateContainerThreatDetectionSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateContainerThreatDetectionSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersUpdateContainerThreatDetectionSettingsCall) Context(ctx context.Context) *FoldersUpdateContainerThreatDetectionSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersUpdateContainerThreatDetectionSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersUpdateContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerthreatdetectionsettings)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.updateContainerThreatDetectionSettings" call.
// Exactly one of *ContainerThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ContainerThreatDetectionSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersUpdateContainerThreatDetectionSettingsCall) Do(opts ...googleapi.CallOption) (*ContainerThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ContainerThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Update the ContainerThreatDetectionSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/containerThreatDetectionSettings",
// "httpMethod": "PATCH",
// "id": "securitycenter.folders.updateContainerThreatDetectionSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the ContainerThreatDetectionSettings. Formats: * organizations/{organization}/containerThreatDetectionSettings * folders/{folder}/containerThreatDetectionSettings * projects/{project}/containerThreatDetectionSettings * projects/{project}/locations/{location}/clusters/{cluster}/containerThreatDetectionSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/containerThreatDetectionSettings$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "The list of fields to be updated.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "request": {
// "$ref": "ContainerThreatDetectionSettings"
// },
// "response": {
// "$ref": "ContainerThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.updateEventThreatDetectionSettings":
type FoldersUpdateEventThreatDetectionSettingsCall struct {
s *Service
name string
eventthreatdetectionsettings *EventThreatDetectionSettings
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// UpdateEventThreatDetectionSettings: Update the
// EventThreatDetectionSettings resource.
func (r *FoldersService) UpdateEventThreatDetectionSettings(name string, eventthreatdetectionsettings *EventThreatDetectionSettings) *FoldersUpdateEventThreatDetectionSettingsCall {
c := &FoldersUpdateEventThreatDetectionSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.eventthreatdetectionsettings = eventthreatdetectionsettings
return c
}
// UpdateMask sets the optional parameter "updateMask": The list of
// fields to be updated.
func (c *FoldersUpdateEventThreatDetectionSettingsCall) UpdateMask(updateMask string) *FoldersUpdateEventThreatDetectionSettingsCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersUpdateEventThreatDetectionSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateEventThreatDetectionSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersUpdateEventThreatDetectionSettingsCall) Context(ctx context.Context) *FoldersUpdateEventThreatDetectionSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersUpdateEventThreatDetectionSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersUpdateEventThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectionsettings)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.updateEventThreatDetectionSettings" call.
// Exactly one of *EventThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *EventThreatDetectionSettings.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersUpdateEventThreatDetectionSettingsCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EventThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Update the EventThreatDetectionSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/eventThreatDetectionSettings",
// "httpMethod": "PATCH",
// "id": "securitycenter.folders.updateEventThreatDetectionSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the EventThreatDetectionSettings. Formats: * organizations/{organization}/eventThreatDetectionSettings * folders/{folder}/eventThreatDetectionSettings * projects/{project}/eventThreatDetectionSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/eventThreatDetectionSettings$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "The list of fields to be updated.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "request": {
// "$ref": "EventThreatDetectionSettings"
// },
// "response": {
// "$ref": "EventThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.updateSecurityHealthAnalyticsSettings":
type FoldersUpdateSecurityHealthAnalyticsSettingsCall struct {
s *Service
name string
securityhealthanalyticssettings *SecurityHealthAnalyticsSettings
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// UpdateSecurityHealthAnalyticsSettings: Update the
// SecurityHealthAnalyticsSettings resource.
func (r *FoldersService) UpdateSecurityHealthAnalyticsSettings(name string, securityhealthanalyticssettings *SecurityHealthAnalyticsSettings) *FoldersUpdateSecurityHealthAnalyticsSettingsCall {
c := &FoldersUpdateSecurityHealthAnalyticsSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.securityhealthanalyticssettings = securityhealthanalyticssettings
return c
}
// UpdateMask sets the optional parameter "updateMask": The list of
// fields to be updated.
func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) UpdateMask(updateMask string) *FoldersUpdateSecurityHealthAnalyticsSettingsCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateSecurityHealthAnalyticsSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) Context(ctx context.Context) *FoldersUpdateSecurityHealthAnalyticsSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.securityhealthanalyticssettings)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.updateSecurityHealthAnalyticsSettings" call.
// Exactly one of *SecurityHealthAnalyticsSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SecurityHealthAnalyticsSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersUpdateSecurityHealthAnalyticsSettingsCall) Do(opts ...googleapi.CallOption) (*SecurityHealthAnalyticsSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SecurityHealthAnalyticsSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Update the SecurityHealthAnalyticsSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/securityHealthAnalyticsSettings",
// "httpMethod": "PATCH",
// "id": "securitycenter.folders.updateSecurityHealthAnalyticsSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the SecurityHealthAnalyticsSettings. Formats: * organizations/{organization}/securityHealthAnalyticsSettings * folders/{folder}/securityHealthAnalyticsSettings * projects/{project}/securityHealthAnalyticsSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "The list of fields to be updated.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "request": {
// "$ref": "SecurityHealthAnalyticsSettings"
// },
// "response": {
// "$ref": "SecurityHealthAnalyticsSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.updateWebSecurityScannerSettings":
type FoldersUpdateWebSecurityScannerSettingsCall struct {
s *Service
name string
websecurityscannersettings *WebSecurityScannerSettings
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// UpdateWebSecurityScannerSettings: Update the
// WebSecurityScannerSettings resource.
func (r *FoldersService) UpdateWebSecurityScannerSettings(name string, websecurityscannersettings *WebSecurityScannerSettings) *FoldersUpdateWebSecurityScannerSettingsCall {
c := &FoldersUpdateWebSecurityScannerSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.websecurityscannersettings = websecurityscannersettings
return c
}
// UpdateMask sets the optional parameter "updateMask": The list of
// fields to be updated.
func (c *FoldersUpdateWebSecurityScannerSettingsCall) UpdateMask(updateMask string) *FoldersUpdateWebSecurityScannerSettingsCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersUpdateWebSecurityScannerSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateWebSecurityScannerSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersUpdateWebSecurityScannerSettingsCall) Context(ctx context.Context) *FoldersUpdateWebSecurityScannerSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersUpdateWebSecurityScannerSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersUpdateWebSecurityScannerSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.websecurityscannersettings)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.updateWebSecurityScannerSettings" call.
// Exactly one of *WebSecurityScannerSettings or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *WebSecurityScannerSettings.ServerResponse.Header or (if a response
// was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersUpdateWebSecurityScannerSettingsCall) Do(opts ...googleapi.CallOption) (*WebSecurityScannerSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &WebSecurityScannerSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Update the WebSecurityScannerSettings resource.",
// "flatPath": "v1beta2/folders/{foldersId}/webSecurityScannerSettings",
// "httpMethod": "PATCH",
// "id": "securitycenter.folders.updateWebSecurityScannerSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the WebSecurityScannerSettings. Formats: * organizations/{organization}/webSecurityScannerSettings * folders/{folder}/webSecurityScannerSettings * projects/{project}/webSecurityScannerSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/webSecurityScannerSettings$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "The list of fields to be updated.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "request": {
// "$ref": "WebSecurityScannerSettings"
// },
// "response": {
// "$ref": "WebSecurityScannerSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.containerThreatDetectionSettings.calculate":
type FoldersContainerThreatDetectionSettingsCalculateCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Calculate: Calculates the effective ContainerThreatDetectionSettings
// based on its level in the resource hierarchy and its settings.
func (r *FoldersContainerThreatDetectionSettingsService) Calculate(name string) *FoldersContainerThreatDetectionSettingsCalculateCall {
c := &FoldersContainerThreatDetectionSettingsCalculateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersContainerThreatDetectionSettingsCalculateCall) Fields(s ...googleapi.Field) *FoldersContainerThreatDetectionSettingsCalculateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersContainerThreatDetectionSettingsCalculateCall) IfNoneMatch(entityTag string) *FoldersContainerThreatDetectionSettingsCalculateCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersContainerThreatDetectionSettingsCalculateCall) Context(ctx context.Context) *FoldersContainerThreatDetectionSettingsCalculateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersContainerThreatDetectionSettingsCalculateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersContainerThreatDetectionSettingsCalculateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.containerThreatDetectionSettings.calculate" call.
// Exactly one of *ContainerThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ContainerThreatDetectionSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersContainerThreatDetectionSettingsCalculateCall) Do(opts ...googleapi.CallOption) (*ContainerThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ContainerThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Calculates the effective ContainerThreatDetectionSettings based on its level in the resource hierarchy and its settings.",
// "flatPath": "v1beta2/folders/{foldersId}/containerThreatDetectionSettings:calculate",
// "httpMethod": "GET",
// "id": "securitycenter.folders.containerThreatDetectionSettings.calculate",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the ContainerThreatDetectionSettings to calculate. Formats: * organizations/{organization}/containerThreatDetectionSettings * folders/{folder}/containerThreatDetectionSettings * projects/{project}/containerThreatDetectionSettings * projects/{project}/locations/{location}/clusters/{cluster}/containerThreatDetectionSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/containerThreatDetectionSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}:calculate",
// "response": {
// "$ref": "ContainerThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.eventThreatDetectionSettings.calculate":
type FoldersEventThreatDetectionSettingsCalculateCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Calculate: Calculates the effective EventThreatDetectionSettings
// based on its level in the resource hierarchy and its settings.
func (r *FoldersEventThreatDetectionSettingsService) Calculate(name string) *FoldersEventThreatDetectionSettingsCalculateCall {
c := &FoldersEventThreatDetectionSettingsCalculateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersEventThreatDetectionSettingsCalculateCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCalculateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersEventThreatDetectionSettingsCalculateCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsCalculateCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersEventThreatDetectionSettingsCalculateCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCalculateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersEventThreatDetectionSettingsCalculateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersEventThreatDetectionSettingsCalculateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.eventThreatDetectionSettings.calculate" call.
// Exactly one of *EventThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *EventThreatDetectionSettings.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersEventThreatDetectionSettingsCalculateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EventThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Calculates the effective EventThreatDetectionSettings based on its level in the resource hierarchy and its settings.",
// "flatPath": "v1beta2/folders/{foldersId}/eventThreatDetectionSettings:calculate",
// "httpMethod": "GET",
// "id": "securitycenter.folders.eventThreatDetectionSettings.calculate",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the EventThreatDetectionSettings to calculate. Formats: * organizations/{organization}/eventThreatDetectionSettings * folders/{folder}/eventThreatDetectionSettings * projects/{project}/eventThreatDetectionSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/eventThreatDetectionSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}:calculate",
// "response": {
// "$ref": "EventThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.securityHealthAnalyticsSettings.calculate":
type FoldersSecurityHealthAnalyticsSettingsCalculateCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Calculate: Calculates the effective SecurityHealthAnalyticsSettings
// based on its level in the resource hierarchy and its settings.
func (r *FoldersSecurityHealthAnalyticsSettingsService) Calculate(name string) *FoldersSecurityHealthAnalyticsSettingsCalculateCall {
c := &FoldersSecurityHealthAnalyticsSettingsCalculateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCalculateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCalculateCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCalculateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.calculate" call.
// Exactly one of *SecurityHealthAnalyticsSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SecurityHealthAnalyticsSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersSecurityHealthAnalyticsSettingsCalculateCall) Do(opts ...googleapi.CallOption) (*SecurityHealthAnalyticsSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SecurityHealthAnalyticsSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Calculates the effective SecurityHealthAnalyticsSettings based on its level in the resource hierarchy and its settings.",
// "flatPath": "v1beta2/folders/{foldersId}/securityHealthAnalyticsSettings:calculate",
// "httpMethod": "GET",
// "id": "securitycenter.folders.securityHealthAnalyticsSettings.calculate",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the SecurityHealthAnalyticsSettings to calculate. Formats: * organizations/{organization}/securityHealthAnalyticsSettings * folders/{folder}/securityHealthAnalyticsSettings * projects/{project}/securityHealthAnalyticsSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}:calculate",
// "response": {
// "$ref": "SecurityHealthAnalyticsSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.folders.webSecurityScannerSettings.calculate":
type FoldersWebSecurityScannerSettingsCalculateCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Calculate: Calculates the effective WebSecurityScannerSettings based
// on its level in the resource hierarchy and its settings.
func (r *FoldersWebSecurityScannerSettingsService) Calculate(name string) *FoldersWebSecurityScannerSettingsCalculateCall {
c := &FoldersWebSecurityScannerSettingsCalculateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FoldersWebSecurityScannerSettingsCalculateCall) Fields(s ...googleapi.Field) *FoldersWebSecurityScannerSettingsCalculateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FoldersWebSecurityScannerSettingsCalculateCall) IfNoneMatch(entityTag string) *FoldersWebSecurityScannerSettingsCalculateCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FoldersWebSecurityScannerSettingsCalculateCall) Context(ctx context.Context) *FoldersWebSecurityScannerSettingsCalculateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FoldersWebSecurityScannerSettingsCalculateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FoldersWebSecurityScannerSettingsCalculateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:calculate")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.folders.webSecurityScannerSettings.calculate" call.
// Exactly one of *WebSecurityScannerSettings or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *WebSecurityScannerSettings.ServerResponse.Header or (if a response
// was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FoldersWebSecurityScannerSettingsCalculateCall) Do(opts ...googleapi.CallOption) (*WebSecurityScannerSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &WebSecurityScannerSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Calculates the effective WebSecurityScannerSettings based on its level in the resource hierarchy and its settings.",
// "flatPath": "v1beta2/folders/{foldersId}/webSecurityScannerSettings:calculate",
// "httpMethod": "GET",
// "id": "securitycenter.folders.webSecurityScannerSettings.calculate",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the WebSecurityScannerSettings to calculate. Formats: * organizations/{organization}/webSecurityScannerSettings * folders/{folder}/webSecurityScannerSettings * projects/{project}/webSecurityScannerSettings",
// "location": "path",
// "pattern": "^folders/[^/]+/webSecurityScannerSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}:calculate",
// "response": {
// "$ref": "WebSecurityScannerSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.organizations.getContainerThreatDetectionSettings":
type OrganizationsGetContainerThreatDetectionSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetContainerThreatDetectionSettings: Get the
// ContainerThreatDetectionSettings resource.
func (r *OrganizationsService) GetContainerThreatDetectionSettings(name string) *OrganizationsGetContainerThreatDetectionSettingsCall {
c := &OrganizationsGetContainerThreatDetectionSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OrganizationsGetContainerThreatDetectionSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetContainerThreatDetectionSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OrganizationsGetContainerThreatDetectionSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetContainerThreatDetectionSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OrganizationsGetContainerThreatDetectionSettingsCall) Context(ctx context.Context) *OrganizationsGetContainerThreatDetectionSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OrganizationsGetContainerThreatDetectionSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OrganizationsGetContainerThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.organizations.getContainerThreatDetectionSettings" call.
// Exactly one of *ContainerThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ContainerThreatDetectionSettings.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *OrganizationsGetContainerThreatDetectionSettingsCall) Do(opts ...googleapi.CallOption) (*ContainerThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ContainerThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the ContainerThreatDetectionSettings resource.",
// "flatPath": "v1beta2/organizations/{organizationsId}/containerThreatDetectionSettings",
// "httpMethod": "GET",
// "id": "securitycenter.organizations.getContainerThreatDetectionSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the ContainerThreatDetectionSettings to retrieve. Formats: * organizations/{organization}/containerThreatDetectionSettings * folders/{folder}/containerThreatDetectionSettings * projects/{project}/containerThreatDetectionSettings * projects/{project}/locations/{location}/clusters/{cluster}/containerThreatDetectionSettings",
// "location": "path",
// "pattern": "^organizations/[^/]+/containerThreatDetectionSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "ContainerThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.organizations.getEventThreatDetectionSettings":
type OrganizationsGetEventThreatDetectionSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetEventThreatDetectionSettings: Get the EventThreatDetectionSettings
// resource.
func (r *OrganizationsService) GetEventThreatDetectionSettings(name string) *OrganizationsGetEventThreatDetectionSettingsCall {
c := &OrganizationsGetEventThreatDetectionSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OrganizationsGetEventThreatDetectionSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetEventThreatDetectionSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OrganizationsGetEventThreatDetectionSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetEventThreatDetectionSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OrganizationsGetEventThreatDetectionSettingsCall) Context(ctx context.Context) *OrganizationsGetEventThreatDetectionSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OrganizationsGetEventThreatDetectionSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OrganizationsGetEventThreatDetectionSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.organizations.getEventThreatDetectionSettings" call.
// Exactly one of *EventThreatDetectionSettings or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *EventThreatDetectionSettings.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *OrganizationsGetEventThreatDetectionSettingsCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EventThreatDetectionSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the EventThreatDetectionSettings resource.",
// "flatPath": "v1beta2/organizations/{organizationsId}/eventThreatDetectionSettings",
// "httpMethod": "GET",
// "id": "securitycenter.organizations.getEventThreatDetectionSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the EventThreatDetectionSettings to retrieve. Formats: * organizations/{organization}/eventThreatDetectionSettings * folders/{folder}/eventThreatDetectionSettings * projects/{project}/eventThreatDetectionSettings",
// "location": "path",
// "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "EventThreatDetectionSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.organizations.getSecurityCenterSettings":
type OrganizationsGetSecurityCenterSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetSecurityCenterSettings: Get the SecurityCenterSettings resource.
func (r *OrganizationsService) GetSecurityCenterSettings(name string) *OrganizationsGetSecurityCenterSettingsCall {
c := &OrganizationsGetSecurityCenterSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OrganizationsGetSecurityCenterSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetSecurityCenterSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OrganizationsGetSecurityCenterSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetSecurityCenterSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OrganizationsGetSecurityCenterSettingsCall) Context(ctx context.Context) *OrganizationsGetSecurityCenterSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OrganizationsGetSecurityCenterSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OrganizationsGetSecurityCenterSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "securitycenter.organizations.getSecurityCenterSettings" call.
// Exactly one of *SecurityCenterSettings or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SecurityCenterSettings.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *OrganizationsGetSecurityCenterSettingsCall) Do(opts ...googleapi.CallOption) (*SecurityCenterSettings, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SecurityCenterSettings{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get the SecurityCenterSettings resource.",
// "flatPath": "v1beta2/organizations/{organizationsId}/securityCenterSettings",
// "httpMethod": "GET",
// "id": "securitycenter.organizations.getSecurityCenterSettings",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the SecurityCenterSettings to retrieve. Format: organizations/{organization}/securityCenterSettings",
// "location": "path",
// "pattern": "^organizations/[^/]+/securityCenterSettings$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta2/{+name}",
// "response": {
// "$ref": "SecurityCenterSettings"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "securitycenter.organizations.getSecurityHealthAnalyticsSettings":
type OrganizationsGetSecurityHealthAnalyticsSettingsCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetSecurityHealthAnalyticsSettings: Get the
// SecurityHealthAnalyticsSettings resource.
func (r *OrganizationsService) GetSecurityHealthAnalyticsSettings(name string) *OrganizationsGetSecurityHealthAnalyticsSettingsCall {
c := &OrganizationsGetSecurityHealthAnalyticsSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OrganizationsGetSecurityHealthAnalyticsSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetSecurityHealthAnalyticsSettingsCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OrganizationsGetSecurityHealthAnalyticsSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetSecurityHealthAnalyticsSettingsCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OrganizationsGetSecurityHealthAnalyticsSettingsCall) Context(ctx context.Context) *OrganizationsGetSecurityHealthAnalyticsSettingsCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OrganizationsGetSecurityHealthAnalyticsSettingsCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OrganizationsGetSecurityHealthAnalyticsSettingsCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.