package dataexchange
import "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
Package dataexchange is an auto-generated package for the Analytics Hub API.
Exchange data and analytics assets securely and efficiently.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/bigquery/dataexchange/apiv1beta1@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 := dataexchange.NewAnalyticsHubClient(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 := &dataexchangepb.CreateDataExchangeRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#CreateDataExchangeRequest. } resp, err := c.CreateDataExchange(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewAnalyticsHubClient 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 AnalyticsHubCallOptions
- type AnalyticsHubClient
- func NewAnalyticsHubClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsHubClient, error)
- func NewAnalyticsHubRESTClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsHubClient, error)
- func (c *AnalyticsHubClient) Close() error
- func (c *AnalyticsHubClient) Connection() *grpc.ClientConn
- func (c *AnalyticsHubClient) CreateDataExchange(ctx context.Context, req *dataexchangepb.CreateDataExchangeRequest, opts ...gax.CallOption) (*dataexchangepb.DataExchange, error)
- func (c *AnalyticsHubClient) CreateListing(ctx context.Context, req *dataexchangepb.CreateListingRequest, opts ...gax.CallOption) (*dataexchangepb.Listing, error)
- func (c *AnalyticsHubClient) DeleteDataExchange(ctx context.Context, req *dataexchangepb.DeleteDataExchangeRequest, opts ...gax.CallOption) error
- func (c *AnalyticsHubClient) DeleteListing(ctx context.Context, req *dataexchangepb.DeleteListingRequest, opts ...gax.CallOption) error
- func (c *AnalyticsHubClient) GetDataExchange(ctx context.Context, req *dataexchangepb.GetDataExchangeRequest, opts ...gax.CallOption) (*dataexchangepb.DataExchange, error)
- func (c *AnalyticsHubClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *AnalyticsHubClient) GetListing(ctx context.Context, req *dataexchangepb.GetListingRequest, opts ...gax.CallOption) (*dataexchangepb.Listing, error)
- func (c *AnalyticsHubClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *AnalyticsHubClient) ListDataExchanges(ctx context.Context, req *dataexchangepb.ListDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator
- func (c *AnalyticsHubClient) ListListings(ctx context.Context, req *dataexchangepb.ListListingsRequest, opts ...gax.CallOption) *ListingIterator
- func (c *AnalyticsHubClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *AnalyticsHubClient) ListOrgDataExchanges(ctx context.Context, req *dataexchangepb.ListOrgDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator
- func (c *AnalyticsHubClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *AnalyticsHubClient) SubscribeListing(ctx context.Context, req *dataexchangepb.SubscribeListingRequest, opts ...gax.CallOption) (*dataexchangepb.SubscribeListingResponse, error)
- func (c *AnalyticsHubClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
- func (c *AnalyticsHubClient) UpdateDataExchange(ctx context.Context, req *dataexchangepb.UpdateDataExchangeRequest, opts ...gax.CallOption) (*dataexchangepb.DataExchange, error)
- func (c *AnalyticsHubClient) UpdateListing(ctx context.Context, req *dataexchangepb.UpdateListingRequest, opts ...gax.CallOption) (*dataexchangepb.Listing, error)
- type DataExchangeIterator
- func (it *DataExchangeIterator) All() iter.Seq2[*dataexchangepb.DataExchange, error]
- func (it *DataExchangeIterator) Next() (*dataexchangepb.DataExchange, error)
- func (it *DataExchangeIterator) PageInfo() *iterator.PageInfo
- type ListingIterator
- func (it *ListingIterator) All() iter.Seq2[*dataexchangepb.Listing, error]
- func (it *ListingIterator) Next() (*dataexchangepb.Listing, error)
- func (it *ListingIterator) PageInfo() *iterator.PageInfo
- type LocationIterator
Examples ¶
- AnalyticsHubClient.CreateDataExchange
- AnalyticsHubClient.CreateListing
- AnalyticsHubClient.DeleteDataExchange
- AnalyticsHubClient.DeleteListing
- AnalyticsHubClient.GetDataExchange
- AnalyticsHubClient.GetIamPolicy
- AnalyticsHubClient.GetListing
- AnalyticsHubClient.GetLocation
- AnalyticsHubClient.ListDataExchanges
- AnalyticsHubClient.ListDataExchanges (All)
- AnalyticsHubClient.ListListings
- AnalyticsHubClient.ListListings (All)
- AnalyticsHubClient.ListLocations
- AnalyticsHubClient.ListLocations (All)
- AnalyticsHubClient.ListOrgDataExchanges
- AnalyticsHubClient.ListOrgDataExchanges (All)
- AnalyticsHubClient.SetIamPolicy
- AnalyticsHubClient.SubscribeListing
- AnalyticsHubClient.TestIamPermissions
- AnalyticsHubClient.UpdateDataExchange
- AnalyticsHubClient.UpdateListing
- NewAnalyticsHubClient
- NewAnalyticsHubRESTClient
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AnalyticsHubCallOptions ¶
type AnalyticsHubCallOptions 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 GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption }
AnalyticsHubCallOptions contains the retry settings for each method of AnalyticsHubClient.
type AnalyticsHubClient ¶
type AnalyticsHubClient struct { // The call options for this service. CallOptions *AnalyticsHubCallOptions // contains filtered or unexported fields }
AnalyticsHubClient 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.
func NewAnalyticsHubClient ¶
func NewAnalyticsHubClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsHubClient, error)
NewAnalyticsHubClient 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.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewAnalyticsHubRESTClient ¶
func NewAnalyticsHubRESTClient(ctx context.Context, opts ...option.ClientOption) (*AnalyticsHubClient, error)
NewAnalyticsHubRESTClient 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.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
)
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 := dataexchange.NewAnalyticsHubRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AnalyticsHubClient) Close ¶
func (c *AnalyticsHubClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AnalyticsHubClient) Connection ¶
func (c *AnalyticsHubClient) 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 (*AnalyticsHubClient) CreateDataExchange ¶
func (c *AnalyticsHubClient) CreateDataExchange(ctx context.Context, req *dataexchangepb.CreateDataExchangeRequest, opts ...gax.CallOption) (*dataexchangepb.DataExchange, error)
CreateDataExchange creates a new data exchange.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.CreateDataExchangeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#CreateDataExchangeRequest.
}
resp, err := c.CreateDataExchange(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnalyticsHubClient) CreateListing ¶
func (c *AnalyticsHubClient) CreateListing(ctx context.Context, req *dataexchangepb.CreateListingRequest, opts ...gax.CallOption) (*dataexchangepb.Listing, error)
CreateListing creates a new listing.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.CreateListingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#CreateListingRequest.
}
resp, err := c.CreateListing(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnalyticsHubClient) DeleteDataExchange ¶
func (c *AnalyticsHubClient) DeleteDataExchange(ctx context.Context, req *dataexchangepb.DeleteDataExchangeRequest, opts ...gax.CallOption) error
DeleteDataExchange deletes an existing data exchange.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.DeleteDataExchangeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#DeleteDataExchangeRequest.
}
err = c.DeleteDataExchange(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AnalyticsHubClient) DeleteListing ¶
func (c *AnalyticsHubClient) DeleteListing(ctx context.Context, req *dataexchangepb.DeleteListingRequest, opts ...gax.CallOption) error
DeleteListing deletes a listing.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.DeleteListingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#DeleteListingRequest.
}
err = c.DeleteListing(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AnalyticsHubClient) GetDataExchange ¶
func (c *AnalyticsHubClient) GetDataExchange(ctx context.Context, req *dataexchangepb.GetDataExchangeRequest, opts ...gax.CallOption) (*dataexchangepb.DataExchange, error)
GetDataExchange gets the details of a data exchange.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.GetDataExchangeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#GetDataExchangeRequest.
}
resp, err := c.GetDataExchange(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnalyticsHubClient) GetIamPolicy ¶
func (c *AnalyticsHubClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the IAM policy.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
iampb "cloud.google.com/go/iam/apiv1/iampb"
)
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 := dataexchange.NewAnalyticsHubClient(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 (*AnalyticsHubClient) GetListing ¶
func (c *AnalyticsHubClient) GetListing(ctx context.Context, req *dataexchangepb.GetListingRequest, opts ...gax.CallOption) (*dataexchangepb.Listing, error)
GetListing gets the details of a listing.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.GetListingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#GetListingRequest.
}
resp, err := c.GetListing(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnalyticsHubClient) GetLocation ¶
func (c *AnalyticsHubClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
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 := dataexchange.NewAnalyticsHubClient(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 (*AnalyticsHubClient) ListDataExchanges ¶
func (c *AnalyticsHubClient) ListDataExchanges(ctx context.Context, req *dataexchangepb.ListDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator
ListDataExchanges lists all data exchanges in a given project and location.
Code:play
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
"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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.ListDataExchangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#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.(*dataexchangepb.ListDataExchangesResponse)
}
}
Example (All)¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.ListDataExchangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#ListDataExchangesRequest.
}
for resp, err := range c.ListDataExchanges(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AnalyticsHubClient) ListListings ¶
func (c *AnalyticsHubClient) ListListings(ctx context.Context, req *dataexchangepb.ListListingsRequest, opts ...gax.CallOption) *ListingIterator
ListListings lists all listings in a given project and location.
Code:play
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
"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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.ListListingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#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.(*dataexchangepb.ListListingsResponse)
}
}
Example (All)¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.ListListingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#ListListingsRequest.
}
for resp, err := range c.ListListings(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AnalyticsHubClient) ListLocations ¶
func (c *AnalyticsHubClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
"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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AnalyticsHubClient) ListOrgDataExchanges ¶
func (c *AnalyticsHubClient) ListOrgDataExchanges(ctx context.Context, req *dataexchangepb.ListOrgDataExchangesRequest, opts ...gax.CallOption) *DataExchangeIterator
ListOrgDataExchanges lists all data exchanges from projects in a given organization and
location.
Code:play
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
"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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.ListOrgDataExchangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#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.(*dataexchangepb.ListOrgDataExchangesResponse)
}
}
Example (All)¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.ListOrgDataExchangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#ListOrgDataExchangesRequest.
}
for resp, err := range c.ListOrgDataExchanges(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AnalyticsHubClient) SetIamPolicy ¶
func (c *AnalyticsHubClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the IAM policy.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
iampb "cloud.google.com/go/iam/apiv1/iampb"
)
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 := dataexchange.NewAnalyticsHubClient(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 (*AnalyticsHubClient) SubscribeListing ¶
func (c *AnalyticsHubClient) SubscribeListing(ctx context.Context, req *dataexchangepb.SubscribeListingRequest, opts ...gax.CallOption) (*dataexchangepb.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.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.SubscribeListingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#SubscribeListingRequest.
}
resp, err := c.SubscribeListing(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnalyticsHubClient) TestIamPermissions ¶
func (c *AnalyticsHubClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns the permissions that a caller has.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
iampb "cloud.google.com/go/iam/apiv1/iampb"
)
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 := dataexchange.NewAnalyticsHubClient(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 (*AnalyticsHubClient) UpdateDataExchange ¶
func (c *AnalyticsHubClient) UpdateDataExchange(ctx context.Context, req *dataexchangepb.UpdateDataExchangeRequest, opts ...gax.CallOption) (*dataexchangepb.DataExchange, error)
UpdateDataExchange updates an existing data exchange.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.UpdateDataExchangeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#UpdateDataExchangeRequest.
}
resp, err := c.UpdateDataExchange(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnalyticsHubClient) UpdateListing ¶
func (c *AnalyticsHubClient) UpdateListing(ctx context.Context, req *dataexchangepb.UpdateListingRequest, opts ...gax.CallOption) (*dataexchangepb.Listing, error)
UpdateListing updates an existing listing.
Code:play
Example¶
package main
import (
"context"
dataexchange "cloud.google.com/go/bigquery/dataexchange/apiv1beta1"
dataexchangepb "cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb"
)
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 := dataexchange.NewAnalyticsHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataexchangepb.UpdateListingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/bigquery/dataexchange/apiv1beta1/dataexchangepb#UpdateListingRequest.
}
resp, err := c.UpdateListing(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type DataExchangeIterator ¶
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 []*dataexchangepb.DataExchange, nextPageToken string, err error) // contains filtered or unexported fields }
DataExchangeIterator manages a stream of *dataexchangepb.DataExchange.
func (*DataExchangeIterator) All ¶
func (it *DataExchangeIterator) All() iter.Seq2[*dataexchangepb.DataExchange, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DataExchangeIterator) Next ¶
func (it *DataExchangeIterator) Next() (*dataexchangepb.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 ListingIterator ¶
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 []*dataexchangepb.Listing, nextPageToken string, err error) // contains filtered or unexported fields }
ListingIterator manages a stream of *dataexchangepb.Listing.
func (*ListingIterator) All ¶
func (it *ListingIterator) All() iter.Seq2[*dataexchangepb.Listing, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ListingIterator) Next ¶
func (it *ListingIterator) Next() (*dataexchangepb.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 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.
Source Files ¶
analytics_hub_client.go auxiliary.go auxiliary_go123.go doc.go helpers.go version.go
Directories ¶
Path | Synopsis |
---|---|
dataexchange/apiv1beta1/dataexchangepb |
- Version
- v1.66.2 (latest)
- Published
- Feb 4, 2025
- Platform
- linux/amd64
- Imports
- 28 packages
- Last checked
- 15 hours ago –
Tools for package owners.