Documentation
¶
Overview ¶
Package cloudsecuritycompliance is an auto-generated package for the Cloud Security Compliance API.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
// go get cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewAuditClient(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 := &cloudsecuritycompliancepb.CreateFrameworkAuditRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#CreateFrameworkAuditRequest.
}
op, err := c.CreateFrameworkAudit(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Use of Context ¶
The ctx passed to NewAuditClient 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.
Index ¶
- func DefaultAuthScopes() []string
- type AuditCallOptions
- type AuditClient
- func (c *AuditClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *AuditClient) Close() error
- func (c *AuditClient) Connection() *grpc.ClientConndeprecated
- func (c *AuditClient) CreateFrameworkAudit(ctx context.Context, ...) (*CreateFrameworkAuditOperation, error)
- func (c *AuditClient) CreateFrameworkAuditOperation(name string) *CreateFrameworkAuditOperation
- func (c *AuditClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *AuditClient) GenerateFrameworkAuditScopeReport(ctx context.Context, ...) (*cloudsecuritycompliancepb.GenerateFrameworkAuditScopeReportResponse, error)
- func (c *AuditClient) GetFrameworkAudit(ctx context.Context, req *cloudsecuritycompliancepb.GetFrameworkAuditRequest, ...) (*cloudsecuritycompliancepb.FrameworkAudit, error)
- func (c *AuditClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *AuditClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *AuditClient) ListFrameworkAudits(ctx context.Context, req *cloudsecuritycompliancepb.ListFrameworkAuditsRequest, ...) *FrameworkAuditIterator
- func (c *AuditClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *AuditClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type CloudControlDeploymentIterator
- type CloudControlIterator
- type CmEnrollmentCallOptions
- type CmEnrollmentClient
- func (c *CmEnrollmentClient) CalculateEffectiveCmEnrollment(ctx context.Context, ...) (*cloudsecuritycompliancepb.CalculateEffectiveCmEnrollmentResponse, error)
- func (c *CmEnrollmentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *CmEnrollmentClient) Close() error
- func (c *CmEnrollmentClient) Connection() *grpc.ClientConndeprecated
- func (c *CmEnrollmentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *CmEnrollmentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *CmEnrollmentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *CmEnrollmentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *CmEnrollmentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *CmEnrollmentClient) UpdateCmEnrollment(ctx context.Context, req *cloudsecuritycompliancepb.UpdateCmEnrollmentRequest, ...) (*cloudsecuritycompliancepb.CmEnrollment, error)
- type ConfigCallOptions
- type ConfigClient
- func (c *ConfigClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ConfigClient) Close() error
- func (c *ConfigClient) Connection() *grpc.ClientConndeprecated
- func (c *ConfigClient) CreateCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.CreateCloudControlRequest, ...) (*cloudsecuritycompliancepb.CloudControl, error)
- func (c *ConfigClient) CreateFramework(ctx context.Context, req *cloudsecuritycompliancepb.CreateFrameworkRequest, ...) (*cloudsecuritycompliancepb.Framework, error)
- func (c *ConfigClient) DeleteCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.DeleteCloudControlRequest, ...) error
- func (c *ConfigClient) DeleteFramework(ctx context.Context, req *cloudsecuritycompliancepb.DeleteFrameworkRequest, ...) error
- func (c *ConfigClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ConfigClient) GetCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.GetCloudControlRequest, ...) (*cloudsecuritycompliancepb.CloudControl, error)
- func (c *ConfigClient) GetFramework(ctx context.Context, req *cloudsecuritycompliancepb.GetFrameworkRequest, ...) (*cloudsecuritycompliancepb.Framework, error)
- func (c *ConfigClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *ConfigClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ConfigClient) ListCloudControls(ctx context.Context, req *cloudsecuritycompliancepb.ListCloudControlsRequest, ...) *CloudControlIterator
- func (c *ConfigClient) ListFrameworks(ctx context.Context, req *cloudsecuritycompliancepb.ListFrameworksRequest, ...) *FrameworkIterator
- func (c *ConfigClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *ConfigClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *ConfigClient) UpdateCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.UpdateCloudControlRequest, ...) (*cloudsecuritycompliancepb.CloudControl, error)
- func (c *ConfigClient) UpdateFramework(ctx context.Context, req *cloudsecuritycompliancepb.UpdateFrameworkRequest, ...) (*cloudsecuritycompliancepb.Framework, error)
- type ControlComplianceSummaryIterator
- func (it *ControlComplianceSummaryIterator) All() iter.Seq2[*cloudsecuritycompliancepb.ControlComplianceSummary, error]
- func (it *ControlComplianceSummaryIterator) Next() (*cloudsecuritycompliancepb.ControlComplianceSummary, error)
- func (it *ControlComplianceSummaryIterator) PageInfo() *iterator.PageInfo
- type CreateFrameworkAuditOperation
- func (op *CreateFrameworkAuditOperation) Done() bool
- func (op *CreateFrameworkAuditOperation) Metadata() (*cloudsecuritycompliancepb.OperationMetadata, error)
- func (op *CreateFrameworkAuditOperation) Name() string
- func (op *CreateFrameworkAuditOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkAudit, error)
- func (op *CreateFrameworkAuditOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkAudit, error)
- type CreateFrameworkDeploymentOperation
- func (op *CreateFrameworkDeploymentOperation) Done() bool
- func (op *CreateFrameworkDeploymentOperation) Metadata() (*cloudsecuritycompliancepb.OperationMetadata, error)
- func (op *CreateFrameworkDeploymentOperation) Name() string
- func (op *CreateFrameworkDeploymentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkDeployment, error)
- func (op *CreateFrameworkDeploymentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkDeployment, error)
- type DeleteFrameworkDeploymentOperation
- func (op *DeleteFrameworkDeploymentOperation) Done() bool
- func (op *DeleteFrameworkDeploymentOperation) Metadata() (*cloudsecuritycompliancepb.OperationMetadata, error)
- func (op *DeleteFrameworkDeploymentOperation) Name() string
- func (op *DeleteFrameworkDeploymentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteFrameworkDeploymentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeploymentCallOptions
- type DeploymentClient
- func (c *DeploymentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *DeploymentClient) Close() error
- func (c *DeploymentClient) Connection() *grpc.ClientConndeprecated
- func (c *DeploymentClient) CreateFrameworkDeployment(ctx context.Context, ...) (*CreateFrameworkDeploymentOperation, error)
- func (c *DeploymentClient) CreateFrameworkDeploymentOperation(name string) *CreateFrameworkDeploymentOperation
- func (c *DeploymentClient) DeleteFrameworkDeployment(ctx context.Context, ...) (*DeleteFrameworkDeploymentOperation, error)
- func (c *DeploymentClient) DeleteFrameworkDeploymentOperation(name string) *DeleteFrameworkDeploymentOperation
- func (c *DeploymentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *DeploymentClient) GetCloudControlDeployment(ctx context.Context, ...) (*cloudsecuritycompliancepb.CloudControlDeployment, error)
- func (c *DeploymentClient) GetFrameworkDeployment(ctx context.Context, ...) (*cloudsecuritycompliancepb.FrameworkDeployment, error)
- func (c *DeploymentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *DeploymentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *DeploymentClient) ListCloudControlDeployments(ctx context.Context, ...) *CloudControlDeploymentIterator
- func (c *DeploymentClient) ListFrameworkDeployments(ctx context.Context, ...) *FrameworkDeploymentIterator
- func (c *DeploymentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *DeploymentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type FindingSummaryIterator
- type FrameworkAuditIterator
- type FrameworkComplianceSummaryIterator
- func (it *FrameworkComplianceSummaryIterator) All() iter.Seq2[*cloudsecuritycompliancepb.FrameworkComplianceSummary, error]
- func (it *FrameworkComplianceSummaryIterator) Next() (*cloudsecuritycompliancepb.FrameworkComplianceSummary, error)
- func (it *FrameworkComplianceSummaryIterator) PageInfo() *iterator.PageInfo
- type FrameworkDeploymentIterator
- type FrameworkIterator
- type LocationIterator
- type MonitoringCallOptions
- type MonitoringClient
- func (c *MonitoringClient) AggregateFrameworkComplianceReport(ctx context.Context, ...) (*cloudsecuritycompliancepb.AggregateFrameworkComplianceReportResponse, error)
- func (c *MonitoringClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *MonitoringClient) Close() error
- func (c *MonitoringClient) Connection() *grpc.ClientConndeprecated
- func (c *MonitoringClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *MonitoringClient) FetchFrameworkComplianceReport(ctx context.Context, ...) (*cloudsecuritycompliancepb.FrameworkComplianceReport, error)
- func (c *MonitoringClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *MonitoringClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *MonitoringClient) ListControlComplianceSummaries(ctx context.Context, ...) *ControlComplianceSummaryIterator
- func (c *MonitoringClient) ListFindingSummaries(ctx context.Context, ...) *FindingSummaryIterator
- func (c *MonitoringClient) ListFrameworkComplianceSummaries(ctx context.Context, ...) *FrameworkComplianceSummaryIterator
- func (c *MonitoringClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *MonitoringClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type OperationIterator
Examples ¶
- AuditClient.CancelOperation
- AuditClient.CreateFrameworkAudit
- AuditClient.DeleteOperation
- AuditClient.GenerateFrameworkAuditScopeReport
- AuditClient.GetFrameworkAudit
- AuditClient.GetLocation
- AuditClient.GetOperation
- AuditClient.ListFrameworkAudits
- AuditClient.ListFrameworkAudits (All)
- AuditClient.ListLocations
- AuditClient.ListLocations (All)
- AuditClient.ListOperations
- AuditClient.ListOperations (All)
- CmEnrollmentClient.CalculateEffectiveCmEnrollment
- CmEnrollmentClient.CancelOperation
- CmEnrollmentClient.DeleteOperation
- CmEnrollmentClient.GetLocation
- CmEnrollmentClient.GetOperation
- CmEnrollmentClient.ListLocations
- CmEnrollmentClient.ListLocations (All)
- CmEnrollmentClient.ListOperations
- CmEnrollmentClient.ListOperations (All)
- CmEnrollmentClient.UpdateCmEnrollment
- ConfigClient.CancelOperation
- ConfigClient.CreateCloudControl
- ConfigClient.CreateFramework
- ConfigClient.DeleteCloudControl
- ConfigClient.DeleteFramework
- ConfigClient.DeleteOperation
- ConfigClient.GetCloudControl
- ConfigClient.GetFramework
- ConfigClient.GetLocation
- ConfigClient.GetOperation
- ConfigClient.ListCloudControls
- ConfigClient.ListCloudControls (All)
- ConfigClient.ListFrameworks
- ConfigClient.ListFrameworks (All)
- ConfigClient.ListLocations
- ConfigClient.ListLocations (All)
- ConfigClient.ListOperations
- ConfigClient.ListOperations (All)
- ConfigClient.UpdateCloudControl
- ConfigClient.UpdateFramework
- DeploymentClient.CancelOperation
- DeploymentClient.CreateFrameworkDeployment
- DeploymentClient.DeleteFrameworkDeployment
- DeploymentClient.DeleteOperation
- DeploymentClient.GetCloudControlDeployment
- DeploymentClient.GetFrameworkDeployment
- DeploymentClient.GetLocation
- DeploymentClient.GetOperation
- DeploymentClient.ListCloudControlDeployments
- DeploymentClient.ListCloudControlDeployments (All)
- DeploymentClient.ListFrameworkDeployments
- DeploymentClient.ListFrameworkDeployments (All)
- DeploymentClient.ListLocations
- DeploymentClient.ListLocations (All)
- DeploymentClient.ListOperations
- DeploymentClient.ListOperations (All)
- MonitoringClient.AggregateFrameworkComplianceReport
- MonitoringClient.CancelOperation
- MonitoringClient.DeleteOperation
- MonitoringClient.FetchFrameworkComplianceReport
- MonitoringClient.GetLocation
- MonitoringClient.GetOperation
- MonitoringClient.ListControlComplianceSummaries
- MonitoringClient.ListControlComplianceSummaries (All)
- MonitoringClient.ListFindingSummaries
- MonitoringClient.ListFindingSummaries (All)
- MonitoringClient.ListFrameworkComplianceSummaries
- MonitoringClient.ListFrameworkComplianceSummaries (All)
- MonitoringClient.ListLocations
- MonitoringClient.ListLocations (All)
- MonitoringClient.ListOperations
- MonitoringClient.ListOperations (All)
- NewAuditClient
- NewAuditRESTClient
- NewCmEnrollmentClient
- NewCmEnrollmentRESTClient
- NewConfigClient
- NewConfigRESTClient
- NewDeploymentClient
- NewDeploymentRESTClient
- NewMonitoringClient
- NewMonitoringRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AuditCallOptions ¶
type AuditCallOptions struct {
GenerateFrameworkAuditScopeReport []gax.CallOption
CreateFrameworkAudit []gax.CallOption
ListFrameworkAudits []gax.CallOption
GetFrameworkAudit []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
AuditCallOptions contains the retry settings for each method of AuditClient.
type AuditClient ¶
type AuditClient struct {
// The call options for this service.
CallOptions *AuditCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}
AuditClient is a client for interacting with Cloud Security Compliance API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewAuditClient ¶
func NewAuditClient(ctx context.Context, opts ...option.ClientOption) (*AuditClient, error)
NewAuditClient creates a new audit 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"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewAuditRESTClient ¶
func NewAuditRESTClient(ctx context.Context, opts ...option.ClientOption) (*AuditClient, error)
NewAuditRESTClient creates a new audit rest client.
Service describing handlers for resources
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewAuditRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AuditClient) CancelOperation ¶
func (c *AuditClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AuditClient) Close ¶
func (c *AuditClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AuditClient) Connection
deprecated
func (c *AuditClient) 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 (*AuditClient) CreateFrameworkAudit ¶
func (c *AuditClient) CreateFrameworkAudit(ctx context.Context, req *cloudsecuritycompliancepb.CreateFrameworkAuditRequest, opts ...gax.CallOption) (*CreateFrameworkAuditOperation, error)
CreateFrameworkAudit creates an audit scope report for a framework.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.CreateFrameworkAuditRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#CreateFrameworkAuditRequest.
}
op, err := c.CreateFrameworkAudit(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AuditClient) CreateFrameworkAuditOperation ¶
func (c *AuditClient) CreateFrameworkAuditOperation(name string) *CreateFrameworkAuditOperation
CreateFrameworkAuditOperation returns a new CreateFrameworkAuditOperation from a given name. The name must be that of a previously created CreateFrameworkAuditOperation, possibly from a different process.
func (*AuditClient) DeleteOperation ¶
func (c *AuditClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AuditClient) GenerateFrameworkAuditScopeReport ¶
func (c *AuditClient) GenerateFrameworkAuditScopeReport(ctx context.Context, req *cloudsecuritycompliancepb.GenerateFrameworkAuditScopeReportRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.GenerateFrameworkAuditScopeReportResponse, error)
GenerateFrameworkAuditScopeReport generates an audit scope report for a framework.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.GenerateFrameworkAuditScopeReportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#GenerateFrameworkAuditScopeReportRequest.
}
resp, err := c.GenerateFrameworkAuditScopeReport(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AuditClient) GetFrameworkAudit ¶
func (c *AuditClient) GetFrameworkAudit(ctx context.Context, req *cloudsecuritycompliancepb.GetFrameworkAuditRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkAudit, error)
GetFrameworkAudit gets the details for a framework audit.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.GetFrameworkAuditRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#GetFrameworkAuditRequest.
}
resp, err := c.GetFrameworkAudit(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AuditClient) GetLocation ¶
func (c *AuditClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewAuditClient(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 (*AuditClient) GetOperation ¶
func (c *AuditClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AuditClient) ListFrameworkAudits ¶
func (c *AuditClient) ListFrameworkAudits(ctx context.Context, req *cloudsecuritycompliancepb.ListFrameworkAuditsRequest, opts ...gax.CallOption) *FrameworkAuditIterator
ListFrameworkAudits lists the framework audits for a given organization, folder, or project.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworkAuditsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworkAuditsRequest.
}
it := c.ListFrameworkAudits(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.(*cloudsecuritycompliancepb.ListFrameworkAuditsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworkAuditsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworkAuditsRequest.
}
for resp, err := range c.ListFrameworkAudits(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AuditClient) ListLocations ¶
func (c *AuditClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewAuditClient(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)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewAuditClient(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 (*AuditClient) ListOperations ¶
func (c *AuditClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewAuditClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type CloudControlDeploymentIterator ¶
type CloudControlDeploymentIterator 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 []*cloudsecuritycompliancepb.CloudControlDeployment, nextPageToken string, err error)
// contains filtered or unexported fields
}
CloudControlDeploymentIterator manages a stream of *cloudsecuritycompliancepb.CloudControlDeployment.
func (*CloudControlDeploymentIterator) All ¶
func (it *CloudControlDeploymentIterator) All() iter.Seq2[*cloudsecuritycompliancepb.CloudControlDeployment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CloudControlDeploymentIterator) Next ¶
func (it *CloudControlDeploymentIterator) Next() (*cloudsecuritycompliancepb.CloudControlDeployment, error)
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 (*CloudControlDeploymentIterator) PageInfo ¶
func (it *CloudControlDeploymentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CloudControlIterator ¶
type CloudControlIterator 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 []*cloudsecuritycompliancepb.CloudControl, nextPageToken string, err error)
// contains filtered or unexported fields
}
CloudControlIterator manages a stream of *cloudsecuritycompliancepb.CloudControl.
func (*CloudControlIterator) All ¶
func (it *CloudControlIterator) All() iter.Seq2[*cloudsecuritycompliancepb.CloudControl, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CloudControlIterator) Next ¶
func (it *CloudControlIterator) Next() (*cloudsecuritycompliancepb.CloudControl, error)
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 (*CloudControlIterator) PageInfo ¶
func (it *CloudControlIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CmEnrollmentCallOptions ¶
type CmEnrollmentCallOptions struct {
UpdateCmEnrollment []gax.CallOption
CalculateEffectiveCmEnrollment []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
CmEnrollmentCallOptions contains the retry settings for each method of CmEnrollmentClient.
type CmEnrollmentClient ¶
type CmEnrollmentClient struct {
// The call options for this service.
CallOptions *CmEnrollmentCallOptions
// contains filtered or unexported fields
}
CmEnrollmentClient is a client for interacting with Cloud Security Compliance API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing CmEnrollment related RPCs for complianceManager.
func NewCmEnrollmentClient ¶
func NewCmEnrollmentClient(ctx context.Context, opts ...option.ClientOption) (*CmEnrollmentClient, error)
NewCmEnrollmentClient creates a new cm enrollment service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing CmEnrollment related RPCs for complianceManager.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewCmEnrollmentRESTClient ¶
func NewCmEnrollmentRESTClient(ctx context.Context, opts ...option.ClientOption) (*CmEnrollmentClient, error)
NewCmEnrollmentRESTClient creates a new cm enrollment service rest client.
Service describing CmEnrollment related RPCs for complianceManager.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewCmEnrollmentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*CmEnrollmentClient) CalculateEffectiveCmEnrollment ¶
func (c *CmEnrollmentClient) CalculateEffectiveCmEnrollment(ctx context.Context, req *cloudsecuritycompliancepb.CalculateEffectiveCmEnrollmentRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.CalculateEffectiveCmEnrollmentResponse, error)
CalculateEffectiveCmEnrollment calculates the effective Compliance Manager enrollment for a resource. An effective enrollment is either a direct enrollment of a resource (if it exists), or an enrollment of the closest parent of a resource that’s enrolled in Compliance Manager.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.CalculateEffectiveCmEnrollmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#CalculateEffectiveCmEnrollmentRequest.
}
resp, err := c.CalculateEffectiveCmEnrollment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CmEnrollmentClient) CancelOperation ¶
func (c *CmEnrollmentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*CmEnrollmentClient) Close ¶
func (c *CmEnrollmentClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*CmEnrollmentClient) Connection
deprecated
func (c *CmEnrollmentClient) 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 (*CmEnrollmentClient) DeleteOperation ¶
func (c *CmEnrollmentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*CmEnrollmentClient) GetLocation ¶
func (c *CmEnrollmentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewCmEnrollmentClient(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 (*CmEnrollmentClient) GetOperation ¶
func (c *CmEnrollmentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CmEnrollmentClient) ListLocations ¶
func (c *CmEnrollmentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewCmEnrollmentClient(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)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewCmEnrollmentClient(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 (*CmEnrollmentClient) ListOperations ¶
func (c *CmEnrollmentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*CmEnrollmentClient) UpdateCmEnrollment ¶
func (c *CmEnrollmentClient) UpdateCmEnrollment(ctx context.Context, req *cloudsecuritycompliancepb.UpdateCmEnrollmentRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.CmEnrollment, error)
UpdateCmEnrollment updates the Compliance Manager enrollment for a resource to facilitate an audit. Use this method to enroll a resource in Compliance Manager or to create or update feature-specific configurations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewCmEnrollmentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.UpdateCmEnrollmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#UpdateCmEnrollmentRequest.
}
resp, err := c.UpdateCmEnrollment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ConfigCallOptions ¶
type ConfigCallOptions struct {
ListFrameworks []gax.CallOption
GetFramework []gax.CallOption
CreateFramework []gax.CallOption
UpdateFramework []gax.CallOption
DeleteFramework []gax.CallOption
ListCloudControls []gax.CallOption
GetCloudControl []gax.CallOption
CreateCloudControl []gax.CallOption
UpdateCloudControl []gax.CallOption
DeleteCloudControl []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
ConfigCallOptions contains the retry settings for each method of ConfigClient.
type ConfigClient ¶
type ConfigClient struct {
// The call options for this service.
CallOptions *ConfigCallOptions
// contains filtered or unexported fields
}
ConfigClient is a client for interacting with Cloud Security Compliance API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Config Service manages compliance frameworks, cloud controls, and their configurations.
func NewConfigClient ¶
func NewConfigClient(ctx context.Context, opts ...option.ClientOption) (*ConfigClient, error)
NewConfigClient creates a new config client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Config Service manages compliance frameworks, cloud controls, and their configurations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewConfigRESTClient ¶
func NewConfigRESTClient(ctx context.Context, opts ...option.ClientOption) (*ConfigClient, error)
NewConfigRESTClient creates a new config rest client.
Config Service manages compliance frameworks, cloud controls, and their configurations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewConfigRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ConfigClient) CancelOperation ¶
func (c *ConfigClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConfigClient) Close ¶
func (c *ConfigClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConfigClient) Connection
deprecated
func (c *ConfigClient) 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 (*ConfigClient) CreateCloudControl ¶
func (c *ConfigClient) CreateCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.CreateCloudControlRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.CloudControl, error)
CreateCloudControl creates a custom cloud control in a given parent resource. You can’t create built-in cloud controls because those are managed by Google.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.CreateCloudControlRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#CreateCloudControlRequest.
}
resp, err := c.CreateCloudControl(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConfigClient) CreateFramework ¶
func (c *ConfigClient) CreateFramework(ctx context.Context, req *cloudsecuritycompliancepb.CreateFrameworkRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.Framework, error)
CreateFramework creates a custom framework in a given parent resource. You can’t create built-in frameworks because those are managed by Google.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.CreateFrameworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#CreateFrameworkRequest.
}
resp, err := c.CreateFramework(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConfigClient) DeleteCloudControl ¶
func (c *ConfigClient) DeleteCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.DeleteCloudControlRequest, opts ...gax.CallOption) error
DeleteCloudControl deletes a custom cloud control, including all its major and minor revisions. Consider the following:
You can’t delete built-in cloud controls. You can only delete cloud controls with type CUSTOM. You can’t delete cloud controls if any of the versions are referenced by a framework. You can’t restore a deleted cloud control. This action is permanent.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.DeleteCloudControlRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#DeleteCloudControlRequest.
}
err = c.DeleteCloudControl(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConfigClient) DeleteFramework ¶
func (c *ConfigClient) DeleteFramework(ctx context.Context, req *cloudsecuritycompliancepb.DeleteFrameworkRequest, opts ...gax.CallOption) error
DeleteFramework deletes a custom framework, including all its major and minor revisions. Consider the following:
You can’t delete built-in frameworks. You can only delete frameworks with type CUSTOM. You can’t delete frameworks that are deployed to a resource. You can’t restore a deleted framework. This action is permanent.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.DeleteFrameworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#DeleteFrameworkRequest.
}
err = c.DeleteFramework(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConfigClient) DeleteOperation ¶
func (c *ConfigClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConfigClient) GetCloudControl ¶
func (c *ConfigClient) GetCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.GetCloudControlRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.CloudControl, error)
GetCloudControl gets details about a cloud control. This method retrieves the latest major version of a cloud control that you identify by name.
By default, the latest major version of the cloud control is returned. To retrieve a specific major version, include major_revision_id in the request.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.GetCloudControlRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#GetCloudControlRequest.
}
resp, err := c.GetCloudControl(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConfigClient) GetFramework ¶
func (c *ConfigClient) GetFramework(ctx context.Context, req *cloudsecuritycompliancepb.GetFrameworkRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.Framework, error)
GetFramework gets details about a framework. This method retrieves the latest major version of the framework.
To retrieve a specific major version, include major_revision_id in the request.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.GetFrameworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#GetFrameworkRequest.
}
resp, err := c.GetFramework(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConfigClient) GetLocation ¶
func (c *ConfigClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewConfigClient(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 (*ConfigClient) GetOperation ¶
func (c *ConfigClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConfigClient) ListCloudControls ¶
func (c *ConfigClient) ListCloudControls(ctx context.Context, req *cloudsecuritycompliancepb.ListCloudControlsRequest, opts ...gax.CallOption) *CloudControlIterator
ListCloudControls lists the cloud controls (both built-in and custom) that are available in a given parent resource. The latest major version of each cloud control is returned. This method supports pagination.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListCloudControlsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListCloudControlsRequest.
}
it := c.ListCloudControls(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.(*cloudsecuritycompliancepb.ListCloudControlsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListCloudControlsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListCloudControlsRequest.
}
for resp, err := range c.ListCloudControls(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConfigClient) ListFrameworks ¶
func (c *ConfigClient) ListFrameworks(ctx context.Context, req *cloudsecuritycompliancepb.ListFrameworksRequest, opts ...gax.CallOption) *FrameworkIterator
ListFrameworks lists the frameworks (both built-in and custom) that are available within the parent resource. The latest major version of each framework is returned. This method supports pagination.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworksRequest.
}
it := c.ListFrameworks(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.(*cloudsecuritycompliancepb.ListFrameworksResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworksRequest.
}
for resp, err := range c.ListFrameworks(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConfigClient) ListLocations ¶
func (c *ConfigClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewConfigClient(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)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewConfigClient(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 (*ConfigClient) ListOperations ¶
func (c *ConfigClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConfigClient) UpdateCloudControl ¶
func (c *ConfigClient) UpdateCloudControl(ctx context.Context, req *cloudsecuritycompliancepb.UpdateCloudControlRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.CloudControl, error)
UpdateCloudControl updates a custom cloud control. This method allows for partial updates of a cloud control. Use the update_mask to specify which fields to update. Consider the following:
If you provide an update_mask, only the fields that are specified in the mask are updated. If you don’t provide an update_mask, all the fields that are present in the request’s cloud_control body are used to overwrite the existing resource.
You can only update cloud controls with the CUSTOM type. A successful update creates a new version of the cloud control.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.UpdateCloudControlRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#UpdateCloudControlRequest.
}
resp, err := c.UpdateCloudControl(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConfigClient) UpdateFramework ¶
func (c *ConfigClient) UpdateFramework(ctx context.Context, req *cloudsecuritycompliancepb.UpdateFrameworkRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.Framework, error)
UpdateFramework updates a custom framework. This method allows for partial updates of a framework. Use the update_mask to specify which fields to update. Consider the following:
If you provide an update_mask, only the fields that are specified in the mask are updated. If you don’t provide an update_mask, all the fields that are present in the request’s framework body are used to overwrite the existing resource.
You can only update frameworks with the CUSTOM type. A successful update creates a new version of the framework.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewConfigClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.UpdateFrameworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#UpdateFrameworkRequest.
}
resp, err := c.UpdateFramework(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ControlComplianceSummaryIterator ¶
type ControlComplianceSummaryIterator 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 []*cloudsecuritycompliancepb.ControlComplianceSummary, nextPageToken string, err error)
// contains filtered or unexported fields
}
ControlComplianceSummaryIterator manages a stream of *cloudsecuritycompliancepb.ControlComplianceSummary.
func (*ControlComplianceSummaryIterator) All ¶
func (it *ControlComplianceSummaryIterator) All() iter.Seq2[*cloudsecuritycompliancepb.ControlComplianceSummary, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ControlComplianceSummaryIterator) Next ¶
func (it *ControlComplianceSummaryIterator) Next() (*cloudsecuritycompliancepb.ControlComplianceSummary, error)
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 (*ControlComplianceSummaryIterator) PageInfo ¶
func (it *ControlComplianceSummaryIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CreateFrameworkAuditOperation ¶
type CreateFrameworkAuditOperation struct {
// contains filtered or unexported fields
}
CreateFrameworkAuditOperation manages a long-running operation from CreateFrameworkAudit.
func (*CreateFrameworkAuditOperation) Done ¶
func (op *CreateFrameworkAuditOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateFrameworkAuditOperation) Metadata ¶
func (op *CreateFrameworkAuditOperation) Metadata() (*cloudsecuritycompliancepb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateFrameworkAuditOperation) Name ¶
func (op *CreateFrameworkAuditOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateFrameworkAuditOperation) Poll ¶
func (op *CreateFrameworkAuditOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkAudit, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateFrameworkAuditOperation) Wait ¶
func (op *CreateFrameworkAuditOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkAudit, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateFrameworkDeploymentOperation ¶
type CreateFrameworkDeploymentOperation struct {
// contains filtered or unexported fields
}
CreateFrameworkDeploymentOperation manages a long-running operation from CreateFrameworkDeployment.
func (*CreateFrameworkDeploymentOperation) Done ¶
func (op *CreateFrameworkDeploymentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateFrameworkDeploymentOperation) Metadata ¶
func (op *CreateFrameworkDeploymentOperation) Metadata() (*cloudsecuritycompliancepb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateFrameworkDeploymentOperation) Name ¶
func (op *CreateFrameworkDeploymentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateFrameworkDeploymentOperation) Poll ¶
func (op *CreateFrameworkDeploymentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkDeployment, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateFrameworkDeploymentOperation) Wait ¶
func (op *CreateFrameworkDeploymentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkDeployment, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteFrameworkDeploymentOperation ¶
type DeleteFrameworkDeploymentOperation struct {
// contains filtered or unexported fields
}
DeleteFrameworkDeploymentOperation manages a long-running operation from DeleteFrameworkDeployment.
func (*DeleteFrameworkDeploymentOperation) Done ¶
func (op *DeleteFrameworkDeploymentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteFrameworkDeploymentOperation) Metadata ¶
func (op *DeleteFrameworkDeploymentOperation) Metadata() (*cloudsecuritycompliancepb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteFrameworkDeploymentOperation) Name ¶
func (op *DeleteFrameworkDeploymentOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteFrameworkDeploymentOperation) Poll ¶
func (op *DeleteFrameworkDeploymentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteFrameworkDeploymentOperation) Wait ¶
func (op *DeleteFrameworkDeploymentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeploymentCallOptions ¶
type DeploymentCallOptions struct {
CreateFrameworkDeployment []gax.CallOption
DeleteFrameworkDeployment []gax.CallOption
GetFrameworkDeployment []gax.CallOption
ListFrameworkDeployments []gax.CallOption
GetCloudControlDeployment []gax.CallOption
ListCloudControlDeployments []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
DeploymentCallOptions contains the retry settings for each method of DeploymentClient.
type DeploymentClient ¶
type DeploymentClient struct {
// The call options for this service.
CallOptions *DeploymentCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}
DeploymentClient is a client for interacting with Cloud Security Compliance API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Deployment service allows users to manage deployments of Frameworks and Cloud Controls on a target resource.
func NewDeploymentClient ¶
func NewDeploymentClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentClient, error)
NewDeploymentClient creates a new deployment client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Deployment service allows users to manage deployments of Frameworks and Cloud Controls on a target resource.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewDeploymentRESTClient ¶
func NewDeploymentRESTClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentClient, error)
NewDeploymentRESTClient creates a new deployment rest client.
Deployment service allows users to manage deployments of Frameworks and Cloud Controls on a target resource.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewDeploymentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DeploymentClient) CancelOperation ¶
func (c *DeploymentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DeploymentClient) Close ¶
func (c *DeploymentClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DeploymentClient) Connection
deprecated
func (c *DeploymentClient) 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 (*DeploymentClient) CreateFrameworkDeployment ¶
func (c *DeploymentClient) CreateFrameworkDeployment(ctx context.Context, req *cloudsecuritycompliancepb.CreateFrameworkDeploymentRequest, opts ...gax.CallOption) (*CreateFrameworkDeploymentOperation, error)
CreateFrameworkDeployment creates a framework deployment in a given parent resource. A framework deployment lets you assign a particular framework version to an organization, folder, or project so that you can control and monitor those resources using the framework’s cloud controls.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.CreateFrameworkDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#CreateFrameworkDeploymentRequest.
}
op, err := c.CreateFrameworkDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DeploymentClient) CreateFrameworkDeploymentOperation ¶
func (c *DeploymentClient) CreateFrameworkDeploymentOperation(name string) *CreateFrameworkDeploymentOperation
CreateFrameworkDeploymentOperation returns a new CreateFrameworkDeploymentOperation from a given name. The name must be that of a previously created CreateFrameworkDeploymentOperation, possibly from a different process.
func (*DeploymentClient) DeleteFrameworkDeployment ¶
func (c *DeploymentClient) DeleteFrameworkDeployment(ctx context.Context, req *cloudsecuritycompliancepb.DeleteFrameworkDeploymentRequest, opts ...gax.CallOption) (*DeleteFrameworkDeploymentOperation, error)
DeleteFrameworkDeployment deletes a framework deployment.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.DeleteFrameworkDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#DeleteFrameworkDeploymentRequest.
}
op, err := c.DeleteFrameworkDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DeploymentClient) DeleteFrameworkDeploymentOperation ¶
func (c *DeploymentClient) DeleteFrameworkDeploymentOperation(name string) *DeleteFrameworkDeploymentOperation
DeleteFrameworkDeploymentOperation returns a new DeleteFrameworkDeploymentOperation from a given name. The name must be that of a previously created DeleteFrameworkDeploymentOperation, possibly from a different process.
func (*DeploymentClient) DeleteOperation ¶
func (c *DeploymentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DeploymentClient) GetCloudControlDeployment ¶
func (c *DeploymentClient) GetCloudControlDeployment(ctx context.Context, req *cloudsecuritycompliancepb.GetCloudControlDeploymentRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.CloudControlDeployment, error)
GetCloudControlDeployment gets details about a cloud control deployment.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.GetCloudControlDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#GetCloudControlDeploymentRequest.
}
resp, err := c.GetCloudControlDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DeploymentClient) GetFrameworkDeployment ¶
func (c *DeploymentClient) GetFrameworkDeployment(ctx context.Context, req *cloudsecuritycompliancepb.GetFrameworkDeploymentRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkDeployment, error)
GetFrameworkDeployment gets details about a framework deployment.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.GetFrameworkDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#GetFrameworkDeploymentRequest.
}
resp, err := c.GetFrameworkDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DeploymentClient) GetLocation ¶
func (c *DeploymentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewDeploymentClient(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 (*DeploymentClient) GetOperation ¶
func (c *DeploymentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DeploymentClient) ListCloudControlDeployments ¶
func (c *DeploymentClient) ListCloudControlDeployments(ctx context.Context, req *cloudsecuritycompliancepb.ListCloudControlDeploymentsRequest, opts ...gax.CallOption) *CloudControlDeploymentIterator
ListCloudControlDeployments lists the cloud conrol deployments in a given parent resource.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListCloudControlDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListCloudControlDeploymentsRequest.
}
it := c.ListCloudControlDeployments(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.(*cloudsecuritycompliancepb.ListCloudControlDeploymentsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListCloudControlDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListCloudControlDeploymentsRequest.
}
for resp, err := range c.ListCloudControlDeployments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DeploymentClient) ListFrameworkDeployments ¶
func (c *DeploymentClient) ListFrameworkDeployments(ctx context.Context, req *cloudsecuritycompliancepb.ListFrameworkDeploymentsRequest, opts ...gax.CallOption) *FrameworkDeploymentIterator
ListFrameworkDeployments lists the framework deployments in a given parent resource.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworkDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworkDeploymentsRequest.
}
it := c.ListFrameworkDeployments(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.(*cloudsecuritycompliancepb.ListFrameworkDeploymentsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworkDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworkDeploymentsRequest.
}
for resp, err := range c.ListFrameworkDeployments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DeploymentClient) ListLocations ¶
func (c *DeploymentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewDeploymentClient(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)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewDeploymentClient(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 (*DeploymentClient) ListOperations ¶
func (c *DeploymentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewDeploymentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type FindingSummaryIterator ¶
type FindingSummaryIterator 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 []*cloudsecuritycompliancepb.FindingSummary, nextPageToken string, err error)
// contains filtered or unexported fields
}
FindingSummaryIterator manages a stream of *cloudsecuritycompliancepb.FindingSummary.
func (*FindingSummaryIterator) All ¶
func (it *FindingSummaryIterator) All() iter.Seq2[*cloudsecuritycompliancepb.FindingSummary, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FindingSummaryIterator) Next ¶
func (it *FindingSummaryIterator) Next() (*cloudsecuritycompliancepb.FindingSummary, error)
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 (*FindingSummaryIterator) PageInfo ¶
func (it *FindingSummaryIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FrameworkAuditIterator ¶
type FrameworkAuditIterator 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 []*cloudsecuritycompliancepb.FrameworkAudit, nextPageToken string, err error)
// contains filtered or unexported fields
}
FrameworkAuditIterator manages a stream of *cloudsecuritycompliancepb.FrameworkAudit.
func (*FrameworkAuditIterator) All ¶
func (it *FrameworkAuditIterator) All() iter.Seq2[*cloudsecuritycompliancepb.FrameworkAudit, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FrameworkAuditIterator) Next ¶
func (it *FrameworkAuditIterator) Next() (*cloudsecuritycompliancepb.FrameworkAudit, error)
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 (*FrameworkAuditIterator) PageInfo ¶
func (it *FrameworkAuditIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FrameworkComplianceSummaryIterator ¶
type FrameworkComplianceSummaryIterator 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 []*cloudsecuritycompliancepb.FrameworkComplianceSummary, nextPageToken string, err error)
// contains filtered or unexported fields
}
FrameworkComplianceSummaryIterator manages a stream of *cloudsecuritycompliancepb.FrameworkComplianceSummary.
func (*FrameworkComplianceSummaryIterator) All ¶
func (it *FrameworkComplianceSummaryIterator) All() iter.Seq2[*cloudsecuritycompliancepb.FrameworkComplianceSummary, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FrameworkComplianceSummaryIterator) Next ¶
func (it *FrameworkComplianceSummaryIterator) Next() (*cloudsecuritycompliancepb.FrameworkComplianceSummary, error)
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 (*FrameworkComplianceSummaryIterator) PageInfo ¶
func (it *FrameworkComplianceSummaryIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FrameworkDeploymentIterator ¶
type FrameworkDeploymentIterator 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 []*cloudsecuritycompliancepb.FrameworkDeployment, nextPageToken string, err error)
// contains filtered or unexported fields
}
FrameworkDeploymentIterator manages a stream of *cloudsecuritycompliancepb.FrameworkDeployment.
func (*FrameworkDeploymentIterator) All ¶
func (it *FrameworkDeploymentIterator) All() iter.Seq2[*cloudsecuritycompliancepb.FrameworkDeployment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FrameworkDeploymentIterator) Next ¶
func (it *FrameworkDeploymentIterator) Next() (*cloudsecuritycompliancepb.FrameworkDeployment, error)
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 (*FrameworkDeploymentIterator) PageInfo ¶
func (it *FrameworkDeploymentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FrameworkIterator ¶
type FrameworkIterator 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 []*cloudsecuritycompliancepb.Framework, nextPageToken string, err error)
// contains filtered or unexported fields
}
FrameworkIterator manages a stream of *cloudsecuritycompliancepb.Framework.
func (*FrameworkIterator) All ¶
func (it *FrameworkIterator) All() iter.Seq2[*cloudsecuritycompliancepb.Framework, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FrameworkIterator) Next ¶
func (it *FrameworkIterator) Next() (*cloudsecuritycompliancepb.Framework, error)
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 (*FrameworkIterator) PageInfo ¶
func (it *FrameworkIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
func (it *LocationIterator) Next() (*locationpb.Location, error)
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.
type MonitoringCallOptions ¶
type MonitoringCallOptions struct {
ListFrameworkComplianceSummaries []gax.CallOption
ListFindingSummaries []gax.CallOption
FetchFrameworkComplianceReport []gax.CallOption
ListControlComplianceSummaries []gax.CallOption
AggregateFrameworkComplianceReport []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
MonitoringCallOptions contains the retry settings for each method of MonitoringClient.
type MonitoringClient ¶
type MonitoringClient struct {
// The call options for this service.
CallOptions *MonitoringCallOptions
// contains filtered or unexported fields
}
MonitoringClient is a client for interacting with Cloud Security Compliance API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewMonitoringClient ¶
func NewMonitoringClient(ctx context.Context, opts ...option.ClientOption) (*MonitoringClient, error)
NewMonitoringClient creates a new monitoring 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"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewMonitoringRESTClient ¶
func NewMonitoringRESTClient(ctx context.Context, opts ...option.ClientOption) (*MonitoringClient, error)
NewMonitoringRESTClient creates a new monitoring rest client.
Service describing handlers for resources
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewMonitoringRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*MonitoringClient) AggregateFrameworkComplianceReport ¶
func (c *MonitoringClient) AggregateFrameworkComplianceReport(ctx context.Context, req *cloudsecuritycompliancepb.AggregateFrameworkComplianceReportRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.AggregateFrameworkComplianceReportResponse, error)
AggregateFrameworkComplianceReport gets the aggregated compliance report over time for a given scope.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.AggregateFrameworkComplianceReportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#AggregateFrameworkComplianceReportRequest.
}
resp, err := c.AggregateFrameworkComplianceReport(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MonitoringClient) CancelOperation ¶
func (c *MonitoringClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*MonitoringClient) Close ¶
func (c *MonitoringClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*MonitoringClient) Connection
deprecated
func (c *MonitoringClient) 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 (*MonitoringClient) DeleteOperation ¶
func (c *MonitoringClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*MonitoringClient) FetchFrameworkComplianceReport ¶
func (c *MonitoringClient) FetchFrameworkComplianceReport(ctx context.Context, req *cloudsecuritycompliancepb.FetchFrameworkComplianceReportRequest, opts ...gax.CallOption) (*cloudsecuritycompliancepb.FrameworkComplianceReport, error)
FetchFrameworkComplianceReport fetches the framework compliance report for a given scope.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.FetchFrameworkComplianceReportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#FetchFrameworkComplianceReportRequest.
}
resp, err := c.FetchFrameworkComplianceReport(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MonitoringClient) GetLocation ¶
func (c *MonitoringClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewMonitoringClient(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 (*MonitoringClient) GetOperation ¶
func (c *MonitoringClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*MonitoringClient) ListControlComplianceSummaries ¶
func (c *MonitoringClient) ListControlComplianceSummaries(ctx context.Context, req *cloudsecuritycompliancepb.ListControlComplianceSummariesRequest, opts ...gax.CallOption) *ControlComplianceSummaryIterator
ListControlComplianceSummaries lists the control compliance summary for a given scope.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListControlComplianceSummariesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListControlComplianceSummariesRequest.
}
it := c.ListControlComplianceSummaries(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.(*cloudsecuritycompliancepb.ListControlComplianceSummariesResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListControlComplianceSummariesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListControlComplianceSummariesRequest.
}
for resp, err := range c.ListControlComplianceSummaries(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*MonitoringClient) ListFindingSummaries ¶
func (c *MonitoringClient) ListFindingSummaries(ctx context.Context, req *cloudsecuritycompliancepb.ListFindingSummariesRequest, opts ...gax.CallOption) *FindingSummaryIterator
ListFindingSummaries lists the finding summary by category for a given scope.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFindingSummariesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFindingSummariesRequest.
}
it := c.ListFindingSummaries(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.(*cloudsecuritycompliancepb.ListFindingSummariesResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFindingSummariesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFindingSummariesRequest.
}
for resp, err := range c.ListFindingSummaries(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*MonitoringClient) ListFrameworkComplianceSummaries ¶
func (c *MonitoringClient) ListFrameworkComplianceSummaries(ctx context.Context, req *cloudsecuritycompliancepb.ListFrameworkComplianceSummariesRequest, opts ...gax.CallOption) *FrameworkComplianceSummaryIterator
ListFrameworkComplianceSummaries lists the framework compliance summary for a given scope.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
"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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworkComplianceSummariesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworkComplianceSummariesRequest.
}
it := c.ListFrameworkComplianceSummaries(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.(*cloudsecuritycompliancepb.ListFrameworkComplianceSummariesResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
cloudsecuritycompliancepb "cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudsecuritycompliancepb.ListFrameworkComplianceSummariesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudsecuritycompliance/apiv1/cloudsecuritycompliancepb#ListFrameworkComplianceSummariesRequest.
}
for resp, err := range c.ListFrameworkComplianceSummaries(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*MonitoringClient) ListLocations ¶
func (c *MonitoringClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewMonitoringClient(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)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/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 := cloudsecuritycompliance.NewMonitoringClient(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 (*MonitoringClient) ListOperations ¶
func (c *MonitoringClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
}
}
Example (All) ¶
package main
import (
"context"
cloudsecuritycompliance "cloud.google.com/go/cloudsecuritycompliance/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
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 := cloudsecuritycompliance.NewMonitoringClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type OperationIterator ¶
type OperationIterator 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 []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
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 (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.