Package datastream is an auto-generated package for the Datastream API.
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/datastream/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 := datastream.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 := &datastreampb.CreateConnectionProfileRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#CreateConnectionProfileRequest. } op, err := c.CreateConnectionProfile(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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CallOptions
type CallOptions struct {
ListConnectionProfiles []gax.CallOption
GetConnectionProfile []gax.CallOption
CreateConnectionProfile []gax.CallOption
UpdateConnectionProfile []gax.CallOption
DeleteConnectionProfile []gax.CallOption
DiscoverConnectionProfile []gax.CallOption
ListStreams []gax.CallOption
GetStream []gax.CallOption
CreateStream []gax.CallOption
UpdateStream []gax.CallOption
DeleteStream []gax.CallOption
RunStream []gax.CallOption
GetStreamObject []gax.CallOption
LookupStreamObject []gax.CallOption
ListStreamObjects []gax.CallOption
StartBackfillJob []gax.CallOption
StopBackfillJob []gax.CallOption
FetchStaticIps []gax.CallOption
CreatePrivateConnection []gax.CallOption
GetPrivateConnection []gax.CallOption
ListPrivateConnections []gax.CallOption
DeletePrivateConnection []gax.CallOption
CreateRoute []gax.CallOption
GetRoute []gax.CallOption
ListRoutes []gax.CallOption
DeleteRoute []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.
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 Datastream API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Datastream service
func NewClient
NewClient creates a new datastream client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Datastream service
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient
NewRESTClient creates a new datastream rest client.
Datastream service
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/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 := datastream.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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"
datastream "cloud.google.com/go/datastream/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 := datastream.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.
}
}
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) CreateConnectionProfile
func (c *Client) CreateConnectionProfile(ctx context.Context, req *datastreampb.CreateConnectionProfileRequest, opts ...gax.CallOption) (*CreateConnectionProfileOperation, error)
CreateConnectionProfile use this method to create a connection profile in a project and location.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreateConnectionProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#CreateConnectionProfileRequest.
}
op, err := c.CreateConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateConnectionProfileOperation
func (c *Client) CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation
CreateConnectionProfileOperation returns a new CreateConnectionProfileOperation from a given name. The name must be that of a previously created CreateConnectionProfileOperation, possibly from a different process.
func (*Client) CreatePrivateConnection
func (c *Client) CreatePrivateConnection(ctx context.Context, req *datastreampb.CreatePrivateConnectionRequest, opts ...gax.CallOption) (*CreatePrivateConnectionOperation, error)
CreatePrivateConnection use this method to create a private connectivity configuration.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreatePrivateConnectionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#CreatePrivateConnectionRequest.
}
op, err := c.CreatePrivateConnection(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreatePrivateConnectionOperation
func (c *Client) CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation
CreatePrivateConnectionOperation returns a new CreatePrivateConnectionOperation from a given name. The name must be that of a previously created CreatePrivateConnectionOperation, possibly from a different process.
func (*Client) CreateRoute
func (c *Client) CreateRoute(ctx context.Context, req *datastreampb.CreateRouteRequest, opts ...gax.CallOption) (*CreateRouteOperation, error)
CreateRoute use this method to create a route for a private connectivity configuration in a project and location.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreateRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#CreateRouteRequest.
}
op, err := c.CreateRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateRouteOperation
func (c *Client) CreateRouteOperation(name string) *CreateRouteOperation
CreateRouteOperation returns a new CreateRouteOperation from a given name. The name must be that of a previously created CreateRouteOperation, possibly from a different process.
func (*Client) CreateStream
func (c *Client) CreateStream(ctx context.Context, req *datastreampb.CreateStreamRequest, opts ...gax.CallOption) (*CreateStreamOperation, error)
CreateStream use this method to create a stream.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreateStreamRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#CreateStreamRequest.
}
op, err := c.CreateStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateStreamOperation
func (c *Client) CreateStreamOperation(name string) *CreateStreamOperation
CreateStreamOperation returns a new CreateStreamOperation from a given name. The name must be that of a previously created CreateStreamOperation, possibly from a different process.
func (*Client) DeleteConnectionProfile
func (c *Client) DeleteConnectionProfile(ctx context.Context, req *datastreampb.DeleteConnectionProfileRequest, opts ...gax.CallOption) (*DeleteConnectionProfileOperation, error)
DeleteConnectionProfile use this method to delete a connection profile.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeleteConnectionProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#DeleteConnectionProfileRequest.
}
op, err := c.DeleteConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteConnectionProfileOperation
func (c *Client) DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation
DeleteConnectionProfileOperation returns a new DeleteConnectionProfileOperation from a given name. The name must be that of a previously created DeleteConnectionProfileOperation, 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"
datastream "cloud.google.com/go/datastream/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 := datastream.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.
}
}
func (*Client) DeletePrivateConnection
func (c *Client) DeletePrivateConnection(ctx context.Context, req *datastreampb.DeletePrivateConnectionRequest, opts ...gax.CallOption) (*DeletePrivateConnectionOperation, error)
DeletePrivateConnection use this method to delete a private connectivity configuration.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeletePrivateConnectionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#DeletePrivateConnectionRequest.
}
op, err := c.DeletePrivateConnection(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeletePrivateConnectionOperation
func (c *Client) DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation
DeletePrivateConnectionOperation returns a new DeletePrivateConnectionOperation from a given name. The name must be that of a previously created DeletePrivateConnectionOperation, possibly from a different process.
func (*Client) DeleteRoute
func (c *Client) DeleteRoute(ctx context.Context, req *datastreampb.DeleteRouteRequest, opts ...gax.CallOption) (*DeleteRouteOperation, error)
DeleteRoute use this method to delete a route.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeleteRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#DeleteRouteRequest.
}
op, err := c.DeleteRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteRouteOperation
func (c *Client) DeleteRouteOperation(name string) *DeleteRouteOperation
DeleteRouteOperation returns a new DeleteRouteOperation from a given name. The name must be that of a previously created DeleteRouteOperation, possibly from a different process.
func (*Client) DeleteStream
func (c *Client) DeleteStream(ctx context.Context, req *datastreampb.DeleteStreamRequest, opts ...gax.CallOption) (*DeleteStreamOperation, error)
DeleteStream use this method to delete a stream.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeleteStreamRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#DeleteStreamRequest.
}
op, err := c.DeleteStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteStreamOperation
func (c *Client) DeleteStreamOperation(name string) *DeleteStreamOperation
DeleteStreamOperation returns a new DeleteStreamOperation from a given name. The name must be that of a previously created DeleteStreamOperation, possibly from a different process.
func (*Client) DiscoverConnectionProfile
func (c *Client) DiscoverConnectionProfile(ctx context.Context, req *datastreampb.DiscoverConnectionProfileRequest, opts ...gax.CallOption) (*datastreampb.DiscoverConnectionProfileResponse, error)
DiscoverConnectionProfile use this method to discover a connection profile. The discover API call exposes the data objects and metadata belonging to the profile. Typically, a request returns children data objects of a parent data object that’s optionally supplied in the request.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DiscoverConnectionProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#DiscoverConnectionProfileRequest.
}
resp, err := c.DiscoverConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) FetchStaticIps
func (c *Client) FetchStaticIps(ctx context.Context, req *datastreampb.FetchStaticIpsRequest, opts ...gax.CallOption) *StringIterator
FetchStaticIps the FetchStaticIps API call exposes the static IP addresses used by Datastream.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
"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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.FetchStaticIpsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#FetchStaticIpsRequest.
}
it := c.FetchStaticIps(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.(*datastreampb.FetchStaticIpsResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.FetchStaticIpsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#FetchStaticIpsRequest.
}
for resp, err := range c.FetchStaticIps(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) GetConnectionProfile
func (c *Client) GetConnectionProfile(ctx context.Context, req *datastreampb.GetConnectionProfileRequest, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, error)
GetConnectionProfile use this method to get details about a connection profile.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetConnectionProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#GetConnectionProfileRequest.
}
resp, err := c.GetConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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"
datastream "cloud.google.com/go/datastream/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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) 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"
datastream "cloud.google.com/go/datastream/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 := datastream.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
}
func (*Client) GetPrivateConnection
func (c *Client) GetPrivateConnection(ctx context.Context, req *datastreampb.GetPrivateConnectionRequest, opts ...gax.CallOption) (*datastreampb.PrivateConnection, error)
GetPrivateConnection use this method to get details about a private connectivity configuration.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetPrivateConnectionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#GetPrivateConnectionRequest.
}
resp, err := c.GetPrivateConnection(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetRoute
func (c *Client) GetRoute(ctx context.Context, req *datastreampb.GetRouteRequest, opts ...gax.CallOption) (*datastreampb.Route, error)
GetRoute use this method to get details about a route.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#GetRouteRequest.
}
resp, err := c.GetRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetStream
func (c *Client) GetStream(ctx context.Context, req *datastreampb.GetStreamRequest, opts ...gax.CallOption) (*datastreampb.Stream, error)
GetStream use this method to get details about a stream.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetStreamRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#GetStreamRequest.
}
resp, err := c.GetStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetStreamObject
func (c *Client) GetStreamObject(ctx context.Context, req *datastreampb.GetStreamObjectRequest, opts ...gax.CallOption) (*datastreampb.StreamObject, error)
GetStreamObject use this method to get details about a stream object.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetStreamObjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#GetStreamObjectRequest.
}
resp, err := c.GetStreamObject(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListConnectionProfiles
func (c *Client) ListConnectionProfiles(ctx context.Context, req *datastreampb.ListConnectionProfilesRequest, opts ...gax.CallOption) *ConnectionProfileIterator
ListConnectionProfiles use this method to list connection profiles created in a project and location.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
"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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListConnectionProfilesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListConnectionProfilesRequest.
}
it := c.ListConnectionProfiles(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.(*datastreampb.ListConnectionProfilesResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListConnectionProfilesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListConnectionProfilesRequest.
}
for resp, err := range c.ListConnectionProfiles(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/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 := datastream.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.
}
// TODO: Use resp.
_ = resp
}
}
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.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/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 := datastream.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)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/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 := datastream.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.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListPrivateConnections
func (c *Client) ListPrivateConnections(ctx context.Context, req *datastreampb.ListPrivateConnectionsRequest, opts ...gax.CallOption) *PrivateConnectionIterator
ListPrivateConnections use this method to list private connectivity configurations in a project and location.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
"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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListPrivateConnectionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListPrivateConnectionsRequest.
}
it := c.ListPrivateConnections(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.(*datastreampb.ListPrivateConnectionsResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListPrivateConnectionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListPrivateConnectionsRequest.
}
for resp, err := range c.ListPrivateConnections(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListRoutes
func (c *Client) ListRoutes(ctx context.Context, req *datastreampb.ListRoutesRequest, opts ...gax.CallOption) *RouteIterator
ListRoutes use this method to list routes created for a private connectivity configuration in a project and location.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
"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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListRoutesRequest.
}
it := c.ListRoutes(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.(*datastreampb.ListRoutesResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListRoutesRequest.
}
for resp, err := range c.ListRoutes(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListStreamObjects
func (c *Client) ListStreamObjects(ctx context.Context, req *datastreampb.ListStreamObjectsRequest, opts ...gax.CallOption) *StreamObjectIterator
ListStreamObjects use this method to list the objects of a specific stream.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
"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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListStreamObjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListStreamObjectsRequest.
}
it := c.ListStreamObjects(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.(*datastreampb.ListStreamObjectsResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListStreamObjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListStreamObjectsRequest.
}
for resp, err := range c.ListStreamObjects(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListStreams
func (c *Client) ListStreams(ctx context.Context, req *datastreampb.ListStreamsRequest, opts ...gax.CallOption) *StreamIterator
ListStreams use this method to list streams in a project and location.
Examples
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
"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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListStreamsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListStreamsRequest.
}
it := c.ListStreams(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.(*datastreampb.ListStreamsResponse)
}
}
all
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListStreamsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#ListStreamsRequest.
}
for resp, err := range c.ListStreams(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) LookupStreamObject
func (c *Client) LookupStreamObject(ctx context.Context, req *datastreampb.LookupStreamObjectRequest, opts ...gax.CallOption) (*datastreampb.StreamObject, error)
LookupStreamObject use this method to look up a stream object by its source object identifier.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.LookupStreamObjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#LookupStreamObjectRequest.
}
resp, err := c.LookupStreamObject(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) RunStream
func (c *Client) RunStream(ctx context.Context, req *datastreampb.RunStreamRequest, opts ...gax.CallOption) (*RunStreamOperation, error)
RunStream use this method to start, resume or recover a stream with a non default CDC strategy.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.RunStreamRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#RunStreamRequest.
}
op, err := c.RunStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) RunStreamOperation
func (c *Client) RunStreamOperation(name string) *RunStreamOperation
RunStreamOperation returns a new RunStreamOperation from a given name. The name must be that of a previously created RunStreamOperation, possibly from a different process.
func (*Client) StartBackfillJob
func (c *Client) StartBackfillJob(ctx context.Context, req *datastreampb.StartBackfillJobRequest, opts ...gax.CallOption) (*datastreampb.StartBackfillJobResponse, error)
StartBackfillJob use this method to start a backfill job for the specified stream object.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.StartBackfillJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#StartBackfillJobRequest.
}
resp, err := c.StartBackfillJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) StopBackfillJob
func (c *Client) StopBackfillJob(ctx context.Context, req *datastreampb.StopBackfillJobRequest, opts ...gax.CallOption) (*datastreampb.StopBackfillJobResponse, error)
StopBackfillJob use this method to stop a backfill job for the specified stream object.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.StopBackfillJobRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#StopBackfillJobRequest.
}
resp, err := c.StopBackfillJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateConnectionProfile
func (c *Client) UpdateConnectionProfile(ctx context.Context, req *datastreampb.UpdateConnectionProfileRequest, opts ...gax.CallOption) (*UpdateConnectionProfileOperation, error)
UpdateConnectionProfile use this method to update the parameters of a connection profile.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.UpdateConnectionProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#UpdateConnectionProfileRequest.
}
op, err := c.UpdateConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateConnectionProfileOperation
func (c *Client) UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation
UpdateConnectionProfileOperation returns a new UpdateConnectionProfileOperation from a given name. The name must be that of a previously created UpdateConnectionProfileOperation, possibly from a different process.
func (*Client) UpdateStream
func (c *Client) UpdateStream(ctx context.Context, req *datastreampb.UpdateStreamRequest, opts ...gax.CallOption) (*UpdateStreamOperation, error)
UpdateStream use this method to update the configuration of a stream.
Example
package main
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1"
datastreampb "cloud.google.com/go/datastream/apiv1/datastreampb"
)
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 := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.UpdateStreamRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datastream/apiv1/datastreampb#UpdateStreamRequest.
}
op, err := c.UpdateStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateStreamOperation
func (c *Client) UpdateStreamOperation(name string) *UpdateStreamOperation
UpdateStreamOperation returns a new UpdateStreamOperation from a given name. The name must be that of a previously created UpdateStreamOperation, possibly from a different process.
ConnectionProfileIterator
type ConnectionProfileIterator 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 []*datastreampb.ConnectionProfile, nextPageToken string, err error)
// contains filtered or unexported fields
}
ConnectionProfileIterator manages a stream of *datastreampb.ConnectionProfile.
func (*ConnectionProfileIterator) All
func (it *ConnectionProfileIterator) All() iter.Seq2[*datastreampb.ConnectionProfile, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ConnectionProfileIterator) Next
func (it *ConnectionProfileIterator) Next() (*datastreampb.ConnectionProfile, 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 (*ConnectionProfileIterator) PageInfo
func (it *ConnectionProfileIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CreateConnectionProfileOperation
type CreateConnectionProfileOperation struct {
// contains filtered or unexported fields
}
CreateConnectionProfileOperation manages a long-running operation from CreateConnectionProfile.
func (*CreateConnectionProfileOperation) Done
func (op *CreateConnectionProfileOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateConnectionProfileOperation) Metadata
func (op *CreateConnectionProfileOperation) Metadata() (*datastreampb.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 (*CreateConnectionProfileOperation) Name
func (op *CreateConnectionProfileOperation) 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 (*CreateConnectionProfileOperation) Poll
func (op *CreateConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, 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 (*CreateConnectionProfileOperation) Wait
func (op *CreateConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, 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.
CreatePrivateConnectionOperation
type CreatePrivateConnectionOperation struct {
// contains filtered or unexported fields
}
CreatePrivateConnectionOperation manages a long-running operation from CreatePrivateConnection.
func (*CreatePrivateConnectionOperation) Done
func (op *CreatePrivateConnectionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreatePrivateConnectionOperation) Metadata
func (op *CreatePrivateConnectionOperation) Metadata() (*datastreampb.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 (*CreatePrivateConnectionOperation) Name
func (op *CreatePrivateConnectionOperation) 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 (*CreatePrivateConnectionOperation) Poll
func (op *CreatePrivateConnectionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.PrivateConnection, 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 (*CreatePrivateConnectionOperation) Wait
func (op *CreatePrivateConnectionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.PrivateConnection, 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.
CreateRouteOperation
type CreateRouteOperation struct {
// contains filtered or unexported fields
}
CreateRouteOperation manages a long-running operation from CreateRoute.
func (*CreateRouteOperation) Done
func (op *CreateRouteOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateRouteOperation) Metadata
func (op *CreateRouteOperation) Metadata() (*datastreampb.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 (*CreateRouteOperation) Name
func (op *CreateRouteOperation) 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 (*CreateRouteOperation) Poll
func (op *CreateRouteOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Route, 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 (*CreateRouteOperation) Wait
func (op *CreateRouteOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Route, 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.
CreateStreamOperation
type CreateStreamOperation struct {
// contains filtered or unexported fields
}
CreateStreamOperation manages a long-running operation from CreateStream.
func (*CreateStreamOperation) Done
func (op *CreateStreamOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateStreamOperation) Metadata
func (op *CreateStreamOperation) Metadata() (*datastreampb.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 (*CreateStreamOperation) Name
func (op *CreateStreamOperation) 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 (*CreateStreamOperation) Poll
func (op *CreateStreamOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, 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 (*CreateStreamOperation) Wait
func (op *CreateStreamOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, 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.
DeleteConnectionProfileOperation
type DeleteConnectionProfileOperation struct {
// contains filtered or unexported fields
}
DeleteConnectionProfileOperation manages a long-running operation from DeleteConnectionProfile.
func (*DeleteConnectionProfileOperation) Done
func (op *DeleteConnectionProfileOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteConnectionProfileOperation) Metadata
func (op *DeleteConnectionProfileOperation) Metadata() (*datastreampb.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 (*DeleteConnectionProfileOperation) Name
func (op *DeleteConnectionProfileOperation) 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 (*DeleteConnectionProfileOperation) Poll
func (op *DeleteConnectionProfileOperation) 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 (*DeleteConnectionProfileOperation) Wait
func (op *DeleteConnectionProfileOperation) 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.
DeletePrivateConnectionOperation
type DeletePrivateConnectionOperation struct {
// contains filtered or unexported fields
}
DeletePrivateConnectionOperation manages a long-running operation from DeletePrivateConnection.
func (*DeletePrivateConnectionOperation) Done
func (op *DeletePrivateConnectionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeletePrivateConnectionOperation) Metadata
func (op *DeletePrivateConnectionOperation) Metadata() (*datastreampb.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 (*DeletePrivateConnectionOperation) Name
func (op *DeletePrivateConnectionOperation) 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 (*DeletePrivateConnectionOperation) Poll
func (op *DeletePrivateConnectionOperation) 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 (*DeletePrivateConnectionOperation) Wait
func (op *DeletePrivateConnectionOperation) 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.
DeleteRouteOperation
type DeleteRouteOperation struct {
// contains filtered or unexported fields
}
DeleteRouteOperation manages a long-running operation from DeleteRoute.
func (*DeleteRouteOperation) Done
func (op *DeleteRouteOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteRouteOperation) Metadata
func (op *DeleteRouteOperation) Metadata() (*datastreampb.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 (*DeleteRouteOperation) Name
func (op *DeleteRouteOperation) 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 (*DeleteRouteOperation) Poll
func (op *DeleteRouteOperation) 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 (*DeleteRouteOperation) Wait
func (op *DeleteRouteOperation) 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.
DeleteStreamOperation
type DeleteStreamOperation struct {
// contains filtered or unexported fields
}
DeleteStreamOperation manages a long-running operation from DeleteStream.
func (*DeleteStreamOperation) Done
func (op *DeleteStreamOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteStreamOperation) Metadata
func (op *DeleteStreamOperation) Metadata() (*datastreampb.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 (*DeleteStreamOperation) Name
func (op *DeleteStreamOperation) 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 (*DeleteStreamOperation) Poll
func (op *DeleteStreamOperation) 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 (*DeleteStreamOperation) Wait
func (op *DeleteStreamOperation) 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.
IamPolicyCallOptions
type IamPolicyCallOptions struct {
SetIamPolicy []gax.CallOption
GetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
IamPolicyCallOptions contains the retry settings for each method of IamPolicyClient.
IamPolicyClient
type IamPolicyClient struct {
// The call options for this service.
CallOptions *IamPolicyCallOptions
// contains filtered or unexported fields
}
IamPolicyClient is a client for interacting with Batch API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
API Overview
Manages Identity and Access Management (IAM) policies.
Any implementation of an API that offers access control features implements the google.iam.v1.IAMPolicy interface.
Data modelAccess control is applied when a principal (user or service account), takes some action on a resource exposed by a service. Resources, identified by URI-like names, are the unit of access control specification. Service implementations can choose the granularity of access control and the supported permissions for their resources. For example one database service may allow access control to be specified only at the Table level, whereas another might allow access control to also be specified at the Column level.
Policy StructureSee google.iam.v1.Policy
This is intentionally not a CRUD style API because access control policies are created and deleted implicitly with the resources to which they are attached.
func NewIamPolicyClient
func NewIamPolicyClient(ctx context.Context, opts ...option.ClientOption) (*IamPolicyClient, error)
NewIamPolicyClient creates a new iam policy client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
API Overview
Manages Identity and Access Management (IAM) policies.
Any implementation of an API that offers access control features implements the google.iam.v1.IAMPolicy interface.
Data modelAccess control is applied when a principal (user or service account), takes some action on a resource exposed by a service. Resources, identified by URI-like names, are the unit of access control specification. Service implementations can choose the granularity of access control and the supported permissions for their resources. For example one database service may allow access control to be specified only at the Table level, whereas another might allow access control to also be specified at the Column level.
Policy StructureSee google.iam.v1.Policy
This is intentionally not a CRUD style API because access control policies are created and deleted implicitly with the resources to which they are attached.
func NewIamPolicyRESTClient
func NewIamPolicyRESTClient(ctx context.Context, opts ...option.ClientOption) (*IamPolicyClient, error)
NewIamPolicyRESTClient creates a new iam policy rest client.
API Overview
Manages Identity and Access Management (IAM) policies.
Any implementation of an API that offers access control features implements the google.iam.v1.IAMPolicy interface.
Data modelAccess control is applied when a principal (user or service account), takes some action on a resource exposed by a service. Resources, identified by URI-like names, are the unit of access control specification. Service implementations can choose the granularity of access control and the supported permissions for their resources. For example one database service may allow access control to be specified only at the Table level, whereas another might allow access control to also be specified at the Column level.
Policy StructureSee google.iam.v1.Policy
This is intentionally not a CRUD style API because access control policies are created and deleted implicitly with the resources to which they are attached.
func (*IamPolicyClient) CancelOperation
func (c *IamPolicyClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
func (*IamPolicyClient) Close
func (c *IamPolicyClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IamPolicyClient) Connection (deprecated)
func (c *IamPolicyClient) 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 (*IamPolicyClient) DeleteOperation
func (c *IamPolicyClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
func (*IamPolicyClient) GetIamPolicy
func (c *IamPolicyClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
func (*IamPolicyClient) GetLocation
func (c *IamPolicyClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
func (*IamPolicyClient) GetOperation
func (c *IamPolicyClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
func (*IamPolicyClient) ListLocations
func (c *IamPolicyClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
func (*IamPolicyClient) ListOperations
func (c *IamPolicyClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
func (*IamPolicyClient) SetIamPolicy
func (c *IamPolicyClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
func (*IamPolicyClient) TestIamPermissions
func (c *IamPolicyClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
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.
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.
PrivateConnectionIterator
type PrivateConnectionIterator 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 []*datastreampb.PrivateConnection, nextPageToken string, err error)
// contains filtered or unexported fields
}
PrivateConnectionIterator manages a stream of *datastreampb.PrivateConnection.
func (*PrivateConnectionIterator) All
func (it *PrivateConnectionIterator) All() iter.Seq2[*datastreampb.PrivateConnection, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PrivateConnectionIterator) Next
func (it *PrivateConnectionIterator) Next() (*datastreampb.PrivateConnection, 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 (*PrivateConnectionIterator) PageInfo
func (it *PrivateConnectionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RouteIterator
type RouteIterator 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 []*datastreampb.Route, nextPageToken string, err error)
// contains filtered or unexported fields
}
RouteIterator manages a stream of *datastreampb.Route.
func (*RouteIterator) All
func (it *RouteIterator) All() iter.Seq2[*datastreampb.Route, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RouteIterator) Next
func (it *RouteIterator) Next() (*datastreampb.Route, 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 (*RouteIterator) PageInfo
func (it *RouteIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RunStreamOperation
type RunStreamOperation struct {
// contains filtered or unexported fields
}
RunStreamOperation manages a long-running operation from RunStream.
func (*RunStreamOperation) Done
func (op *RunStreamOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RunStreamOperation) Metadata
func (op *RunStreamOperation) Metadata() (*datastreampb.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 (*RunStreamOperation) Name
func (op *RunStreamOperation) 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 (*RunStreamOperation) Poll
func (op *RunStreamOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, 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 (*RunStreamOperation) Wait
func (op *RunStreamOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, 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.
StreamIterator
type StreamIterator 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 []*datastreampb.Stream, nextPageToken string, err error)
// contains filtered or unexported fields
}
StreamIterator manages a stream of *datastreampb.Stream.
func (*StreamIterator) All
func (it *StreamIterator) All() iter.Seq2[*datastreampb.Stream, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StreamIterator) Next
func (it *StreamIterator) Next() (*datastreampb.Stream, 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 (*StreamIterator) PageInfo
func (it *StreamIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
StreamObjectIterator
type StreamObjectIterator 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 []*datastreampb.StreamObject, nextPageToken string, err error)
// contains filtered or unexported fields
}
StreamObjectIterator manages a stream of *datastreampb.StreamObject.
func (*StreamObjectIterator) All
func (it *StreamObjectIterator) All() iter.Seq2[*datastreampb.StreamObject, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StreamObjectIterator) Next
func (it *StreamObjectIterator) Next() (*datastreampb.StreamObject, 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 (*StreamObjectIterator) PageInfo
func (it *StreamObjectIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
StringIterator
type StringIterator 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 []string, nextPageToken string, err error)
// contains filtered or unexported fields
}
StringIterator manages a stream of string.
func (*StringIterator) All
func (it *StringIterator) All() iter.Seq2[string, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StringIterator) Next
func (it *StringIterator) Next() (string, 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 (*StringIterator) PageInfo
func (it *StringIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
UpdateConnectionProfileOperation
type UpdateConnectionProfileOperation struct {
// contains filtered or unexported fields
}
UpdateConnectionProfileOperation manages a long-running operation from UpdateConnectionProfile.
func (*UpdateConnectionProfileOperation) Done
func (op *UpdateConnectionProfileOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateConnectionProfileOperation) Metadata
func (op *UpdateConnectionProfileOperation) Metadata() (*datastreampb.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 (*UpdateConnectionProfileOperation) Name
func (op *UpdateConnectionProfileOperation) 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 (*UpdateConnectionProfileOperation) Poll
func (op *UpdateConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, 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 (*UpdateConnectionProfileOperation) Wait
func (op *UpdateConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.ConnectionProfile, 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.
UpdateStreamOperation
type UpdateStreamOperation struct {
// contains filtered or unexported fields
}
UpdateStreamOperation manages a long-running operation from UpdateStream.
func (*UpdateStreamOperation) Done
func (op *UpdateStreamOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateStreamOperation) Metadata
func (op *UpdateStreamOperation) Metadata() (*datastreampb.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 (*UpdateStreamOperation) Name
func (op *UpdateStreamOperation) 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 (*UpdateStreamOperation) Poll
func (op *UpdateStreamOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, 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 (*UpdateStreamOperation) Wait
func (op *UpdateStreamOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*datastreampb.Stream, 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.