Class DataCatalogClient (1.7.2)

public class DataCatalogClient implements BackgroundResource

Service Description: Data Catalog API service allows clients to discover, understand, and manage their data.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String entryGroupId = "entryGroupId1228924712";
   EntryGroup entryGroup = EntryGroup.newBuilder().build();
   EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
 }
 

Note: close() needs to be called on the DataCatalogClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of DataCatalogSettings to create(). For example:

To customize credentials:


 DataCatalogSettings dataCatalogSettings =
     DataCatalogSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings);
 

To customize the endpoint:


 DataCatalogSettings dataCatalogSettings =
     DataCatalogSettings.newBuilder().setEndpoint(myEndpoint).build();
 DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > DataCatalogClient

Implements

BackgroundResource

Static Methods

create()

public static final DataCatalogClient create()

Constructs an instance of DataCatalogClient with default settings.

Returns
TypeDescription
DataCatalogClient
Exceptions
TypeDescription
IOException

create(DataCatalogSettings settings)

public static final DataCatalogClient create(DataCatalogSettings settings)

Constructs an instance of DataCatalogClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsDataCatalogSettings
Returns
TypeDescription
DataCatalogClient
Exceptions
TypeDescription
IOException

create(DataCatalogStub stub)

public static final DataCatalogClient create(DataCatalogStub stub)

Constructs an instance of DataCatalogClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataCatalogSettings).

Parameter
NameDescription
stubDataCatalogStub
Returns
TypeDescription
DataCatalogClient

Constructors

DataCatalogClient(DataCatalogSettings settings)

protected DataCatalogClient(DataCatalogSettings settings)

Constructs an instance of DataCatalogClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsDataCatalogSettings

DataCatalogClient(DataCatalogStub stub)

protected DataCatalogClient(DataCatalogStub stub)
Parameter
NameDescription
stubDataCatalogStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createEntry(CreateEntryRequest request)

public final Entry createEntry(CreateEntryRequest request)

Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

A maximum of 100,000 entries may be created per entry group.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryRequest request =
       CreateEntryRequest.newBuilder()
           .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setEntryId("entryId-1591558867")
           .setEntry(Entry.newBuilder().build())
           .build();
   Entry response = dataCatalogClient.createEntry(request);
 }
 
Parameter
NameDescription
requestCreateEntryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Entry

createEntry(EntryGroupName parent, String entryId, Entry entry)

public final Entry createEntry(EntryGroupName parent, String entryId, Entry entry)

Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

A maximum of 100,000 entries may be created per entry group.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
   String entryId = "entryId-1591558867";
   Entry entry = Entry.newBuilder().build();
   Entry response = dataCatalogClient.createEntry(parent, entryId, entry);
 }
 
Parameters
NameDescription
parentEntryGroupName

Required. The name of the entry group this entry is in. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}

Note that this Entry and its child resources may not actually be stored in the location in this name.

entryIdString

Required. The id of the entry to create.

entryEntry

Required. The entry to create.

Returns
TypeDescription
Entry

createEntry(String parent, String entryId, Entry entry)

public final Entry createEntry(String parent, String entryId, Entry entry)

Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

A maximum of 100,000 entries may be created per entry group.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString();
   String entryId = "entryId-1591558867";
   Entry entry = Entry.newBuilder().build();
   Entry response = dataCatalogClient.createEntry(parent, entryId, entry);
 }
 
Parameters
NameDescription
parentString

Required. The name of the entry group this entry is in. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}

Note that this Entry and its child resources may not actually be stored in the location in this name.

entryIdString

Required. The id of the entry to create.

entryEntry

Required. The entry to create.

Returns
TypeDescription
Entry

createEntryCallable()

public final UnaryCallable<CreateEntryRequest,Entry> createEntryCallable()

Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

A maximum of 100,000 entries may be created per entry group.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryRequest request =
       CreateEntryRequest.newBuilder()
           .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setEntryId("entryId-1591558867")
           .setEntry(Entry.newBuilder().build())
           .build();
   ApiFuture<Entry> future = dataCatalogClient.createEntryCallable().futureCall(request);
   // Do something.
   Entry response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateEntryRequest,Entry>

createEntryGroup(CreateEntryGroupRequest request)

public final EntryGroup createEntryGroup(CreateEntryGroupRequest request)

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

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryGroupRequest request =
       CreateEntryGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEntryGroupId("entryGroupId1228924712")
           .setEntryGroup(EntryGroup.newBuilder().build())
           .build();
   EntryGroup response = dataCatalogClient.createEntryGroup(request);
 }
 
Parameter
NameDescription
requestCreateEntryGroupRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
EntryGroup

createEntryGroup(LocationName parent, String entryGroupId, EntryGroup entryGroup)

public final EntryGroup createEntryGroup(LocationName parent, String entryGroupId, EntryGroup entryGroup)

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

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String entryGroupId = "entryGroupId1228924712";
   EntryGroup entryGroup = EntryGroup.newBuilder().build();
   EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
 }
 
Parameters
NameDescription
parentLocationName

Required. The name of the project this entry group is in. Example:

  • projects/{project_id}/locations/{location}

Note that this EntryGroup and its child resources may not actually be stored in the location in this name.

entryGroupIdString

Required. The id of the entry group to create. The id must begin with a letter or underscore, contain only English letters, numbers and underscores, and be at most 64 characters.

entryGroupEntryGroup

The entry group to create. Defaults to an empty entry group.

Returns
TypeDescription
EntryGroup

createEntryGroup(String parent, String entryGroupId, EntryGroup entryGroup)

public final EntryGroup createEntryGroup(String parent, String entryGroupId, EntryGroup entryGroup)

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

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   String entryGroupId = "entryGroupId1228924712";
   EntryGroup entryGroup = EntryGroup.newBuilder().build();
   EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
 }
 
Parameters
NameDescription
parentString

Required. The name of the project this entry group is in. Example:

  • projects/{project_id}/locations/{location}

Note that this EntryGroup and its child resources may not actually be stored in the location in this name.

entryGroupIdString

Required. The id of the entry group to create. The id must begin with a letter or underscore, contain only English letters, numbers and underscores, and be at most 64 characters.

entryGroupEntryGroup

The entry group to create. Defaults to an empty entry group.

Returns
TypeDescription
EntryGroup

createEntryGroupCallable()

public final UnaryCallable<CreateEntryGroupRequest,EntryGroup> createEntryGroupCallable()

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

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryGroupRequest request =
       CreateEntryGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEntryGroupId("entryGroupId1228924712")
           .setEntryGroup(EntryGroup.newBuilder().build())
           .build();
   ApiFuture<EntryGroup> future =
       dataCatalogClient.createEntryGroupCallable().futureCall(request);
   // Do something.
   EntryGroup response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateEntryGroupRequest,EntryGroup>

createTag(CreateTagRequest request)

public final Tag createTag(CreateTagRequest request)

Creates a tag on an Entry. Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be from the same organization.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagRequest request =
       CreateTagRequest.newBuilder()
           .setParent(
               TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]")
                   .toString())
           .setTag(Tag.newBuilder().build())
           .build();
   Tag response = dataCatalogClient.createTag(request);
 }
 
Parameter
NameDescription
requestCreateTagRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Tag

createTag(TagName parent, Tag tag)

public final Tag createTag(TagName parent, Tag tag)

Creates a tag on an Entry. Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be from the same organization.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
   Tag tag = Tag.newBuilder().build();
   Tag response = dataCatalogClient.createTag(parent, tag);
 }
 
Parameters
NameDescription
parentTagName

Required. The name of the resource to attach this tag to. Tags can be attached to Entries. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Note that this Tag and its child resources may not actually be stored in the location in this name.

tagTag

Required. The tag to create.

Returns
TypeDescription
Tag

createTag(String parent, Tag tag)

public final Tag createTag(String parent, Tag tag)

Creates a tag on an Entry. Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be from the same organization.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent =
       TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString();
   Tag tag = Tag.newBuilder().build();
   Tag response = dataCatalogClient.createTag(parent, tag);
 }
 
Parameters
NameDescription
parentString

Required. The name of the resource to attach this tag to. Tags can be attached to Entries. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Note that this Tag and its child resources may not actually be stored in the location in this name.

tagTag

Required. The tag to create.

Returns
TypeDescription
Tag

createTagCallable()

public final UnaryCallable<CreateTagRequest,Tag> createTagCallable()

Creates a tag on an Entry. Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be from the same organization.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagRequest request =
       CreateTagRequest.newBuilder()
           .setParent(
               TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]")
                   .toString())
           .setTag(Tag.newBuilder().build())
           .build();
   ApiFuture<Tag> future = dataCatalogClient.createTagCallable().futureCall(request);
   // Do something.
   Tag response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateTagRequest,Tag>

createTagTemplate(CreateTagTemplateRequest request)

public final TagTemplate createTagTemplate(CreateTagTemplateRequest request)

Creates a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagTemplateRequest request =
       CreateTagTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTagTemplateId("tagTemplateId-1438776721")
           .setTagTemplate(TagTemplate.newBuilder().build())
           .build();
   TagTemplate response = dataCatalogClient.createTagTemplate(request);
 }
 
Parameter
NameDescription
requestCreateTagTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
TagTemplate

createTagTemplate(LocationName parent, String tagTemplateId, TagTemplate tagTemplate)

public final TagTemplate createTagTemplate(LocationName parent, String tagTemplateId, TagTemplate tagTemplate)

Creates a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String tagTemplateId = "tagTemplateId-1438776721";
   TagTemplate tagTemplate = TagTemplate.newBuilder().build();
   TagTemplate response =
       dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate);
 }
 
Parameters
NameDescription
parentLocationName

Required. The name of the project and the template location [region](https://cloud.google.com/data-catalog/docs/concepts/regions.

Example:

  • projects/{project_id}/locations/us-central1

tagTemplateIdString

Required. The id of the tag template to create.

tagTemplateTagTemplate

Required. The tag template to create.

Returns
TypeDescription
TagTemplate

createTagTemplate(String parent, String tagTemplateId, TagTemplate tagTemplate)

public final TagTemplate createTagTemplate(String parent, String tagTemplateId, TagTemplate tagTemplate)

Creates a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   String tagTemplateId = "tagTemplateId-1438776721";
   TagTemplate tagTemplate = TagTemplate.newBuilder().build();
   TagTemplate response =
       dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate);
 }
 
Parameters
NameDescription
parentString

Required. The name of the project and the template location [region](https://cloud.google.com/data-catalog/docs/concepts/regions.

Example:

  • projects/{project_id}/locations/us-central1

tagTemplateIdString

Required. The id of the tag template to create.

tagTemplateTagTemplate

Required. The tag template to create.

Returns
TypeDescription
TagTemplate

createTagTemplateCallable()

public final UnaryCallable<CreateTagTemplateRequest,TagTemplate> createTagTemplateCallable()

Creates a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagTemplateRequest request =
       CreateTagTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTagTemplateId("tagTemplateId-1438776721")
           .setTagTemplate(TagTemplate.newBuilder().build())
           .build();
   ApiFuture<TagTemplate> future =
       dataCatalogClient.createTagTemplateCallable().futureCall(request);
   // Do something.
   TagTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateTagTemplateRequest,TagTemplate>

createTagTemplateField(CreateTagTemplateFieldRequest request)

public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldRequest request)

Creates a field in a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagTemplateFieldRequest request =
       CreateTagTemplateFieldRequest.newBuilder()
           .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString())
           .setTagTemplateFieldId("tagTemplateFieldId-1556835615")
           .setTagTemplateField(TagTemplateField.newBuilder().build())
           .build();
   TagTemplateField response = dataCatalogClient.createTagTemplateField(request);
 }
 
Parameter
NameDescription
requestCreateTagTemplateFieldRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
TagTemplateField

createTagTemplateField(TagTemplateName parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)

public final TagTemplateField createTagTemplateField(TagTemplateName parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)

Creates a field in a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
   String tagTemplateFieldId = "tagTemplateFieldId-1556835615";
   TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
   TagTemplateField response =
       dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField);
 }
 
Parameters
NameDescription
parentTagTemplateName

Required. The name of the project and the template location region.

Example:

  • projects/{project_id}/locations/us-central1/tagTemplates/{tag_template_id}

tagTemplateFieldIdString

Required. The ID of the tag template field to create. Field ids can contain letters (both uppercase and lowercase), numbers (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 character long and at most 128 characters long. Field IDs must also be unique within their template.

tagTemplateFieldTagTemplateField

Required. The tag template field to create.

Returns
TypeDescription
TagTemplateField

createTagTemplateField(String parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)

public final TagTemplateField createTagTemplateField(String parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)

Creates a field in a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString();
   String tagTemplateFieldId = "tagTemplateFieldId-1556835615";
   TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
   TagTemplateField response =
       dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField);
 }
 
Parameters
NameDescription
parentString

Required. The name of the project and the template location region.

Example:

  • projects/{project_id}/locations/us-central1/tagTemplates/{tag_template_id}

tagTemplateFieldIdString

Required. The ID of the tag template field to create. Field ids can contain letters (both uppercase and lowercase), numbers (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 character long and at most 128 characters long. Field IDs must also be unique within their template.

tagTemplateFieldTagTemplateField

Required. The tag template field to create.

Returns
TypeDescription
TagTemplateField

createTagTemplateFieldCallable()

public final UnaryCallable<CreateTagTemplateFieldRequest,TagTemplateField> createTagTemplateFieldCallable()

Creates a field in a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagTemplateFieldRequest request =
       CreateTagTemplateFieldRequest.newBuilder()
           .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString())
           .setTagTemplateFieldId("tagTemplateFieldId-1556835615")
           .setTagTemplateField(TagTemplateField.newBuilder().build())
           .build();
   ApiFuture<TagTemplateField> future =
       dataCatalogClient.createTagTemplateFieldCallable().futureCall(request);
   // Do something.
   TagTemplateField response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateTagTemplateFieldRequest,TagTemplateField>

deleteEntry(DeleteEntryRequest request)

public final void deleteEntry(DeleteEntryRequest request)

Deletes an existing entry. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteEntryRequest request =
       DeleteEntryRequest.newBuilder()
           .setName(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .build();
   dataCatalogClient.deleteEntry(request);
 }
 
Parameter
NameDescription
requestDeleteEntryRequest

The request object containing all of the parameters for the API call.

deleteEntry(EntryName name)

public final void deleteEntry(EntryName name)

Deletes an existing entry. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
   dataCatalogClient.deleteEntry(name);
 }
 
Parameter
NameDescription
nameEntryName

Required. The name of the entry. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

deleteEntry(String name)

public final void deleteEntry(String name)

Deletes an existing entry. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString();
   dataCatalogClient.deleteEntry(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the entry. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

deleteEntryCallable()

public final UnaryCallable<DeleteEntryRequest,Empty> deleteEntryCallable()

Deletes an existing entry. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteEntryRequest request =
       DeleteEntryRequest.newBuilder()
           .setName(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .build();
   ApiFuture<Empty> future = dataCatalogClient.deleteEntryCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteEntryRequest,Empty>

deleteEntryGroup(DeleteEntryGroupRequest request)

public final void deleteEntryGroup(DeleteEntryGroupRequest request)

Deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteEntryGroupRequest request =
       DeleteEntryGroupRequest.newBuilder()
           .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setForce(true)
           .build();
   dataCatalogClient.deleteEntryGroup(request);
 }
 
Parameter
NameDescription
requestDeleteEntryGroupRequest

The request object containing all of the parameters for the API call.

deleteEntryGroup(EntryGroupName name)

public final void deleteEntryGroup(EntryGroupName name)

Deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
   dataCatalogClient.deleteEntryGroup(name);
 }
 
Parameter
NameDescription
nameEntryGroupName

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

deleteEntryGroup(String name)

public final void deleteEntryGroup(String name)

Deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString();
   dataCatalogClient.deleteEntryGroup(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

deleteEntryGroupCallable()

public final UnaryCallable<DeleteEntryGroupRequest,Empty> deleteEntryGroupCallable()

Deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteEntryGroupRequest request =
       DeleteEntryGroupRequest.newBuilder()
           .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setForce(true)
           .build();
   ApiFuture<Empty> future = dataCatalogClient.deleteEntryGroupCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteEntryGroupRequest,Empty>

deleteTag(DeleteTagRequest request)

public final void deleteTag(DeleteTagRequest request)

Deletes a tag.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteTagRequest request =
       DeleteTagRequest.newBuilder()
           .setName(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .build();
   dataCatalogClient.deleteTag(request);
 }
 
Parameter
NameDescription
requestDeleteTagRequest

The request object containing all of the parameters for the API call.

deleteTag(EntryName name)

public final void deleteTag(EntryName name)

Deletes a tag.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
   dataCatalogClient.deleteTag(name);
 }
 
Parameter
NameDescription
nameEntryName

Required. The name of the tag to delete. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}

deleteTag(String name)

public final void deleteTag(String name)

Deletes a tag.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString();
   dataCatalogClient.deleteTag(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the tag to delete. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}

deleteTagCallable()

public final UnaryCallable<DeleteTagRequest,Empty> deleteTagCallable()

Deletes a tag.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteTagRequest request =
       DeleteTagRequest.newBuilder()
           .setName(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .build();
   ApiFuture<Empty> future = dataCatalogClient.deleteTagCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteTagRequest,Empty>

deleteTagTemplate(DeleteTagTemplateRequest request)

public final void deleteTagTemplate(DeleteTagTemplateRequest request)

Deletes a tag template and all tags using the template. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteTagTemplateRequest request =
       DeleteTagTemplateRequest.newBuilder()
           .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString())
           .setForce(true)
           .build();
   dataCatalogClient.deleteTagTemplate(request);
 }
 
Parameter
NameDescription
requestDeleteTagTemplateRequest

The request object containing all of the parameters for the API call.

deleteTagTemplate(TagTemplateName name, boolean force)

public final void deleteTagTemplate(TagTemplateName name, boolean force)

Deletes a tag template and all tags using the template. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
   boolean force = true;
   dataCatalogClient.deleteTagTemplate(name, force);
 }
 
Parameters
NameDescription
nameTagTemplateName

Required. The name of the tag template to delete. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}

forceboolean

Required. Currently, this field must always be set to true. This confirms the deletion of any possible tags using this template. force = false will be supported in the future.

deleteTagTemplate(String name, boolean force)

public final void deleteTagTemplate(String name, boolean force)

Deletes a tag template and all tags using the template. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString();
   boolean force = true;
   dataCatalogClient.deleteTagTemplate(name, force);
 }
 
Parameters
NameDescription
nameString

Required. The name of the tag template to delete. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}

forceboolean

Required. Currently, this field must always be set to true. This confirms the deletion of any possible tags using this template. force = false will be supported in the future.

deleteTagTemplateCallable()

public final UnaryCallable<DeleteTagTemplateRequest,Empty> deleteTagTemplateCallable()

Deletes a tag template and all tags using the template. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteTagTemplateRequest request =
       DeleteTagTemplateRequest.newBuilder()
           .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString())
           .setForce(true)
           .build();
   ApiFuture<Empty> future = dataCatalogClient.deleteTagTemplateCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteTagTemplateRequest,Empty>

deleteTagTemplateField(DeleteTagTemplateFieldRequest request)

public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request)

Deletes a field in a tag template and all uses of that field. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteTagTemplateFieldRequest request =
       DeleteTagTemplateFieldRequest.newBuilder()
           .setName(
               TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]")
                   .toString())
           .setForce(true)
           .build();
   dataCatalogClient.deleteTagTemplateField(request);
 }
 
Parameter
NameDescription
requestDeleteTagTemplateFieldRequest

The request object containing all of the parameters for the API call.

deleteTagTemplateField(TagTemplateFieldName name, boolean force)

public final void deleteTagTemplateField(TagTemplateFieldName name, boolean force)

Deletes a field in a tag template and all uses of that field. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   TagTemplateFieldName name =
       TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
   boolean force = true;
   dataCatalogClient.deleteTagTemplateField(name, force);
 }
 
Parameters
NameDescription
nameTagTemplateFieldName

Required. The name of the tag template field to delete. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}

forceboolean

Required. Currently, this field must always be set to true. This confirms the deletion of this field from any tags using this field. force = false will be supported in the future.

deleteTagTemplateField(String name, boolean force)

public final void deleteTagTemplateField(String name, boolean force)

Deletes a field in a tag template and all uses of that field. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name =
       TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]")
           .toString();
   boolean force = true;
   dataCatalogClient.deleteTagTemplateField(name, force);
 }
 
Parameters
NameDescription
nameString

Required. The name of the tag template field to delete. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}

forceboolean

Required. Currently, this field must always be set to true. This confirms the deletion of this field from any tags using this field. force = false will be supported in the future.

deleteTagTemplateFieldCallable()

public final UnaryCallable<DeleteTagTemplateFieldRequest,Empty> deleteTagTemplateFieldCallable()

Deletes a field in a tag template and all uses of that field. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   DeleteTagTemplateFieldRequest request =
       DeleteTagTemplateFieldRequest.newBuilder()
           .setName(
               TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]")
                   .toString())
           .setForce(true)
           .build();
   ApiFuture<Empty> future =
       dataCatalogClient.deleteTagTemplateFieldCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteTagTemplateFieldRequest,Empty>

getEntry(EntryName name)

public final Entry getEntry(EntryName name)

Gets an entry.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
   Entry response = dataCatalogClient.getEntry(name);
 }
 
Parameter
NameDescription
nameEntryName

Required. The name of the entry. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Returns
TypeDescription
Entry

getEntry(GetEntryRequest request)

public final Entry getEntry(GetEntryRequest request)

Gets an entry.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   GetEntryRequest request =
       GetEntryRequest.newBuilder()
           .setName(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .build();
   Entry response = dataCatalogClient.getEntry(request);
 }
 
Parameter
NameDescription
requestGetEntryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Entry

getEntry(String name)

public final Entry getEntry(String name)

Gets an entry.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString();
   Entry response = dataCatalogClient.getEntry(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the entry. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Returns
TypeDescription
Entry

getEntryCallable()

public final UnaryCallable<GetEntryRequest,Entry> getEntryCallable()

Gets an entry.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   GetEntryRequest request =
       GetEntryRequest.newBuilder()
           .setName(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .build();
   ApiFuture<Entry> future = dataCatalogClient.getEntryCallable().futureCall(request);
   // Do something.
   Entry response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetEntryRequest,Entry>

getEntryGroup(EntryGroupName name)

public final EntryGroup getEntryGroup(EntryGroupName name)

Gets an EntryGroup.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
   EntryGroup response = dataCatalogClient.getEntryGroup(name);
 }
 
Parameter
NameDescription
nameEntryGroupName

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

Returns
TypeDescription
EntryGroup

getEntryGroup(EntryGroupName name, FieldMask readMask)

public final EntryGroup getEntryGroup(EntryGroupName name, FieldMask readMask)

Gets an EntryGroup.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
   FieldMask readMask = FieldMask.newBuilder().build();
   EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask);
 }
 
Parameters
NameDescription
nameEntryGroupName

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

readMaskFieldMask

The fields to return. If not set or empty, all fields are returned.

Returns
TypeDescription
EntryGroup

getEntryGroup(GetEntryGroupRequest request)

public final EntryGroup getEntryGroup(GetEntryGroupRequest request)

Gets an EntryGroup.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   GetEntryGroupRequest request =
       GetEntryGroupRequest.newBuilder()
           .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setReadMask(FieldMask.newBuilder().build())
           .build();
   EntryGroup response = dataCatalogClient.getEntryGroup(request);
 }
 
Parameter
NameDescription
requestGetEntryGroupRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
EntryGroup

getEntryGroup(String name)

public final EntryGroup getEntryGroup(String name)

Gets an EntryGroup.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString();
   EntryGroup response = dataCatalogClient.getEntryGroup(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

Returns
TypeDescription
EntryGroup

getEntryGroup(String name, FieldMask readMask)

public final EntryGroup getEntryGroup(String name, FieldMask readMask)

Gets an EntryGroup.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString();
   FieldMask readMask = FieldMask.newBuilder().build();
   EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask);
 }
 
Parameters
NameDescription
nameString

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

readMaskFieldMask

The fields to return. If not set or empty, all fields are returned.

Returns
TypeDescription
EntryGroup

getEntryGroupCallable()

public final UnaryCallable<GetEntryGroupRequest,EntryGroup> getEntryGroupCallable()

Gets an EntryGroup.

Sample code:


 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   GetEntryGroupRequest request =
       GetEntryGroupRequest