Documentation
¶
Overview ¶
Package storageinsights is an auto-generated package for the Storage Insights API.
Provides insights capability on Google Cloud Storage ¶
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/storageinsights/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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client, mentioned above.
req := &storageinsightspb.CreateDatasetConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#CreateDatasetConfigRequest.
}
op, err := c.CreateDatasetConfig(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 NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateDatasetConfig(ctx context.Context, req *storageinsightspb.CreateDatasetConfigRequest, ...) (*CreateDatasetConfigOperation, error)
- func (c *Client) CreateDatasetConfigOperation(name string) *CreateDatasetConfigOperation
- func (c *Client) CreateReportConfig(ctx context.Context, req *storageinsightspb.CreateReportConfigRequest, ...) (*storageinsightspb.ReportConfig, error)
- func (c *Client) DeleteDatasetConfig(ctx context.Context, req *storageinsightspb.DeleteDatasetConfigRequest, ...) (*DeleteDatasetConfigOperation, error)
- func (c *Client) DeleteDatasetConfigOperation(name string) *DeleteDatasetConfigOperation
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DeleteReportConfig(ctx context.Context, req *storageinsightspb.DeleteReportConfigRequest, ...) error
- func (c *Client) GetDatasetConfig(ctx context.Context, req *storageinsightspb.GetDatasetConfigRequest, ...) (*storageinsightspb.DatasetConfig, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetReportConfig(ctx context.Context, req *storageinsightspb.GetReportConfigRequest, ...) (*storageinsightspb.ReportConfig, error)
- func (c *Client) GetReportDetail(ctx context.Context, req *storageinsightspb.GetReportDetailRequest, ...) (*storageinsightspb.ReportDetail, error)
- func (c *Client) LinkDataset(ctx context.Context, req *storageinsightspb.LinkDatasetRequest, ...) (*LinkDatasetOperation, error)
- func (c *Client) LinkDatasetOperation(name string) *LinkDatasetOperation
- func (c *Client) ListDatasetConfigs(ctx context.Context, req *storageinsightspb.ListDatasetConfigsRequest, ...) *DatasetConfigIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) ListReportConfigs(ctx context.Context, req *storageinsightspb.ListReportConfigsRequest, ...) *ReportConfigIterator
- func (c *Client) ListReportDetails(ctx context.Context, req *storageinsightspb.ListReportDetailsRequest, ...) *ReportDetailIterator
- func (c *Client) UnlinkDataset(ctx context.Context, req *storageinsightspb.UnlinkDatasetRequest, ...) (*UnlinkDatasetOperation, error)
- func (c *Client) UnlinkDatasetOperation(name string) *UnlinkDatasetOperation
- func (c *Client) UpdateDatasetConfig(ctx context.Context, req *storageinsightspb.UpdateDatasetConfigRequest, ...) (*UpdateDatasetConfigOperation, error)
- func (c *Client) UpdateDatasetConfigOperation(name string) *UpdateDatasetConfigOperation
- func (c *Client) UpdateReportConfig(ctx context.Context, req *storageinsightspb.UpdateReportConfigRequest, ...) (*storageinsightspb.ReportConfig, error)
- type CreateDatasetConfigOperation
- func (op *CreateDatasetConfigOperation) Done() bool
- func (op *CreateDatasetConfigOperation) Metadata() (*storageinsightspb.OperationMetadata, error)
- func (op *CreateDatasetConfigOperation) Name() string
- func (op *CreateDatasetConfigOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, error)
- func (op *CreateDatasetConfigOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, error)
- type DatasetConfigIterator
- type DeleteDatasetConfigOperation
- func (op *DeleteDatasetConfigOperation) Done() bool
- func (op *DeleteDatasetConfigOperation) Metadata() (*storageinsightspb.OperationMetadata, error)
- func (op *DeleteDatasetConfigOperation) Name() string
- func (op *DeleteDatasetConfigOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteDatasetConfigOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type LinkDatasetOperation
- func (op *LinkDatasetOperation) Done() bool
- func (op *LinkDatasetOperation) Metadata() (*storageinsightspb.OperationMetadata, error)
- func (op *LinkDatasetOperation) Name() string
- func (op *LinkDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.LinkDatasetResponse, error)
- func (op *LinkDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.LinkDatasetResponse, error)
- type LocationIterator
- type OperationIterator
- type ReportConfigIterator
- type ReportDetailIterator
- type UnlinkDatasetOperation
- func (op *UnlinkDatasetOperation) Done() bool
- func (op *UnlinkDatasetOperation) Metadata() (*storageinsightspb.OperationMetadata, error)
- func (op *UnlinkDatasetOperation) Name() string
- func (op *UnlinkDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *UnlinkDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type UpdateDatasetConfigOperation
- func (op *UpdateDatasetConfigOperation) Done() bool
- func (op *UpdateDatasetConfigOperation) Metadata() (*storageinsightspb.OperationMetadata, error)
- func (op *UpdateDatasetConfigOperation) Name() string
- func (op *UpdateDatasetConfigOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, error)
- func (op *UpdateDatasetConfigOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, error)
Examples ¶
- Client.CancelOperation
- Client.CreateDatasetConfig
- Client.CreateReportConfig
- Client.DeleteDatasetConfig
- Client.DeleteOperation
- Client.DeleteReportConfig
- Client.GetDatasetConfig
- Client.GetLocation
- Client.GetOperation
- Client.GetReportConfig
- Client.GetReportDetail
- Client.LinkDataset
- Client.ListDatasetConfigs
- Client.ListDatasetConfigs (All)
- Client.ListLocations
- Client.ListLocations (All)
- Client.ListOperations
- Client.ListOperations (All)
- Client.ListReportConfigs
- Client.ListReportConfigs (All)
- Client.ListReportDetails
- Client.ListReportDetails (All)
- Client.UnlinkDataset
- Client.UpdateDatasetConfig
- Client.UpdateReportConfig
- NewClient
- NewRESTClient
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 CallOptions ¶
type CallOptions struct {
ListReportConfigs []gax.CallOption
GetReportConfig []gax.CallOption
CreateReportConfig []gax.CallOption
UpdateReportConfig []gax.CallOption
DeleteReportConfig []gax.CallOption
ListReportDetails []gax.CallOption
GetReportDetail []gax.CallOption
ListDatasetConfigs []gax.CallOption
GetDatasetConfig []gax.CallOption
CreateDatasetConfig []gax.CallOption
UpdateDatasetConfig []gax.CallOption
DeleteDatasetConfig []gax.CallOption
LinkDataset []gax.CallOption
UnlinkDataset []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// 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
}
Client is a client for interacting with Storage Insights API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewClient ¶
NewClient creates a new storage insights 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"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func NewRESTClient ¶
NewRESTClient creates a new storage insights rest client.
Service describing handlers for resources
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
Output:
func (*Client) CancelOperation ¶
func (c *Client) 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"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(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.
}
}
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateDatasetConfig ¶ added in v1.2.0
func (c *Client) CreateDatasetConfig(ctx context.Context, req *storageinsightspb.CreateDatasetConfigRequest, opts ...gax.CallOption) (*CreateDatasetConfigOperation, error)
CreateDatasetConfig creates a dataset configuration in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.CreateDatasetConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#CreateDatasetConfigRequest.
}
op, err := c.CreateDatasetConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) CreateDatasetConfigOperation ¶ added in v1.2.0
func (c *Client) CreateDatasetConfigOperation(name string) *CreateDatasetConfigOperation
CreateDatasetConfigOperation returns a new CreateDatasetConfigOperation from a given name. The name must be that of a previously created CreateDatasetConfigOperation, possibly from a different process.
func (*Client) CreateReportConfig ¶
func (c *Client) CreateReportConfig(ctx context.Context, req *storageinsightspb.CreateReportConfigRequest, opts ...gax.CallOption) (*storageinsightspb.ReportConfig, error)
CreateReportConfig creates a new ReportConfig in a given project and location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.CreateReportConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#CreateReportConfigRequest.
}
resp, err := c.CreateReportConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) DeleteDatasetConfig ¶ added in v1.2.0
func (c *Client) DeleteDatasetConfig(ctx context.Context, req *storageinsightspb.DeleteDatasetConfigRequest, opts ...gax.CallOption) (*DeleteDatasetConfigOperation, error)
DeleteDatasetConfig deletes a dataset configuration in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.DeleteDatasetConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#DeleteDatasetConfigRequest.
}
op, err := c.DeleteDatasetConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
Output:
func (*Client) DeleteDatasetConfigOperation ¶ added in v1.2.0
func (c *Client) DeleteDatasetConfigOperation(name string) *DeleteDatasetConfigOperation
DeleteDatasetConfigOperation returns a new DeleteDatasetConfigOperation from a given name. The name must be that of a previously created DeleteDatasetConfigOperation, possibly from a different process.
func (*Client) DeleteOperation ¶
func (c *Client) 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"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(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.
}
}
Output:
func (*Client) DeleteReportConfig ¶
func (c *Client) DeleteReportConfig(ctx context.Context, req *storageinsightspb.DeleteReportConfigRequest, opts ...gax.CallOption) error
DeleteReportConfig deletes a single ReportConfig.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.DeleteReportConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#DeleteReportConfigRequest.
}
err = c.DeleteReportConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
Output:
func (*Client) GetDatasetConfig ¶ added in v1.2.0
func (c *Client) GetDatasetConfig(ctx context.Context, req *storageinsightspb.GetDatasetConfigRequest, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, error)
GetDatasetConfig gets the dataset configuration in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.GetDatasetConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#GetDatasetConfigRequest.
}
resp, err := c.GetDatasetConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetLocation ¶
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetOperation ¶
func (c *Client) 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"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(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
}
Output:
func (*Client) GetReportConfig ¶
func (c *Client) GetReportConfig(ctx context.Context, req *storageinsightspb.GetReportConfigRequest, opts ...gax.CallOption) (*storageinsightspb.ReportConfig, error)
GetReportConfig gets details of a single ReportConfig.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.GetReportConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#GetReportConfigRequest.
}
resp, err := c.GetReportConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) GetReportDetail ¶
func (c *Client) GetReportDetail(ctx context.Context, req *storageinsightspb.GetReportDetailRequest, opts ...gax.CallOption) (*storageinsightspb.ReportDetail, error)
GetReportDetail gets details of a single ReportDetail.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.GetReportDetailRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#GetReportDetailRequest.
}
resp, err := c.GetReportDetail(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) LinkDataset ¶ added in v1.2.0
func (c *Client) LinkDataset(ctx context.Context, req *storageinsightspb.LinkDatasetRequest, opts ...gax.CallOption) (*LinkDatasetOperation, error)
LinkDataset links a dataset to BigQuery in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.LinkDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#LinkDatasetRequest.
}
op, err := c.LinkDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) LinkDatasetOperation ¶ added in v1.2.0
func (c *Client) LinkDatasetOperation(name string) *LinkDatasetOperation
LinkDatasetOperation returns a new LinkDatasetOperation from a given name. The name must be that of a previously created LinkDatasetOperation, possibly from a different process.
func (*Client) ListDatasetConfigs ¶ added in v1.2.0
func (c *Client) ListDatasetConfigs(ctx context.Context, req *storageinsightspb.ListDatasetConfigsRequest, opts ...gax.CallOption) *DatasetConfigIterator
ListDatasetConfigs lists the dataset configurations in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
"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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.ListDatasetConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#ListDatasetConfigsRequest.
}
it := c.ListDatasetConfigs(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.(*storageinsightspb.ListDatasetConfigsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.ListDatasetConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#ListDatasetConfigsRequest.
}
for resp, err := range c.ListDatasetConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListLocations ¶
func (c *Client) 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"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListOperations ¶
func (c *Client) 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"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
"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 := storageinsights.NewClient(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)
}
}
Output:
Example (All) ¶
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
storageinsights "cloud.google.com/go/storageinsights/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 := storageinsights.NewClient(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
}
}
Output:
func (*Client) ListReportConfigs ¶
func (c *Client) ListReportConfigs(ctx context.Context, req *storageinsightspb.ListReportConfigsRequest, opts ...gax.CallOption) *ReportConfigIterator
ListReportConfigs lists ReportConfigs in a given project and location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
"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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.ListReportConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#ListReportConfigsRequest.
}
it := c.ListReportConfigs(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.(*storageinsightspb.ListReportConfigsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.ListReportConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#ListReportConfigsRequest.
}
for resp, err := range c.ListReportConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListReportDetails ¶
func (c *Client) ListReportDetails(ctx context.Context, req *storageinsightspb.ListReportDetailsRequest, opts ...gax.CallOption) *ReportDetailIterator
ListReportDetails lists ReportDetails in a given project and location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
"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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.ListReportDetailsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#ListReportDetailsRequest.
}
it := c.ListReportDetails(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.(*storageinsightspb.ListReportDetailsResponse)
}
}
Output:
Example (All) ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.ListReportDetailsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#ListReportDetailsRequest.
}
for resp, err := range c.ListReportDetails(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) UnlinkDataset ¶ added in v1.2.0
func (c *Client) UnlinkDataset(ctx context.Context, req *storageinsightspb.UnlinkDatasetRequest, opts ...gax.CallOption) (*UnlinkDatasetOperation, error)
UnlinkDataset unlinks a dataset from BigQuery in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.UnlinkDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#UnlinkDatasetRequest.
}
op, err := c.UnlinkDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
Output:
func (*Client) UnlinkDatasetOperation ¶ added in v1.2.0
func (c *Client) UnlinkDatasetOperation(name string) *UnlinkDatasetOperation
UnlinkDatasetOperation returns a new UnlinkDatasetOperation from a given name. The name must be that of a previously created UnlinkDatasetOperation, possibly from a different process.
func (*Client) UpdateDatasetConfig ¶ added in v1.2.0
func (c *Client) UpdateDatasetConfig(ctx context.Context, req *storageinsightspb.UpdateDatasetConfigRequest, opts ...gax.CallOption) (*UpdateDatasetConfigOperation, error)
UpdateDatasetConfig updates a dataset configuration in a given project for a given location.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.UpdateDatasetConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#UpdateDatasetConfigRequest.
}
op, err := c.UpdateDatasetConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
func (*Client) UpdateDatasetConfigOperation ¶ added in v1.2.0
func (c *Client) UpdateDatasetConfigOperation(name string) *UpdateDatasetConfigOperation
UpdateDatasetConfigOperation returns a new UpdateDatasetConfigOperation from a given name. The name must be that of a previously created UpdateDatasetConfigOperation, possibly from a different process.
func (*Client) UpdateReportConfig ¶
func (c *Client) UpdateReportConfig(ctx context.Context, req *storageinsightspb.UpdateReportConfigRequest, opts ...gax.CallOption) (*storageinsightspb.ReportConfig, error)
UpdateReportConfig updates the parameters of a single ReportConfig.
Example ¶
package main
import (
"context"
storageinsights "cloud.google.com/go/storageinsights/apiv1"
storageinsightspb "cloud.google.com/go/storageinsights/apiv1/storageinsightspb"
)
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 := storageinsights.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &storageinsightspb.UpdateReportConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/storageinsights/apiv1/storageinsightspb#UpdateReportConfigRequest.
}
resp, err := c.UpdateReportConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Output:
type CreateDatasetConfigOperation ¶ added in v1.2.0
type CreateDatasetConfigOperation struct {
// contains filtered or unexported fields
}
CreateDatasetConfigOperation manages a long-running operation from CreateDatasetConfig.
func (*CreateDatasetConfigOperation) Done ¶ added in v1.2.0
func (op *CreateDatasetConfigOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateDatasetConfigOperation) Metadata ¶ added in v1.2.0
func (op *CreateDatasetConfigOperation) Metadata() (*storageinsightspb.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 (*CreateDatasetConfigOperation) Name ¶ added in v1.2.0
func (op *CreateDatasetConfigOperation) 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 (*CreateDatasetConfigOperation) Poll ¶ added in v1.2.0
func (op *CreateDatasetConfigOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, 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 (*CreateDatasetConfigOperation) Wait ¶ added in v1.2.0
func (op *CreateDatasetConfigOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, 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 DatasetConfigIterator ¶ added in v1.2.0
type DatasetConfigIterator 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 []*storageinsightspb.DatasetConfig, nextPageToken string, err error)
// contains filtered or unexported fields
}
DatasetConfigIterator manages a stream of *storageinsightspb.DatasetConfig.
func (*DatasetConfigIterator) All ¶ added in v1.2.0
func (it *DatasetConfigIterator) All() iter.Seq2[*storageinsightspb.DatasetConfig, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DatasetConfigIterator) Next ¶ added in v1.2.0
func (it *DatasetConfigIterator) Next() (*storageinsightspb.DatasetConfig, 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 (*DatasetConfigIterator) PageInfo ¶ added in v1.2.0
func (it *DatasetConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DeleteDatasetConfigOperation ¶ added in v1.2.0
type DeleteDatasetConfigOperation struct {
// contains filtered or unexported fields
}
DeleteDatasetConfigOperation manages a long-running operation from DeleteDatasetConfig.
func (*DeleteDatasetConfigOperation) Done ¶ added in v1.2.0
func (op *DeleteDatasetConfigOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteDatasetConfigOperation) Metadata ¶ added in v1.2.0
func (op *DeleteDatasetConfigOperation) Metadata() (*storageinsightspb.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 (*DeleteDatasetConfigOperation) Name ¶ added in v1.2.0
func (op *DeleteDatasetConfigOperation) 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 (*DeleteDatasetConfigOperation) Poll ¶ added in v1.2.0
func (op *DeleteDatasetConfigOperation) 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 (*DeleteDatasetConfigOperation) Wait ¶ added in v1.2.0
func (op *DeleteDatasetConfigOperation) 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 LinkDatasetOperation ¶ added in v1.2.0
type LinkDatasetOperation struct {
// contains filtered or unexported fields
}
LinkDatasetOperation manages a long-running operation from LinkDataset.
func (*LinkDatasetOperation) Done ¶ added in v1.2.0
func (op *LinkDatasetOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*LinkDatasetOperation) Metadata ¶ added in v1.2.0
func (op *LinkDatasetOperation) Metadata() (*storageinsightspb.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 (*LinkDatasetOperation) Name ¶ added in v1.2.0
func (op *LinkDatasetOperation) 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 (*LinkDatasetOperation) Poll ¶ added in v1.2.0
func (op *LinkDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.LinkDatasetResponse, 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 (*LinkDatasetOperation) Wait ¶ added in v1.2.0
func (op *LinkDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.LinkDatasetResponse, 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 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 ¶ added in v1.1.0
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 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 ¶ added in v1.1.0
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.
type ReportConfigIterator ¶
type ReportConfigIterator 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 []*storageinsightspb.ReportConfig, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReportConfigIterator manages a stream of *storageinsightspb.ReportConfig.
func (*ReportConfigIterator) All ¶ added in v1.1.0
func (it *ReportConfigIterator) All() iter.Seq2[*storageinsightspb.ReportConfig, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReportConfigIterator) Next ¶
func (it *ReportConfigIterator) Next() (*storageinsightspb.ReportConfig, 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 (*ReportConfigIterator) PageInfo ¶
func (it *ReportConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReportDetailIterator ¶
type ReportDetailIterator 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 []*storageinsightspb.ReportDetail, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReportDetailIterator manages a stream of *storageinsightspb.ReportDetail.
func (*ReportDetailIterator) All ¶ added in v1.1.0
func (it *ReportDetailIterator) All() iter.Seq2[*storageinsightspb.ReportDetail, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReportDetailIterator) Next ¶
func (it *ReportDetailIterator) Next() (*storageinsightspb.ReportDetail, 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 (*ReportDetailIterator) PageInfo ¶
func (it *ReportDetailIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UnlinkDatasetOperation ¶ added in v1.2.0
type UnlinkDatasetOperation struct {
// contains filtered or unexported fields
}
UnlinkDatasetOperation manages a long-running operation from UnlinkDataset.
func (*UnlinkDatasetOperation) Done ¶ added in v1.2.0
func (op *UnlinkDatasetOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UnlinkDatasetOperation) Metadata ¶ added in v1.2.0
func (op *UnlinkDatasetOperation) Metadata() (*storageinsightspb.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 (*UnlinkDatasetOperation) Name ¶ added in v1.2.0
func (op *UnlinkDatasetOperation) 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 (*UnlinkDatasetOperation) Poll ¶ added in v1.2.0
func (op *UnlinkDatasetOperation) 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 (*UnlinkDatasetOperation) Wait ¶ added in v1.2.0
func (op *UnlinkDatasetOperation) 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 UpdateDatasetConfigOperation ¶ added in v1.2.0
type UpdateDatasetConfigOperation struct {
// contains filtered or unexported fields
}
UpdateDatasetConfigOperation manages a long-running operation from UpdateDatasetConfig.
func (*UpdateDatasetConfigOperation) Done ¶ added in v1.2.0
func (op *UpdateDatasetConfigOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateDatasetConfigOperation) Metadata ¶ added in v1.2.0
func (op *UpdateDatasetConfigOperation) Metadata() (*storageinsightspb.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 (*UpdateDatasetConfigOperation) Name ¶ added in v1.2.0
func (op *UpdateDatasetConfigOperation) 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 (*UpdateDatasetConfigOperation) Poll ¶ added in v1.2.0
func (op *UpdateDatasetConfigOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, 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 (*UpdateDatasetConfigOperation) Wait ¶ added in v1.2.0
func (op *UpdateDatasetConfigOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*storageinsightspb.DatasetConfig, 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.