Google Cloud Data Catalog API v1 - Package cloud.google.com/go/datacatalog/apiv1 (v1.2.0)

Package datacatalog is an auto-generated package for the Google Cloud Data Catalog API.

A fully managed and highly scalable data discovery and metadata management service.

Example usage

To get started with this package, create a client.

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

req := &datacatalogpb.SearchCatalogRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#SearchCatalogRequest.
}
it := c.SearchCatalog(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    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.

For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

CallOptions

type CallOptions struct {
	SearchCatalog                   []gax.CallOption
	CreateEntryGroup                []gax.CallOption
	GetEntryGroup                   []gax.CallOption
	UpdateEntryGroup                []gax.CallOption
	DeleteEntryGroup                []gax.CallOption
	ListEntryGroups                 []gax.CallOption
	CreateEntry                     []gax.CallOption
	UpdateEntry                     []gax.CallOption
	DeleteEntry                     []gax.CallOption
	GetEntry                        []gax.CallOption
	LookupEntry                     []gax.CallOption
	ListEntries                     []gax.CallOption
	ModifyEntryOverview             []gax.CallOption
	ModifyEntryContacts             []gax.CallOption
	CreateTagTemplate               []gax.CallOption
	GetTagTemplate                  []gax.CallOption
	UpdateTagTemplate               []gax.CallOption
	DeleteTagTemplate               []gax.CallOption
	CreateTagTemplateField          []gax.CallOption
	UpdateTagTemplateField          []gax.CallOption
	RenameTagTemplateField          []gax.CallOption
	RenameTagTemplateFieldEnumValue []gax.CallOption
	DeleteTagTemplateField          []gax.CallOption
	CreateTag                       []gax.CallOption
	UpdateTag                       []gax.CallOption
	DeleteTag                       []gax.CallOption
	ListTags                        []gax.CallOption
	StarEntry                       []gax.CallOption
	UnstarEntry                     []gax.CallOption
	SetIamPolicy                    []gax.CallOption
	GetIamPolicy                    []gax.CallOption
	TestIamPermissions              []gax.CallOption
}

CallOptions contains the retry settings for each method of Client.

Client

type Client struct {

	// The call options for this service.
	CallOptions *CallOptions
	// contains filtered or unexported fields
}

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

Data Catalog API service allows you to discover, understand, and manage your data.

func NewClient

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

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

Data Catalog API service allows you to discover, understand, and manage your data.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(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.

func (*Client) CreateEntry

CreateEntry creates an entry.

You can create entries only with ‘FILESET’, ‘CLUSTER’, ‘DATA_STREAM’, or custom types. Data Catalog automatically creates entries with other types during metadata ingestion from integrated systems.

You must enable the Data Catalog API in the project identified by the parent parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

An entry group can have a maximum of 100,000 entries.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreateEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreateEntryRequest.
	}
	resp, err := c.CreateEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) CreateEntryGroup

CreateEntryGroup creates an entry group.

An entry group contains logically related entries together with Cloud Identity and Access Management (at /data-catalog/docs/concepts/iam) policies. These policies specify users who can create, edit, and view entries within entry groups.

Data Catalog automatically creates entry groups with names that start with the @ symbol for the following resources:

BigQuery entries (@bigquery)

Pub/Sub topics (@pubsub)

Dataproc Metastore services (@dataproc_metastore_{SERVICE_NAME_HASH})

You can create your own entry groups for Cloud Storage fileset entries and custom entries together with the corresponding IAM policies. User-created entry groups can’t contain the @ symbol, it is reserved for automatically created groups.

Entry groups, like entries, can be searched.

A maximum of 10,000 entry groups may be created per organization across all locations.

You must enable the Data Catalog API in the project identified by the parent parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreateEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreateEntryGroupRequest.
	}
	resp, err := c.CreateEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) CreateTag

CreateTag creates a tag and assigns it to:

An Entry if the method name is projects.locations.entryGroups.entries.tags.create.

Or EntryGroupif the method name is projects.locations.entryGroups.tags.create.

Note: The project identified by the parent parameter for the [tag] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters)) and the [tag template] (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters)) used to create the tag must be in the same organization.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreateTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreateTagRequest.
	}
	resp, err := c.CreateTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) CreateTagTemplate

CreateTagTemplate creates a tag template.

You must enable the Data Catalog API in the project identified by the parent parameter. For more information, see [Data Catalog resource project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreateTagTemplateRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreateTagTemplateRequest.
	}
	resp, err := c.CreateTagTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) CreateTagTemplateField

CreateTagTemplateField creates a field in a tag template.

You must enable the Data Catalog API in the project identified by the parent parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreateTagTemplateFieldRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreateTagTemplateFieldRequest.
	}
	resp, err := c.CreateTagTemplateField(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) DeleteEntry

func (c *Client) DeleteEntry(ctx context.Context, req *datacatalogpb.DeleteEntryRequest, opts ...gax.CallOption) error

DeleteEntry deletes an existing entry.

You can delete only the entries created by the CreateEntry method.

You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeleteEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeleteEntryRequest.
	}
	err = c.DeleteEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) DeleteEntryGroup

func (c *Client) DeleteEntryGroup(ctx context.Context, req *datacatalogpb.DeleteEntryGroupRequest, opts ...gax.CallOption) error

DeleteEntryGroup deletes an entry group.

You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeleteEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeleteEntryGroupRequest.
	}
	err = c.DeleteEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) DeleteTag

func (c *Client) DeleteTag(ctx context.Context, req *datacatalogpb.DeleteTagRequest, opts ...gax.CallOption) error

DeleteTag deletes a tag.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeleteTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeleteTagRequest.
	}
	err = c.DeleteTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) DeleteTagTemplate

func (c *Client) DeleteTagTemplate(ctx context.Context, req *datacatalogpb.DeleteTagTemplateRequest, opts ...gax.CallOption) error

DeleteTagTemplate deletes a tag template and all tags that use it.

You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeleteTagTemplateRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeleteTagTemplateRequest.
	}
	err = c.DeleteTagTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) DeleteTagTemplateField

func (c *Client) DeleteTagTemplateField(ctx context.Context, req *datacatalogpb.DeleteTagTemplateFieldRequest, opts ...gax.CallOption) error

DeleteTagTemplateField deletes a field in a tag template and all uses of this field from the tags based on this template.

You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeleteTagTemplateFieldRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeleteTagTemplateFieldRequest.
	}
	err = c.DeleteTagTemplateField(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) GetEntry

GetEntry gets an entry.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.GetEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#GetEntryRequest.
	}
	resp, err := c.GetEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetEntryGroup

GetEntryGroup gets an entry group.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.GetEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#GetEntryGroupRequest.
	}
	resp, err := c.GetEntryGroup(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 access control policy for a resource.

May return:

ANOT_FOUND error if the resource doesn’t exist or you don’t have the permission to view it.

An empty policy if the resource exists but doesn’t have a set policy.

Supported resources are:

Tag templates

Entry groups

Note: This method doesn’t get policies from Google Cloud Platform resources ingested into Data Catalog.

To call this method, you must have the following Google IAM permissions:

datacatalog.tagTemplates.getIamPolicy to get policies on tag templates.

datacatalog.entryGroups.getIamPolicy to get policies on entry groups.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	iampb "google.golang.org/genproto/googleapis/iam/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

func (*Client) GetTagTemplate

GetTagTemplate gets a tag template.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.GetTagTemplateRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#GetTagTemplateRequest.
	}
	resp, err := c.GetTagTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ListEntries

func (c *Client) ListEntries(ctx context.Context, req *datacatalogpb.ListEntriesRequest, opts ...gax.CallOption) *EntryIterator

ListEntries lists entries.

Note: Currently, this method can list only custom entries. To get a list of both custom and automatically created entries, use SearchCatalog.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	"google.golang.org/api/iterator"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ListEntriesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ListEntriesRequest.
	}
	it := c.ListEntries(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListEntryGroups

ListEntryGroups lists entry groups.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	"google.golang.org/api/iterator"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ListEntryGroupsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ListEntryGroupsRequest.
	}
	it := c.ListEntryGroups(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListTags

func (c *Client) ListTags(ctx context.Context, req *datacatalogpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator

ListTags lists tags assigned to an Entry. The columns in the response are lowercased.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	"google.golang.org/api/iterator"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ListTagsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ListTagsRequest.
	}
	it := c.ListTags(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) LookupEntry

LookupEntry gets an entry by its target resource name.

The resource name comes from the source Google Cloud Platform service.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.LookupEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#LookupEntryRequest.
	}
	resp, err := c.LookupEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ModifyEntryContacts

ModifyEntryContacts modifies contacts, part of the business context of an Entry.

To call this method, you must have the datacatalog.entries.updateContacts IAM permission on the corresponding project.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ModifyEntryContactsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ModifyEntryContactsRequest.
	}
	resp, err := c.ModifyEntryContacts(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ModifyEntryOverview

ModifyEntryOverview modifies entry overview, part of the business context of an Entry.

To call this method, you must have the datacatalog.entries.updateOverview IAM permission on the corresponding project.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ModifyEntryOverviewRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ModifyEntryOverviewRequest.
	}
	resp, err := c.ModifyEntryOverview(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) RenameTagTemplateField

RenameTagTemplateField renames a field in a tag template.

You must enable the Data Catalog API in the project identified by the name parameter. For more information, see [Data Catalog resource project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.RenameTagTemplateFieldRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#RenameTagTemplateFieldRequest.
	}
	resp, err := c.RenameTagTemplateField(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) RenameTagTemplateFieldEnumValue

RenameTagTemplateFieldEnumValue renames an enum value in a tag template.

Within a single enum field, enum values must be unique.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.RenameTagTemplateFieldEnumValueRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#RenameTagTemplateFieldEnumValueRequest.
	}
	resp, err := c.RenameTagTemplateFieldEnumValue(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) SearchCatalog

SearchCatalog searches Data Catalog for multiple resources like entries and tags that match a query.

This is a [Custom Method] (https://cloud.google.com/apis/design/custom_methods (at https://cloud.google.com/apis/design/custom_methods)) that doesn’t return all information on a resource, only its ID and high level fields. To get more information, you can subsequently call specific get methods.

Note: Data Catalog search queries don’t guarantee full recall. Results that match your query might not be returned, even in subsequent result pages. Additionally, returned (and not returned) results can vary if you repeat search queries.

For more information, see [Data Catalog search syntax] (https://cloud.google.com/data-catalog/docs/how-to/search-reference (at https://cloud.google.com/data-catalog/docs/how-to/search-reference)).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	"google.golang.org/api/iterator"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.SearchCatalogRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#SearchCatalogRequest.
	}
	it := c.SearchCatalog(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		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 an access control policy for a resource. Replaces any existing policy.

Supported resources are:

Tag templates

Entry groups

Note: This method sets policies only within Data Catalog and can’t be used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform resources synced with the Data Catalog.

To call this method, you must have the following Google IAM permissions:

datacatalog.tagTemplates.setIamPolicy to set policies on tag templates.

datacatalog.entryGroups.setIamPolicy to set policies on entry groups.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	iampb "google.golang.org/genproto/googleapis/iam/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

func (*Client) StarEntry

StarEntry marks an Entry as starred by the current user. Starring information is private to each user.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.StarEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#StarEntryRequest.
	}
	resp, err := c.StarEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) TestIamPermissions

TestIamPermissions gets your permissions on a resource.

Returns an empty set of permissions if the resource doesn’t exist.

Supported resources are:

Tag templates

Entry groups

Note: This method gets policies only within Data Catalog and can’t be used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform resources ingested into Data Catalog.

No Google IAM permissions are required to call this method.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	iampb "google.golang.org/genproto/googleapis/iam/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

func (*Client) UnstarEntry

UnstarEntry marks an Entry as NOT starred by the current user. Starring information is private to each user.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UnstarEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UnstarEntryRequest.
	}
	resp, err := c.UnstarEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) UpdateEntry

UpdateEntry updates an existing entry.

You must enable the Data Catalog API in the project identified by the entry.name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdateEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdateEntryRequest.
	}
	resp, err := c.UpdateEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) UpdateEntryGroup

UpdateEntryGroup updates an entry group.

You must enable the Data Catalog API in the project identified by the entry_group.name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdateEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdateEntryGroupRequest.
	}
	resp, err := c.UpdateEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) UpdateTag

UpdateTag updates an existing tag.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdateTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdateTagRequest.
	}
	resp, err := c.UpdateTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) UpdateTagTemplate

UpdateTagTemplate updates a tag template.

You can’t update template fields with this method. These fields are separate resources with their own create, update, and delete methods.

You must enable the Data Catalog API in the project identified by the tag_template.name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdateTagTemplateRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdateTagTemplateRequest.
	}
	resp, err := c.UpdateTagTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) UpdateTagTemplateField

UpdateTagTemplateField updates a field in a tag template.

You can’t update the field type with this method.

You must enable the Data Catalog API in the project identified by the name parameter. For more information, see Data Catalog resource project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project).

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdateTagTemplateFieldRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdateTagTemplateFieldRequest.
	}
	resp, err := c.UpdateTagTemplateField(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

EntryGroupIterator

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

EntryGroupIterator manages a stream of *datacatalogpb.EntryGroup.

func (*EntryGroupIterator) Next

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 (*EntryGroupIterator) PageInfo

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

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

EntryIterator

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

EntryIterator manages a stream of *datacatalogpb.Entry.

func (*EntryIterator) Next

func (it *EntryIterator) Next() (*datacatalogpb.Entry, 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 (*EntryIterator) PageInfo

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

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

PolicyTagIterator

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

PolicyTagIterator manages a stream of *datacatalogpb.PolicyTag.

func (*PolicyTagIterator) Next

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 (*PolicyTagIterator) PageInfo

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

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

PolicyTagManagerCallOptions

type PolicyTagManagerCallOptions struct {
	CreateTaxonomy     []gax.CallOption
	DeleteTaxonomy     []gax.CallOption
	UpdateTaxonomy     []gax.CallOption
	ListTaxonomies     []gax.CallOption
	GetTaxonomy        []gax.CallOption
	CreatePolicyTag    []gax.CallOption
	DeletePolicyTag    []gax.CallOption
	UpdatePolicyTag    []gax.CallOption
	ListPolicyTags     []gax.CallOption
	GetPolicyTag       []gax.CallOption
	GetIamPolicy       []gax.CallOption
	SetIamPolicy       []gax.CallOption
	TestIamPermissions []gax.CallOption
}

PolicyTagManagerCallOptions contains the retry settings for each method of PolicyTagManagerClient.

PolicyTagManagerClient

type PolicyTagManagerClient struct {

	// The call options for this service.
	CallOptions *PolicyTagManagerCallOptions
	// contains filtered or unexported fields
}

PolicyTagManagerClient is a client for interacting with Google Cloud Data Catalog API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Policy Tag Manager API service allows you to manage your policy tags and taxonomies.

Policy tags are used to tag BigQuery columns and apply additional access control policies. A taxonomy is a hierarchical grouping of policy tags that classify data along a common axis.

func NewPolicyTagManagerClient

func NewPolicyTagManagerClient(ctx context.Context, opts ...option.ClientOption) (*PolicyTagManagerClient, error)

NewPolicyTagManagerClient creates a new policy tag manager client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Policy Tag Manager API service allows you to manage your policy tags and taxonomies.

Policy tags are used to tag BigQuery columns and apply additional access control policies. A taxonomy is a hierarchical grouping of policy tags that classify data along a common axis.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*PolicyTagManagerClient) Close

func (c *PolicyTagManagerClient) Close() error

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

func (*PolicyTagManagerClient) Connection

func (c *PolicyTagManagerClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*PolicyTagManagerClient) CreatePolicyTag

CreatePolicyTag creates a policy tag in a taxonomy.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreatePolicyTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreatePolicyTagRequest.
	}
	resp, err := c.CreatePolicyTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerClient) CreateTaxonomy

CreateTaxonomy creates a taxonomy in a specified project.

The taxonomy is initially empty, that is, it doesn’t contain policy tags.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.CreateTaxonomyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#CreateTaxonomyRequest.
	}
	resp, err := c.CreateTaxonomy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerClient) DeletePolicyTag

DeletePolicyTag deletes a policy tag together with the following:

All of its descendant policy tags, if any

Policies associated with the policy tag and its descendants

References from BigQuery table schema of the policy tag and its descendants

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeletePolicyTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeletePolicyTagRequest.
	}
	err = c.DeletePolicyTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*PolicyTagManagerClient) DeleteTaxonomy

DeleteTaxonomy deletes a taxonomy, including all policy tags in this taxonomy, their associated policies, and the policy tags references from BigQuery columns.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.DeleteTaxonomyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#DeleteTaxonomyRequest.
	}
	err = c.DeleteTaxonomy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*PolicyTagManagerClient) GetIamPolicy

GetIamPolicy gets the IAM policy for a policy tag or a taxonomy.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	iampb "google.golang.org/genproto/googleapis/iam/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

func (*PolicyTagManagerClient) GetPolicyTag

GetPolicyTag gets a policy tag.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.GetPolicyTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#GetPolicyTagRequest.
	}
	resp, err := c.GetPolicyTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerClient) GetTaxonomy

GetTaxonomy gets a taxonomy.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.GetTaxonomyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#GetTaxonomyRequest.
	}
	resp, err := c.GetTaxonomy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerClient) ListPolicyTags

ListPolicyTags lists all policy tags in a taxonomy.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	"google.golang.org/api/iterator"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ListPolicyTagsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ListPolicyTagsRequest.
	}
	it := c.ListPolicyTags(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*PolicyTagManagerClient) ListTaxonomies

ListTaxonomies lists all taxonomies in a project in a particular location that you have a permission to view.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	"google.golang.org/api/iterator"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ListTaxonomiesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ListTaxonomiesRequest.
	}
	it := c.ListTaxonomies(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*PolicyTagManagerClient) SetIamPolicy

SetIamPolicy sets the IAM policy for a policy tag or a taxonomy.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	iampb "google.golang.org/genproto/googleapis/iam/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

func (*PolicyTagManagerClient) TestIamPermissions

TestIamPermissions returns your permissions on a specified policy tag or taxonomy.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	iampb "google.golang.org/genproto/googleapis/iam/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

func (*PolicyTagManagerClient) UpdatePolicyTag

UpdatePolicyTag updates a policy tag, including its display name, description, and parent policy tag.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdatePolicyTagRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdatePolicyTagRequest.
	}
	resp, err := c.UpdatePolicyTag(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerClient) UpdateTaxonomy

UpdateTaxonomy updates a taxonomy, including its display name, description, and activated policy types.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"

	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.UpdateTaxonomyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#UpdateTaxonomyRequest.
	}
	resp, err := c.UpdateTaxonomy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

PolicyTagManagerSerializationCallOptions

type PolicyTagManagerSerializationCallOptions struct {
	ReplaceTaxonomy  []gax.CallOption
	ImportTaxonomies []gax.CallOption
	ExportTaxonomies []gax.CallOption
}

PolicyTagManagerSerializationCallOptions contains the retry settings for each method of PolicyTagManagerSerializationClient.

PolicyTagManagerSerializationClient

type PolicyTagManagerSerializationClient struct {

	// The call options for this service.
	CallOptions *PolicyTagManagerSerializationCallOptions
	// contains filtered or unexported fields
}

PolicyTagManagerSerializationClient is a client for interacting with Google Cloud Data Catalog API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Policy Tag Manager Serialization API service allows you to manipulate your policy tags and taxonomies in a serialized format.

Taxonomy is a hierarchical group of policy tags.

func NewPolicyTagManagerSerializationClient

func NewPolicyTagManagerSerializationClient(ctx context.Context, opts ...option.ClientOption) (*PolicyTagManagerSerializationClient, error)

NewPolicyTagManagerSerializationClient creates a new policy tag manager serialization client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Policy Tag Manager Serialization API service allows you to manipulate your policy tags and taxonomies in a serialized format.

Taxonomy is a hierarchical group of policy tags.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerSerializationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*PolicyTagManagerSerializationClient) Close

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

func (*PolicyTagManagerSerializationClient) Connection

func (c *PolicyTagManagerSerializationClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*PolicyTagManagerSerializationClient) ExportTaxonomies

ExportTaxonomies exports taxonomies in the requested type and returns them, including their policy tags. The requested taxonomies must belong to the same project.

This method generates SerializedTaxonomy protocol buffers with nested policy tags that can be used as input for ImportTaxonomies calls.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerSerializationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ExportTaxonomiesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ExportTaxonomiesRequest.
	}
	resp, err := c.ExportTaxonomies(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerSerializationClient) ImportTaxonomies

ImportTaxonomies creates new taxonomies (including their policy tags) in a given project by importing from inlined or cross-regional sources.

For a cross-regional source, new taxonomies are created by copying from a source in another region.

For an inlined source, taxonomies and policy tags are created in bulk using nested protocol buffer structures.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerSerializationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ImportTaxonomiesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ImportTaxonomiesRequest.
	}
	resp, err := c.ImportTaxonomies(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*PolicyTagManagerSerializationClient) ReplaceTaxonomy

ReplaceTaxonomy replaces (updates) a taxonomy and all its policy tags.

The taxonomy and its entire hierarchy of policy tags must be represented literally by SerializedTaxonomy and the nested SerializedPolicyTag messages.

This operation automatically does the following:

Deletes the existing policy tags that are missing from the SerializedPolicyTag.

Creates policy tags that don’t have resource names. They are considered new.

Updates policy tags with valid resources names accordingly.

Example

package main

import (
	"context"

	datacatalog "cloud.google.com/go/datacatalog/apiv1"
	datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1"
)

func main() {
	ctx := context.Background()
	c, err := datacatalog.NewPolicyTagManagerSerializationClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &datacatalogpb.ReplaceTaxonomyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datacatalog/v1#ReplaceTaxonomyRequest.
	}
	resp, err := c.ReplaceTaxonomy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

SearchCatalogResultIterator

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

SearchCatalogResultIterator manages a stream of *datacatalogpb.SearchCatalogResult.

func (*SearchCatalogResultIterator) Next

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 (*SearchCatalogResultIterator) PageInfo

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

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

TagIterator

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

TagIterator manages a stream of *datacatalogpb.Tag.

func (*TagIterator) Next

func (it *TagIterator) Next() (*datacatalogpb.Tag, 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 (*TagIterator) PageInfo

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

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

TaxonomyIterator

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

TaxonomyIterator manages a stream of *datacatalogpb.Taxonomy.

func (*TaxonomyIterator) Next

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 (*TaxonomyIterator) PageInfo

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

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