Security Command Center Management API v1 - Package cloud.google.com/go/securitycentermanagement/apiv1 (v1.1.4)

Package securitycentermanagement is an auto-generated package for the Security Command Center Management API.

Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center.

General documentation

For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview . Some information on this page includes:

Example usage

To get started with this package, create a client.

 // go get cloud.google.com/go/securitycentermanagement/apiv1@latest 
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
 // This snippet has been automatically generated and should be regarded as a code template only. 
 // It will require modifications to work: 
 // - It may require correct/in-range values for request initialization. 
 // - It may require specifying regional endpoints when creating the service client as shown in: 
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
 NewClient 
 ( 
 ctx 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 defer 
  
 c 
 . 
 Close 
 () 

The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client, mentioned above.

 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 CreateEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#CreateEventThreatDetectionCustomModuleRequest. 
 } 
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 // TODO: Use resp. 
 _ 
  
 = 
  
 resp 

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

Functions

func DefaultAuthScopes

  func 
  
 DefaultAuthScopes 
 () 
  
 [] 
  string 
 
 

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

CallOptions

  type 
  
 CallOptions 
  
 struct 
  
 { 
  
 ListEffectiveSecurityHealthAnalyticsCustomModules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetEffectiveSecurityHealthAnalyticsCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListSecurityHealthAnalyticsCustomModules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListDescendantSecurityHealthAnalyticsCustomModules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetSecurityHealthAnalyticsCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CreateSecurityHealthAnalyticsCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 UpdateSecurityHealthAnalyticsCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteSecurityHealthAnalyticsCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 SimulateSecurityHealthAnalyticsCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListEffectiveEventThreatDetectionCustomModules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetEffectiveEventThreatDetectionCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListEventThreatDetectionCustomModules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListDescendantEventThreatDetectionCustomModules 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetEventThreatDetectionCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 CreateEventThreatDetectionCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 UpdateEventThreatDetectionCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteEventThreatDetectionCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ValidateEventThreatDetectionCustomModule 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetSecurityCenterService 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListSecurityCenterServices 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 UpdateSecurityCenterService 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 GetLocation 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListLocations 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 

CallOptions contains the retry settings for each method of Client.

Client

  type 
  
 Client 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  CallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 

Client is a client for interacting with Security Command Center Management API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service describing handlers for resources

func NewClient

  func 
  
 NewClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  Client 
 
 , 
  
  error 
 
 ) 
 

NewClient creates a new security center management client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service describing handlers for resources

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func NewRESTClient

  func 
  
 NewRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  Client 
 
 , 
  
  error 
 
 ) 
 

NewRESTClient creates a new security center management rest client.

Service describing handlers for resources

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func (*Client) Close

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 Close 
 () 
  
  error 
 
 

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*Client) Connection (deprecated)

  func 
  
 ( 
 c 
  
 * 
  Client 
 
 ) 
  
 Connection 
 () 
  
 * 
 grpc 
 . 
 ClientConn 
 

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*Client) CreateEventThreatDetectionCustomModule

CreateEventThreatDetectionCustomModule creates a resident Event Threat Detection custom module at the scope of the given organization, folder, or project, and creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 CreateEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#CreateEventThreatDetectionCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) CreateSecurityHealthAnalyticsCustomModule

CreateSecurityHealthAnalyticsCustomModule creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given organization, folder, or project, and also creates inherited SecurityHealthAnalyticsCustomModule resources for all folders and projects that are descendants of the given parent. These modules are enabled by default.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 CreateSecurityHealthAnalyticsCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#CreateSecurityHealthAnalyticsCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 CreateSecurityHealthAnalyticsCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) DeleteEventThreatDetectionCustomModule

DeleteEventThreatDetectionCustomModule deletes the specified Event Threat Detection custom module and all of its descendants in the resource hierarchy. This method is only supported for resident custom modules.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 DeleteEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#DeleteEventThreatDetectionCustomModuleRequest. 
  
 } 
  
 err 
  
 = 
  
 c 
 . 
 DeleteEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*Client) DeleteSecurityHealthAnalyticsCustomModule

DeleteSecurityHealthAnalyticsCustomModule deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the resource hierarchy. This method is only supported for resident custom modules.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 DeleteSecurityHealthAnalyticsCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#DeleteSecurityHealthAnalyticsCustomModuleRequest. 
  
 } 
  
 err 
  
 = 
  
 c 
 . 
 DeleteSecurityHealthAnalyticsCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 

func (*Client) GetEffectiveEventThreatDetectionCustomModule

GetEffectiveEventThreatDetectionCustomModule gets the effective Event Threat Detection custom module at the given level.

The difference between an EffectiveEventThreatDetectionCustomModule and an EventThreatDetectionCustomModule is that the fields for an EffectiveEventThreatDetectionCustomModule are computed from ancestors if needed. For example, the enablement state for an EventThreatDetectionCustomModule can be ENABLED, DISABLED, or INHERITED. In contrast, the enablement state for an EffectiveEventThreatDetectionCustomModule is always computed as ENABLED or DISABLED.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 GetEffectiveEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetEffectiveEventThreatDetectionCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetEffectiveEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) GetEffectiveSecurityHealthAnalyticsCustomModule

GetEffectiveSecurityHealthAnalyticsCustomModule gets details of a single EffectiveSecurityHealthAnalyticsCustomModule.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetEffectiveSecurityHealthAnalyticsCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) GetEventThreatDetectionCustomModule

GetEventThreatDetectionCustomModule gets an Event Threat Detection custom module.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 GetEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetEventThreatDetectionCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) GetLocation

GetLocation gets information about a location.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 locationpb 
  
 "google.golang.org/genproto/googleapis/cloud/location" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& locationpb 
 . 
 GetLocationRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
  GetLocation 
 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) GetSecurityCenterService

GetSecurityCenterService gets service settings for the specified Security Command Center service.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 GetSecurityCenterServiceRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetSecurityCenterServiceRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetSecurityCenterService 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) GetSecurityHealthAnalyticsCustomModule

GetSecurityHealthAnalyticsCustomModule retrieves a SecurityHealthAnalyticsCustomModule.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 GetSecurityHealthAnalyticsCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetSecurityHealthAnalyticsCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetSecurityHealthAnalyticsCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) ListDescendantEventThreatDetectionCustomModules

ListDescendantEventThreatDetectionCustomModules lists all resident Event Threat Detection custom modules for the given organization, folder, or project and its descendants.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListDescendantEventThreatDetectionCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantEventThreatDetectionCustomModulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListDescendantEventThreatDetectionCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListDescendantEventThreatDetectionCustomModulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListDescendantEventThreatDetectionCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantEventThreatDetectionCustomModulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListDescendantEventThreatDetectionCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListDescendantSecurityHealthAnalyticsCustomModules

ListDescendantSecurityHealthAnalyticsCustomModules returns a list of all resident SecurityHealthAnalyticsCustomModule resources under the given organization, folder, or project and all of its descendants.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListDescendantSecurityHealthAnalyticsCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantSecurityHealthAnalyticsCustomModulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListDescendantSecurityHealthAnalyticsCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListDescendantSecurityHealthAnalyticsCustomModulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListDescendantSecurityHealthAnalyticsCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantSecurityHealthAnalyticsCustomModulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListDescendantSecurityHealthAnalyticsCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListEffectiveEventThreatDetectionCustomModules

ListEffectiveEventThreatDetectionCustomModules lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListEffectiveEventThreatDetectionCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveEventThreatDetectionCustomModulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListEffectiveEventThreatDetectionCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListEffectiveEventThreatDetectionCustomModulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListEffectiveEventThreatDetectionCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveEventThreatDetectionCustomModulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListEffectiveEventThreatDetectionCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListEffectiveSecurityHealthAnalyticsCustomModules

ListEffectiveSecurityHealthAnalyticsCustomModules returns a list of all EffectiveSecurityHealthAnalyticsCustomModule resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListEffectiveSecurityHealthAnalyticsCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListEffectiveSecurityHealthAnalyticsCustomModulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListEffectiveSecurityHealthAnalyticsCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListEventThreatDetectionCustomModules

ListEventThreatDetectionCustomModules lists all Event Threat Detection custom modules for the given organization, folder, or project. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListEventThreatDetectionCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEventThreatDetectionCustomModulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListEventThreatDetectionCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListEventThreatDetectionCustomModulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListEventThreatDetectionCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEventThreatDetectionCustomModulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListEventThreatDetectionCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListLocations

ListLocations lists information about the supported locations for this service.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 "google.golang.org/api/iterator" 
  
 locationpb 
  
 "google.golang.org/genproto/googleapis/cloud/location" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& locationpb 
 . 
 ListLocationsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
  ListLocations 
 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 locationpb 
 . 
 ListLocationsResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 locationpb 
  
 "google.golang.org/genproto/googleapis/cloud/location" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& locationpb 
 . 
 ListLocationsRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
  ListLocations 
 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListSecurityCenterServices

ListSecurityCenterServices returns a list of all Security Command Center services for the given parent.

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListSecurityCenterServicesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityCenterServicesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListSecurityCenterServices 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListSecurityCenterServicesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListSecurityCenterServicesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityCenterServicesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListSecurityCenterServices 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) ListSecurityHealthAnalyticsCustomModules

ListSecurityHealthAnalyticsCustomModules returns a list of all SecurityHealthAnalyticsCustomModule resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).

Examples

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListSecurityHealthAnalyticsCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityHealthAnalyticsCustomModulesRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListSecurityHealthAnalyticsCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 for 
  
 { 
  
 resp 
 , 
  
 err 
  
 := 
  
 it 
 . 
 Next 
 () 
  
 if 
  
 err 
  
 == 
  
 iterator 
 . 
 Done 
  
 { 
  
 break 
  
 } 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 // If you need to access the underlying RPC response, 
  
 // you can do so by casting the `Response` as below. 
  
 // Otherwise, remove this line. Only populated after 
  
 // first call to Next(). Not safe for concurrent access. 
  
 _ 
  
 = 
  
 it 
 . 
 Response 
 .( 
 * 
 securitycentermanagementpb 
 . 
 ListSecurityHealthAnalyticsCustomModulesResponse 
 ) 
  
 } 
 } 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ListSecurityHealthAnalyticsCustomModulesRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityHealthAnalyticsCustomModulesRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListSecurityHealthAnalyticsCustomModules 
 ( 
 ctx 
 , 
  
 req 
 ). 
 All 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 

func (*Client) SimulateSecurityHealthAnalyticsCustomModule

SimulateSecurityHealthAnalyticsCustomModule simulates the result of using a SecurityHealthAnalyticsCustomModule to check a resource.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 SimulateSecurityHealthAnalyticsCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#SimulateSecurityHealthAnalyticsCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 SimulateSecurityHealthAnalyticsCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) UpdateEventThreatDetectionCustomModule

UpdateEventThreatDetectionCustomModule updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of “inherited”). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 UpdateEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#UpdateEventThreatDetectionCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 UpdateEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) UpdateSecurityCenterService

UpdateSecurityCenterService updates a Security Command Center service using the given update mask.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 UpdateSecurityCenterServiceRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#UpdateSecurityCenterServiceRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 UpdateSecurityCenterService 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) UpdateSecurityHealthAnalyticsCustomModule

UpdateSecurityHealthAnalyticsCustomModule updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of “inherited”). Updating the display name and custom configuration of a module is supported on resident modules only.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 UpdateSecurityHealthAnalyticsCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#UpdateSecurityHealthAnalyticsCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 UpdateSecurityHealthAnalyticsCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*Client) ValidateEventThreatDetectionCustomModule

ValidateEventThreatDetectionCustomModule validates the given Event Threat Detection custom module.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 securitycentermanagement 
  
 "cloud.google.com/go/securitycentermanagement/apiv1" 
  
 securitycentermanagementpb 
  
 "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 // This snippet has been automatically generated and should be regarded as a code template only. 
  
 // It will require modifications to work: 
  
 // - It may require correct/in-range values for request initialization. 
  
 // - It may require specifying regional endpoints when creating the service client as shown in: 
  
 //   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 
  
 c 
 , 
  
 err 
  
 := 
  
 securitycentermanagement 
 . 
  NewClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& securitycentermanagementpb 
 . 
 ValidateEventThreatDetectionCustomModuleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ValidateEventThreatDetectionCustomModuleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 ValidateEventThreatDetectionCustomModule 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

EffectiveEventThreatDetectionCustomModuleIterator

  type 
  
 EffectiveEventThreatDetectionCustomModuleIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  securitycentermanagementpb 
 
 . 
  EffectiveEventThreatDetectionCustomModule 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

EffectiveEventThreatDetectionCustomModuleIterator manages a stream of *securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule.

func (*EffectiveEventThreatDetectionCustomModuleIterator) All

  func 
  
 ( 
 it 
  
 * 
  EffectiveEventThreatDetectionCustomModuleIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securitycentermanagementpb 
 . 
 EffectiveEventThreatDetectionCustomModule 
 , 
  
 error 
 ] 
 

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*EffectiveEventThreatDetectionCustomModuleIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*EffectiveEventThreatDetectionCustomModuleIterator) PageInfo

  func 
  
 ( 
 it 
  
 * 
  EffectiveEventThreatDetectionCustomModuleIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

EffectiveSecurityHealthAnalyticsCustomModuleIterator

  type 
  
 EffectiveSecurityHealthAnalyticsCustomModuleIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  securitycentermanagementpb 
 
 . 
  EffectiveSecurityHealthAnalyticsCustomModule 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

EffectiveSecurityHealthAnalyticsCustomModuleIterator manages a stream of *securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule.

func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) All

  func 
  
 ( 
 it 
  
 * 
  EffectiveSecurityHealthAnalyticsCustomModuleIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securitycentermanagementpb 
 . 
 EffectiveSecurityHealthAnalyticsCustomModule 
 , 
  
 error 
 ] 
 

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) PageInfo

  func 
  
 ( 
 it 
  
 * 
  EffectiveSecurityHealthAnalyticsCustomModuleIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

EventThreatDetectionCustomModuleIterator

  type 
  
 EventThreatDetectionCustomModuleIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  securitycentermanagementpb 
 
 . 
  EventThreatDetectionCustomModule 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

EventThreatDetectionCustomModuleIterator manages a stream of *securitycentermanagementpb.EventThreatDetectionCustomModule.

func (*EventThreatDetectionCustomModuleIterator) All

  func 
  
 ( 
 it 
  
 * 
  EventThreatDetectionCustomModuleIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securitycentermanagementpb 
 . 
 EventThreatDetectionCustomModule 
 , 
  
 error 
 ] 
 

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*EventThreatDetectionCustomModuleIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*EventThreatDetectionCustomModuleIterator) PageInfo

  func 
  
 ( 
 it 
  
 * 
  EventThreatDetectionCustomModuleIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

LocationIterator

  type 
  
 LocationIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  locationpb 
 
 . 
  Location 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) All

  func 
  
 ( 
 it 
  
 * 
  LocationIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 locationpb 
 . 
 Location 
 , 
  
 error 
 ] 
 

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*LocationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*LocationIterator) PageInfo

  func 
  
 ( 
 it 
  
 * 
  LocationIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

SecurityCenterServiceIterator

  type 
  
 SecurityCenterServiceIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  securitycentermanagementpb 
 
 . 
  SecurityCenterService 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

SecurityCenterServiceIterator manages a stream of *securitycentermanagementpb.SecurityCenterService.

func (*SecurityCenterServiceIterator) All

  func 
  
 ( 
 it 
  
 * 
  SecurityCenterServiceIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securitycentermanagementpb 
 . 
 SecurityCenterService 
 , 
  
 error 
 ] 
 

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*SecurityCenterServiceIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*SecurityCenterServiceIterator) PageInfo

  func 
  
 ( 
 it 
  
 * 
  SecurityCenterServiceIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

SecurityHealthAnalyticsCustomModuleIterator

  type 
  
 SecurityHealthAnalyticsCustomModuleIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  securitycentermanagementpb 
 
 . 
  SecurityHealthAnalyticsCustomModule 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 

SecurityHealthAnalyticsCustomModuleIterator manages a stream of *securitycentermanagementpb.SecurityHealthAnalyticsCustomModule.

func (*SecurityHealthAnalyticsCustomModuleIterator) All

  func 
  
 ( 
 it 
  
 * 
  SecurityHealthAnalyticsCustomModuleIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 securitycentermanagementpb 
 . 
 SecurityHealthAnalyticsCustomModule 
 , 
  
 error 
 ] 
 

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*SecurityHealthAnalyticsCustomModuleIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*SecurityHealthAnalyticsCustomModuleIterator) PageInfo

  func 
  
 ( 
 it 
  
 * 
  SecurityHealthAnalyticsCustomModuleIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

Create a Mobile Website
View Site in Mobile | Classic
Share by: