...

Package analyticshub

import "cloud.google.com/go/bigquery/analyticshub/apiv1"
Overview
Index
Examples
Subdirectories

Overview ▾

Package analyticshub is an auto-generated package for the Analytics Hub API.

Exchange data and analytics assets securely and efficiently.

General documentation

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

Example usage

To get started with this package, create a client.

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 := analyticshub.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.

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 := analyticshub.NewClient(ctx)
if err != nil {
	// TODO: Handle error.
}
defer c.Close()

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

Use of Context

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

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

Index ▾

func DefaultAuthScopes() []string
type CallOptions
type Client
    func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
    func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
    func (c *Client) Close() error
    func (c *Client) Connection() *grpc.ClientConn
    func (c *Client) CreateDataExchange(ctx context.Context, req *analyticshubpb.CreateDataExchangeRequest, opts ...gax.CallOption) (*analyticshubpb.DataExchange, error)
    func (c *Client) CreateListing(ctx context.Context, req *analyticshubpb.CreateListingRequest, opts ...gax.CallOption) (*analyticshubpb.Listing, error)
    func (c *Client) DeleteDataExchange(ctx context.Context, req *analyticshubpb.DeleteDataExchangeRequest, opts ...gax.CallOption) error
    func (c *Client) DeleteListing(ctx context.Context, req *analyticshubpb.DeleteListingRequest, opts ...gax.CallOption) error
    func (c *Client) DeleteSubscription(ctx context.Context, req *analyticshubpb.DeleteSubscriptionRequest, opts ...gax.CallOption) (*DeleteSubscriptionOperation, error)
    func (c *Client) DeleteSubscriptionOperation(name string) *DeleteSubscriptionOperation
    func (c *Client) GetDataExchange(ctx context.Context, req *analyticshubpb.GetDataExchangeRequest, opts ...gax.CallOption) (*analyticshubpb.DataExchange, error)
    func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
    func (c *Client) GetListing(ctx context.Context, req *analyticshubpb.GetListingRequest, opts ...gax.CallOption) (*analyticshubpb.Listing, error)
    func (c *Client) GetSubscription(ctx context.Context, req *analyticshubpb.GetSubscriptionRequest, opts ...gax.CallOption) (*analyticshubpb.Subscription, error)
    func (c *Client) ListDataExchanges(ctx context.Context, req *analyticshubpb.ListDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator
    func (c *Client) ListListings(ctx context.Context, req *analyticshubpb.ListListingsRequest, opts ...gax.CallOption) *ListingIterator
    func (c *Client) ListOrgDataExchanges(ctx context.Context, req *analyticshubpb.ListOrgDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator
    func (c *Client) ListSharedResourceSubscriptions(ctx context.Context, req *analyticshubpb.ListSharedResourceSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator
    func (c *Client) ListSubscriptions(ctx context.Context, req *analyticshubpb.ListSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator
    func (c *Client) RefreshSubscription(ctx context.Context, req *analyticshubpb.RefreshSubscriptionRequest, opts ...gax.CallOption) (*RefreshSubscriptionOperation, error)
    func (c *Client) RefreshSubscriptionOperation(name string) *RefreshSubscriptionOperation
    func (c *Client) RevokeSubscription(ctx context.Context, req *analyticshubpb.RevokeSubscriptionRequest, opts ...gax.CallOption) (*analyticshubpb.RevokeSubscriptionResponse, error)
    func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
    func (c *Client) SubscribeDataExchange(ctx context.Context, req *analyticshubpb.SubscribeDataExchangeRequest, opts ...gax.CallOption) (*SubscribeDataExchangeOperation, error)
    func (c *Client) SubscribeDataExchangeOperation(name string) *SubscribeDataExchangeOperation
    func (c *Client) SubscribeListing(ctx context.Context, req *analyticshubpb.SubscribeListingRequest, opts ...gax.CallOption) (*analyticshubpb.SubscribeListingResponse, error)
    func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
    func (c *Client) UpdateDataExchange(ctx context.Context, req *analyticshubpb.UpdateDataExchangeRequest, opts ...gax.CallOption) (*analyticshubpb.DataExchange, error)
    func (c *Client) UpdateListing(ctx context.Context, req *analyticshubpb.UpdateListingRequest, opts ...gax.CallOption) (*analyticshubpb.Listing, error)
type DataExchangeIterator
    func (it *DataExchangeIterator) Next() (*analyticshubpb.DataExchange, error)
    func (it *DataExchangeIterator) PageInfo() *iterator.PageInfo
type DeleteSubscriptionOperation
    func (op *DeleteSubscriptionOperation) Done() bool
    func (op *DeleteSubscriptionOperation) Metadata() (*analyticshubpb.OperationMetadata, error)
    func (op *DeleteSubscriptionOperation) Name() string
    func (op *DeleteSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
    func (op *DeleteSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
type ListingIterator
    func (it *ListingIterator) Next() (*analyticshubpb.Listing, error)
    func (it *ListingIterator) PageInfo() *iterator.PageInfo
type RefreshSubscriptionOperation
    func (op *RefreshSubscriptionOperation) Done() bool
    func (op *RefreshSubscriptionOperation) Metadata() (*analyticshubpb.OperationMetadata, error)
    func (op *RefreshSubscriptionOperation) Name() string
    func (op *RefreshSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.RefreshSubscriptionResponse, error)
    func (op *RefreshSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.RefreshSubscriptionResponse, error)
type SubscribeDataExchangeOperation
    func (op *SubscribeDataExchangeOperation) Done() bool
    func (op *SubscribeDataExchangeOperation) Metadata() (*analyticshubpb.OperationMetadata, error)
    func (op *SubscribeDataExchangeOperation) Name() string
    func (op *SubscribeDataExchangeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.SubscribeDataExchangeResponse, error)
    func (op *SubscribeDataExchangeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.SubscribeDataExchangeResponse, error)
type SubscriptionIterator
    func (it *SubscriptionIterator) Next() (*analyticshubpb.Subscription, error)
    func (it *SubscriptionIterator) PageInfo() *iterator.PageInfo

Package files

analytics_hub_client.go auxiliary.go doc.go version.go

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

type CallOptions

CallOptions contains the retry settings for each method of Client.

type CallOptions struct {
    ListDataExchanges               []gax.CallOption
    ListOrgDataExchanges            []gax.CallOption
    GetDataExchange                 []gax.CallOption
    CreateDataExchange              []gax.CallOption
    UpdateDataExchange              []gax.CallOption
    DeleteDataExchange              []gax.CallOption
    ListListings                    []gax.CallOption
    GetListing                      []gax.CallOption
    CreateListing                   []gax.CallOption
    UpdateListing                   []gax.CallOption
    DeleteListing                   []gax.CallOption
    SubscribeListing                []gax.CallOption
    SubscribeDataExchange           []gax.CallOption
    RefreshSubscription             []gax.CallOption
    GetSubscription                 []gax.CallOption
    ListSubscriptions               []gax.CallOption
    ListSharedResourceSubscriptions []gax.CallOption
    RevokeSubscription              []gax.CallOption
    DeleteSubscription              []gax.CallOption
    GetIamPolicy                    []gax.CallOption
    SetIamPolicy                    []gax.CallOption
    TestIamPermissions              []gax.CallOption
}

type Client

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

The AnalyticsHubService API facilitates data sharing within and across organizations. It allows data providers to publish listings that reference shared datasets. With Analytics Hub, users can discover and search for listings that they have access to. Subscribers can view and subscribe to listings. When you subscribe to a listing, Analytics Hub creates a linked dataset in your project.

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
}

func NewClient

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

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

The AnalyticsHubService API facilitates data sharing within and across organizations. It allows data providers to publish listings that reference shared datasets. With Analytics Hub, users can discover and search for listings that they have access to. Subscribers can view and subscribe to listings. When you subscribe to a listing, Analytics Hub creates a linked dataset in your project.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

// TODO: Use client.
_ = c

func NewRESTClient

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

NewRESTClient creates a new analytics hub service rest client.

The AnalyticsHubService API facilitates data sharing within and across organizations. It allows data providers to publish listings that reference shared datasets. With Analytics Hub, users can discover and search for listings that they have access to. Subscribers can view and subscribe to listings. When you subscribe to a listing, Analytics Hub creates a linked dataset in your project.

Example

Code:

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 := analyticshub.NewRESTClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

// TODO: Use client.
_ = c

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Connection

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) CreateDataExchange

func (c *Client) CreateDataExchange(ctx context.Context, req *analyticshubpb.CreateDataExchangeRequest, opts ...gax.CallOption) (*analyticshubpb.DataExchange, error)

CreateDataExchange creates a new data exchange.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) CreateListing

func (c *Client) CreateListing(ctx context.Context, req *analyticshubpb.CreateListingRequest, opts ...gax.CallOption) (*analyticshubpb.Listing, error)

CreateListing creates a new listing.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) DeleteDataExchange

func (c *Client) DeleteDataExchange(ctx context.Context, req *analyticshubpb.DeleteDataExchangeRequest, opts ...gax.CallOption) error

DeleteDataExchange deletes an existing data exchange.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.DeleteDataExchangeRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#DeleteDataExchangeRequest.
}
err = c.DeleteDataExchange(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*Client) DeleteListing

func (c *Client) DeleteListing(ctx context.Context, req *analyticshubpb.DeleteListingRequest, opts ...gax.CallOption) error

DeleteListing deletes a listing.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.DeleteListingRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#DeleteListingRequest.
}
err = c.DeleteListing(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*Client) DeleteSubscription

func (c *Client) DeleteSubscription(ctx context.Context, req *analyticshubpb.DeleteSubscriptionRequest, opts ...gax.CallOption) (*DeleteSubscriptionOperation, error)

DeleteSubscription deletes a subscription.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.DeleteSubscriptionRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#DeleteSubscriptionRequest.
}
op, err := c.DeleteSubscription(ctx, req)
if err != nil {
    // TODO: Handle error.
}

err = op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}

func (*Client) DeleteSubscriptionOperation

func (c *Client) DeleteSubscriptionOperation(name string) *DeleteSubscriptionOperation

DeleteSubscriptionOperation returns a new DeleteSubscriptionOperation from a given name. The name must be that of a previously created DeleteSubscriptionOperation, possibly from a different process.

func (*Client) GetDataExchange

func (c *Client) GetDataExchange(ctx context.Context, req *analyticshubpb.GetDataExchangeRequest, opts ...gax.CallOption) (*analyticshubpb.DataExchange, error)

GetDataExchange gets the details of a data exchange.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) GetIamPolicy

func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)

GetIamPolicy gets the IAM policy.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) GetListing

func (c *Client) GetListing(ctx context.Context, req *analyticshubpb.GetListingRequest, opts ...gax.CallOption) (*analyticshubpb.Listing, error)

GetListing gets the details of a listing.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) GetSubscription

func (c *Client) GetSubscription(ctx context.Context, req *analyticshubpb.GetSubscriptionRequest, opts ...gax.CallOption) (*analyticshubpb.Subscription, error)

GetSubscription gets the details of a Subscription.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) ListDataExchanges

func (c *Client) ListDataExchanges(ctx context.Context, req *analyticshubpb.ListDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator

ListDataExchanges lists all data exchanges in a given project and location.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.ListDataExchangesRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#ListDataExchangesRequest.
}
it := c.ListDataExchanges(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.(*analyticshubpb.ListDataExchangesResponse)
}

func (*Client) ListListings

func (c *Client) ListListings(ctx context.Context, req *analyticshubpb.ListListingsRequest, opts ...gax.CallOption) *ListingIterator

ListListings lists all listings in a given project and location.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.ListListingsRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#ListListingsRequest.
}
it := c.ListListings(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.(*analyticshubpb.ListListingsResponse)
}

func (*Client) ListOrgDataExchanges

func (c *Client) ListOrgDataExchanges(ctx context.Context, req *analyticshubpb.ListOrgDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator

ListOrgDataExchanges lists all data exchanges from projects in a given organization and location.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.ListOrgDataExchangesRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#ListOrgDataExchangesRequest.
}
it := c.ListOrgDataExchanges(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.(*analyticshubpb.ListOrgDataExchangesResponse)
}

func (*Client) ListSharedResourceSubscriptions

func (c *Client) ListSharedResourceSubscriptions(ctx context.Context, req *analyticshubpb.ListSharedResourceSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator

ListSharedResourceSubscriptions lists all subscriptions on a given Data Exchange or Listing.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.ListSharedResourceSubscriptionsRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#ListSharedResourceSubscriptionsRequest.
}
it := c.ListSharedResourceSubscriptions(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.(*analyticshubpb.ListSharedResourceSubscriptionsResponse)
}

func (*Client) ListSubscriptions

func (c *Client) ListSubscriptions(ctx context.Context, req *analyticshubpb.ListSubscriptionsRequest, opts ...gax.CallOption) *SubscriptionIterator

ListSubscriptions lists all subscriptions in a given project and location.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.ListSubscriptionsRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#ListSubscriptionsRequest.
}
it := c.ListSubscriptions(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.(*analyticshubpb.ListSubscriptionsResponse)
}

func (*Client) RefreshSubscription

func (c *Client) RefreshSubscription(ctx context.Context, req *analyticshubpb.RefreshSubscriptionRequest, opts ...gax.CallOption) (*RefreshSubscriptionOperation, error)

RefreshSubscription refreshes a Subscription to a Data Exchange. A Data Exchange can become stale when a publisher adds or removes data. This is a long-running operation as it may create many linked datasets.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.RefreshSubscriptionRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#RefreshSubscriptionRequest.
}
op, err := c.RefreshSubscription(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) RefreshSubscriptionOperation

func (c *Client) RefreshSubscriptionOperation(name string) *RefreshSubscriptionOperation

RefreshSubscriptionOperation returns a new RefreshSubscriptionOperation from a given name. The name must be that of a previously created RefreshSubscriptionOperation, possibly from a different process.

func (*Client) RevokeSubscription

func (c *Client) RevokeSubscription(ctx context.Context, req *analyticshubpb.RevokeSubscriptionRequest, opts ...gax.CallOption) (*analyticshubpb.RevokeSubscriptionResponse, error)

RevokeSubscription revokes a given subscription.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) SetIamPolicy

func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)

SetIamPolicy sets the IAM policy.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) SubscribeDataExchange

func (c *Client) SubscribeDataExchange(ctx context.Context, req *analyticshubpb.SubscribeDataExchangeRequest, opts ...gax.CallOption) (*SubscribeDataExchangeOperation, error)

SubscribeDataExchange creates a Subscription to a Data Exchange. This is a long-running operation as it will create one or more linked datasets.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &analyticshubpb.SubscribeDataExchangeRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb#SubscribeDataExchangeRequest.
}
op, err := c.SubscribeDataExchange(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) SubscribeDataExchangeOperation

func (c *Client) SubscribeDataExchangeOperation(name string) *SubscribeDataExchangeOperation

SubscribeDataExchangeOperation returns a new SubscribeDataExchangeOperation from a given name. The name must be that of a previously created SubscribeDataExchangeOperation, possibly from a different process.

func (*Client) SubscribeListing

func (c *Client) SubscribeListing(ctx context.Context, req *analyticshubpb.SubscribeListingRequest, opts ...gax.CallOption) (*analyticshubpb.SubscribeListingResponse, error)

SubscribeListing subscribes to a listing.

Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber’s project.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) TestIamPermissions

func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)

TestIamPermissions returns the permissions that a caller has.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) UpdateDataExchange

func (c *Client) UpdateDataExchange(ctx context.Context, req *analyticshubpb.UpdateDataExchangeRequest, opts ...gax.CallOption) (*analyticshubpb.DataExchange, error)

UpdateDataExchange updates an existing data exchange.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

func (*Client) UpdateListing

func (c *Client) UpdateListing(ctx context.Context, req *analyticshubpb.UpdateListingRequest, opts ...gax.CallOption) (*analyticshubpb.Listing, error)

UpdateListing updates an existing listing.

Example

Code:

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 := analyticshub.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

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

type DataExchangeIterator

DataExchangeIterator manages a stream of *analyticshubpb.DataExchange.

type DataExchangeIterator 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 []*analyticshubpb.DataExchange, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*DataExchangeIterator) Next

func (it *DataExchangeIterator) Next() (*analyticshubpb.DataExchange, 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 (*DataExchangeIterator) PageInfo

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

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

type DeleteSubscriptionOperation

DeleteSubscriptionOperation manages a long-running operation from DeleteSubscription.

type DeleteSubscriptionOperation struct {
    // contains filtered or unexported fields
}

func (*DeleteSubscriptionOperation) Done

func (op *DeleteSubscriptionOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DeleteSubscriptionOperation) Metadata

func (op *DeleteSubscriptionOperation) Metadata() (*analyticshubpb.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 (*DeleteSubscriptionOperation) Name

func (op *DeleteSubscriptionOperation) 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 (*DeleteSubscriptionOperation) Poll

func (op *DeleteSubscriptionOperation) 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 (*DeleteSubscriptionOperation) Wait

func (op *DeleteSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type ListingIterator

ListingIterator manages a stream of *analyticshubpb.Listing.

type ListingIterator 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 []*analyticshubpb.Listing, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*ListingIterator) Next

func (it *ListingIterator) Next() (*analyticshubpb.Listing, 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 (*ListingIterator) PageInfo

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

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

type RefreshSubscriptionOperation

RefreshSubscriptionOperation manages a long-running operation from RefreshSubscription.

type RefreshSubscriptionOperation struct {
    // contains filtered or unexported fields
}

func (*RefreshSubscriptionOperation) Done

func (op *RefreshSubscriptionOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*RefreshSubscriptionOperation) Metadata

func (op *RefreshSubscriptionOperation) Metadata() (*analyticshubpb.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 (*RefreshSubscriptionOperation) Name

func (op *RefreshSubscriptionOperation) 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 (*RefreshSubscriptionOperation) Poll

func (op *RefreshSubscriptionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.RefreshSubscriptionResponse, 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 (*RefreshSubscriptionOperation) Wait

func (op *RefreshSubscriptionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.RefreshSubscriptionResponse, error)

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type SubscribeDataExchangeOperation

SubscribeDataExchangeOperation manages a long-running operation from SubscribeDataExchange.

type SubscribeDataExchangeOperation struct {
    // contains filtered or unexported fields
}

func (*SubscribeDataExchangeOperation) Done

func (op *SubscribeDataExchangeOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*SubscribeDataExchangeOperation) Metadata

func (op *SubscribeDataExchangeOperation) Metadata() (*analyticshubpb.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 (*SubscribeDataExchangeOperation) Name

func (op *SubscribeDataExchangeOperation) 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 (*SubscribeDataExchangeOperation) Poll

func (op *SubscribeDataExchangeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.SubscribeDataExchangeResponse, 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 (*SubscribeDataExchangeOperation) Wait

func (op *SubscribeDataExchangeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*analyticshubpb.SubscribeDataExchangeResponse, error)

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

type SubscriptionIterator

SubscriptionIterator manages a stream of *analyticshubpb.Subscription.

type SubscriptionIterator 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 []*analyticshubpb.Subscription, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*SubscriptionIterator) Next

func (it *SubscriptionIterator) Next() (*analyticshubpb.Subscription, 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 (*SubscriptionIterator) PageInfo

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

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

Subdirectories

Name Synopsis
..
analyticshubpb