@Generated(value="by gapic-generator") @BetaApi public class DataCatalogClient extends Object implements com.google.api.gax.core.BackgroundResource
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()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String entryGroupId = "";
EntryGroup entryGroup = EntryGroup.newBuilder().build();
EntryGroup response = dataCatalogClient.createEntryGroup(formattedParent, 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:
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);
Modifier and Type | Class and Description |
---|---|
static class |
DataCatalogClient.ListTagsFixedSizeCollection |
static class |
DataCatalogClient.ListTagsPage |
static class |
DataCatalogClient.ListTagsPagedResponse |
static class |
DataCatalogClient.SearchCatalogFixedSizeCollection |
static class |
DataCatalogClient.SearchCatalogPage |
static class |
DataCatalogClient.SearchCatalogPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
DataCatalogClient(DataCatalogSettings settings)
Constructs an instance of DataCatalogClient, using the given settings.
|
protected |
DataCatalogClient(DataCatalogStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DataCatalogClient |
create()
Constructs an instance of DataCatalogClient with default settings.
|
static DataCatalogClient |
create(DataCatalogSettings settings)
Constructs an instance of DataCatalogClient, using the given settings.
|
static DataCatalogClient |
create(DataCatalogStub stub)
Constructs an instance of DataCatalogClient, using the given stub for making calls.
|
Entry |
createEntry(CreateEntryRequest request)
Alpha feature.
|
Entry |
createEntry(String parent,
String entryId,
Entry entry)
Alpha feature.
|
com.google.api.gax.rpc.UnaryCallable<CreateEntryRequest,Entry> |
createEntryCallable()
Alpha feature.
|
EntryGroup |
createEntryGroup(CreateEntryGroupRequest request)
Alpha feature.
|
EntryGroup |
createEntryGroup(String parent,
String entryGroupId,
EntryGroup entryGroup)
Alpha feature.
|
com.google.api.gax.rpc.UnaryCallable<CreateEntryGroupRequest,EntryGroup> |
createEntryGroupCallable()
Alpha feature.
|
Tag |
createTag(CreateTagRequest request)
Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
Tag |
createTag(String parent,
Tag tag)
Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
com.google.api.gax.rpc.UnaryCallable<CreateTagRequest,Tag> |
createTagCallable()
Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
TagTemplate |
createTagTemplate(CreateTagTemplateRequest request)
Creates a tag template.
|
TagTemplate |
createTagTemplate(String parent,
String tagTemplateId,
TagTemplate tagTemplate)
Creates a tag template.
|
com.google.api.gax.rpc.UnaryCallable<CreateTagTemplateRequest,TagTemplate> |
createTagTemplateCallable()
Creates a tag template.
|
TagTemplateField |
createTagTemplateField(CreateTagTemplateFieldRequest request)
Creates a field in a tag template.
|
TagTemplateField |
createTagTemplateField(String parent,
String tagTemplateFieldId,
TagTemplateField tagTemplateField)
Creates a field in a tag template.
|
com.google.api.gax.rpc.UnaryCallable<CreateTagTemplateFieldRequest,TagTemplateField> |
createTagTemplateFieldCallable()
Creates a field in a tag template.
|
void |
deleteEntry(DeleteEntryRequest request)
Alpha feature.
|
void |
deleteEntry(String name)
Alpha feature.
|
com.google.api.gax.rpc.UnaryCallable<DeleteEntryRequest,Empty> |
deleteEntryCallable()
Alpha feature.
|
void |
deleteEntryGroup(DeleteEntryGroupRequest request)
Alpha feature.
|
void |
deleteEntryGroup(String name)
Alpha feature.
|
com.google.api.gax.rpc.UnaryCallable<DeleteEntryGroupRequest,Empty> |
deleteEntryGroupCallable()
Alpha feature.
|
void |
deleteTag(DeleteTagRequest request)
Deletes a tag.
|
void |
deleteTag(String name)
Deletes a tag.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTagRequest,Empty> |
deleteTagCallable()
Deletes a tag.
|
void |
deleteTagTemplate(DeleteTagTemplateRequest request)
Deletes a tag template and all tags using the template.
|
void |
deleteTagTemplate(String name,
boolean force)
Deletes a tag template and all tags using the template.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTagTemplateRequest,Empty> |
deleteTagTemplateCallable()
Deletes a tag template and all tags using the template.
|
void |
deleteTagTemplateField(DeleteTagTemplateFieldRequest request)
Deletes a field in a tag template and all uses of that field.
|
void |
deleteTagTemplateField(String name,
boolean force)
Deletes a field in a tag template and all uses of that field.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTagTemplateFieldRequest,Empty> |
deleteTagTemplateFieldCallable()
Deletes a field in a tag template and all uses of that field.
|
static String |
formatEntryGroupName(String project,
String location,
String entryGroup)
Deprecated.
Use the
EntryGroupName class instead. |
static String |
formatEntryName(String project,
String location,
String entryGroup,
String entry)
Deprecated.
Use the
EntryName class instead. |
static String |
formatFieldName(String project,
String location,
String tagTemplate,
String field)
Deprecated.
Use the
FieldName class instead. |
static String |
formatLocationName(String project,
String location)
Deprecated.
Use the
LocationName class instead. |
static String |
formatTagName(String project,
String location,
String entryGroup,
String entry,
String tag)
Deprecated.
Use the
TagName class instead. |
static String |
formatTagTemplateName(String project,
String location,
String tagTemplate)
Deprecated.
Use the
TagTemplateName class instead. |
Entry |
getEntry(GetEntryRequest request)
Gets an entry.
|
Entry |
getEntry(String name)
Gets an entry.
|
com.google.api.gax.rpc.UnaryCallable<GetEntryRequest,Entry> |
getEntryCallable()
Gets an entry.
|
EntryGroup |
getEntryGroup(GetEntryGroupRequest request)
Alpha feature.
|
EntryGroup |
getEntryGroup(String name,
FieldMask readMask)
Alpha feature.
|
com.google.api.gax.rpc.UnaryCallable<GetEntryGroupRequest,EntryGroup> |
getEntryGroupCallable()
Alpha feature.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.iam.v1.Policy |
getIamPolicy(String resource)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
DataCatalogSettings |
getSettings() |
DataCatalogStub |
getStub() |
TagTemplate |
getTagTemplate(GetTagTemplateRequest request)
Gets a tag template.
|
TagTemplate |
getTagTemplate(String name)
Gets a tag template.
|
com.google.api.gax.rpc.UnaryCallable<GetTagTemplateRequest,TagTemplate> |
getTagTemplateCallable()
Gets a tag template.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
DataCatalogClient.ListTagsPagedResponse |
listTags(ListTagsRequest request)
Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
DataCatalogClient.ListTagsPagedResponse |
listTags(String parent)
Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,ListTagsResponse> |
listTagsCallable()
Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,DataCatalogClient.ListTagsPagedResponse> |
listTagsPagedCallable()
Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry].
|
Entry |
lookupEntry(LookupEntryRequest request)
Get an entry by target resource name.
|
com.google.api.gax.rpc.UnaryCallable<LookupEntryRequest,Entry> |
lookupEntryCallable()
Get an entry by target resource name.
|
static String |
parseEntryFromEntryName(String entryName)
Deprecated.
Use the
EntryName class instead. |
static String |
parseEntryFromTagName(String tagName)
Deprecated.
Use the
TagName class instead. |
static String |
parseEntryGroupFromEntryGroupName(String entryGroupName)
Deprecated.
Use the
EntryGroupName class instead. |
static String |
parseEntryGroupFromEntryName(String entryName)
Deprecated.
Use the
EntryName class instead. |
static String |
parseEntryGroupFromTagName(String tagName)
Deprecated.
Use the
TagName class instead. |
static String |
parseFieldFromFieldName(String fieldName)
Deprecated.
Use the
FieldName class instead. |
static String |
parseLocationFromEntryGroupName(String entryGroupName)
Deprecated.
Use the
EntryGroupName class instead. |
static String |
parseLocationFromEntryName(String entryName)
Deprecated.
Use the
EntryName class instead. |
static String |
parseLocationFromFieldName(String fieldName)
Deprecated.
Use the
FieldName class instead. |
static String |
parseLocationFromLocationName(String locationName)
Deprecated.
Use the
LocationName class instead. |
static String |
parseLocationFromTagName(String tagName)
Deprecated.
Use the
TagName class instead. |
static String |
parseLocationFromTagTemplateName(String tagTemplateName)
Deprecated.
Use the
TagTemplateName class instead. |
static String |
parseProjectFromEntryGroupName(String entryGroupName)
Deprecated.
Use the
EntryGroupName class instead. |
static String |
parseProjectFromEntryName(String entryName)
Deprecated.
Use the
EntryName class instead. |
static String |
parseProjectFromFieldName(String fieldName)
Deprecated.
Use the
FieldName class instead. |
static String |
parseProjectFromLocationName(String locationName)
Deprecated.
Use the
LocationName class instead. |
static String |
parseProjectFromTagName(String tagName)
Deprecated.
Use the
TagName class instead. |
static String |
parseProjectFromTagTemplateName(String tagTemplateName)
Deprecated.
Use the
TagTemplateName class instead. |
static String |
parseTagFromTagName(String tagName)
Deprecated.
Use the
TagName class instead. |
static String |
parseTagTemplateFromFieldName(String fieldName)
Deprecated.
Use the
FieldName class instead. |
static String |
parseTagTemplateFromTagTemplateName(String tagTemplateName)
Deprecated.
Use the
TagTemplateName class instead. |
TagTemplateField |
renameTagTemplateField(RenameTagTemplateFieldRequest request)
Renames a field in a tag template.
|
TagTemplateField |
renameTagTemplateField(String name,
String newTagTemplateFieldId)
Renames a field in a tag template.
|
com.google.api.gax.rpc.UnaryCallable<RenameTagTemplateFieldRequest,TagTemplateField> |
renameTagTemplateFieldCallable()
Renames a field in a tag template.
|
DataCatalogClient.SearchCatalogPagedResponse |
searchCatalog(SearchCatalogRequest.Scope scope,
String query,
String orderBy)
Searches Data Catalog for multiple resources like entries, tags that match a query.
|
DataCatalogClient.SearchCatalogPagedResponse |
searchCatalog(SearchCatalogRequest request)
Searches Data Catalog for multiple resources like entries, tags that match a query.
|
com.google.api.gax.rpc.UnaryCallable<SearchCatalogRequest,SearchCatalogResponse> |
searchCatalogCallable()
Searches Data Catalog for multiple resources like entries, tags that match a query.
|
com.google.api.gax.rpc.UnaryCallable<SearchCatalogRequest,DataCatalogClient.SearchCatalogPagedResponse> |
searchCatalogPagedCallable()
Searches Data Catalog for multiple resources like entries, tags that match a query.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy for a resource.
|
com.google.iam.v1.Policy |
setIamPolicy(String resource,
com.google.iam.v1.Policy policy)
Sets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy for a resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(String resource,
List<String> permissions)
Returns the caller's permissions on a resource.
|
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns the caller's permissions on a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns the caller's permissions on a resource.
|
Entry |
updateEntry(Entry entry,
FieldMask updateMask)
Updates an existing entry.
|
Entry |
updateEntry(UpdateEntryRequest request)
Updates an existing entry.
|
com.google.api.gax.rpc.UnaryCallable<UpdateEntryRequest,Entry> |
updateEntryCallable()
Updates an existing entry.
|
Tag |
updateTag(Tag tag,
FieldMask updateMask)
Updates an existing tag.
|
Tag |
updateTag(UpdateTagRequest request)
Updates an existing tag.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTagRequest,Tag> |
updateTagCallable()
Updates an existing tag.
|
TagTemplate |
updateTagTemplate(TagTemplate tagTemplate,
FieldMask updateMask)
Updates a tag template.
|
TagTemplate |
updateTagTemplate(UpdateTagTemplateRequest request)
Updates a tag template.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTagTemplateRequest,TagTemplate> |
updateTagTemplateCallable()
Updates a tag template.
|
TagTemplateField |
updateTagTemplateField(String name,
TagTemplateField tagTemplateField,
FieldMask updateMask)
Updates a field in a tag template.
|
TagTemplateField |
updateTagTemplateField(UpdateTagTemplateFieldRequest request)
Updates a field in a tag template.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTagTemplateFieldRequest,TagTemplateField> |
updateTagTemplateFieldCallable()
Updates a field in a tag template.
|
protected DataCatalogClient(DataCatalogSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected DataCatalogClient(DataCatalogStub stub)
@Deprecated public static final String formatEntryName(String project, String location, String entryGroup, String entry)
EntryName
class instead.@Deprecated public static final String formatEntryGroupName(String project, String location, String entryGroup)
EntryGroupName
class instead.@Deprecated public static final String formatFieldName(String project, String location, String tagTemplate, String field)
FieldName
class instead.@Deprecated public static final String formatLocationName(String project, String location)
LocationName
class instead.@Deprecated public static final String formatTagName(String project, String location, String entryGroup, String entry, String tag)
TagName
class instead.@Deprecated public static final String formatTagTemplateName(String project, String location, String tagTemplate)
TagTemplateName
class instead.@Deprecated public static final String parseProjectFromEntryName(String entryName)
EntryName
class instead.@Deprecated public static final String parseLocationFromEntryName(String entryName)
EntryName
class instead.@Deprecated public static final String parseEntryGroupFromEntryName(String entryName)
EntryName
class instead.@Deprecated public static final String parseEntryFromEntryName(String entryName)
EntryName
class instead.@Deprecated public static final String parseProjectFromEntryGroupName(String entryGroupName)
EntryGroupName
class instead.@Deprecated public static final String parseLocationFromEntryGroupName(String entryGroupName)
EntryGroupName
class instead.@Deprecated public static final String parseEntryGroupFromEntryGroupName(String entryGroupName)
EntryGroupName
class instead.@Deprecated public static final String parseProjectFromFieldName(String fieldName)
FieldName
class instead.@Deprecated public static final String parseLocationFromFieldName(String fieldName)
FieldName
class instead.@Deprecated public static final String parseTagTemplateFromFieldName(String fieldName)
FieldName
class instead.@Deprecated public static final String parseFieldFromFieldName(String fieldName)
FieldName
class instead.@Deprecated public static final String parseProjectFromLocationName(String locationName)
LocationName
class instead.@Deprecated public static final String parseLocationFromLocationName(String locationName)
LocationName
class instead.@Deprecated public static final String parseProjectFromTagName(String tagName)
TagName
class instead.@Deprecated public static final String parseLocationFromTagName(String tagName)
TagName
class instead.@Deprecated public static final String parseEntryGroupFromTagName(String tagName)
TagName
class instead.@Deprecated public static final String parseEntryFromTagName(String tagName)
TagName
class instead.@Deprecated public static final String parseTagFromTagName(String tagName)
TagName
class instead.@Deprecated public static final String parseProjectFromTagTemplateName(String tagTemplateName)
TagTemplateName
class instead.@Deprecated public static final String parseLocationFromTagTemplateName(String tagTemplateName)
TagTemplateName
class instead.@Deprecated public static final String parseTagTemplateFromTagTemplateName(String tagTemplateName)
TagTemplateName
class instead.public static final DataCatalogClient create() throws IOException
IOException
public static final DataCatalogClient create(DataCatalogSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final DataCatalogClient create(DataCatalogStub stub)
public final DataCatalogSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public DataCatalogStub getStub()
public final DataCatalogClient.SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest.Scope scope, String query, String orderBy)
This is a custom method (https://cloud.google.com/apis/design/custom_methods) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call `Get` methods.
Note that searches do not have full recall. There may be results that match your query but are not returned, even in subsequent pages of results. These missing results may vary across repeated calls to search. Do not rely on this method if you need to guarantee full recall.
See [Data Catalog Search Syntax](/data-catalog/docs/how-to/search-reference) for more information.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build();
String query = "";
String orderBy = "";
for (SearchCatalogResult element : dataCatalogClient.searchCatalog(scope, query, orderBy).iterateAll()) {
// doThingsWith(element);
}
}
scope
- Required. The scope of this search request.query
- Required. The query string in search query syntax. The query must be non-empty.
Query strings can be simple as "x" or more qualified as:
* name:x * column:x * description:y
Note: Query tokens need to have a minimum of 3 characters for substring matching to work correctly. See [Data Catalog Search Syntax](/data-catalog/docs/how-to/search-reference) for more information.
orderBy
- Specifies the ordering of results, currently supported case-sensitive choices
are:
* `relevance`, only supports desecending * `last_access_timestamp [asc|desc]`, defaults to descending if not specified * `last_modified_timestamp [asc|desc]`, defaults to descending if not specified
If not specified, defaults to `relevance` descending.
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataCatalogClient.SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest request)
This is a custom method (https://cloud.google.com/apis/design/custom_methods) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call `Get` methods.
Note that searches do not have full recall. There may be results that match your query but are not returned, even in subsequent pages of results. These missing results may vary across repeated calls to search. Do not rely on this method if you need to guarantee full recall.
See [Data Catalog Search Syntax](/data-catalog/docs/how-to/search-reference) for more information.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build();
String query = "";
String orderBy = "";
SearchCatalogRequest request = SearchCatalogRequest.newBuilder()
.setScope(scope)
.setQuery(query)
.setOrderBy(orderBy)
.build();
for (SearchCatalogResult element : dataCatalogClient.searchCatalog(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchCatalogRequest,DataCatalogClient.SearchCatalogPagedResponse> searchCatalogPagedCallable()
This is a custom method (https://cloud.google.com/apis/design/custom_methods) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call `Get` methods.
Note that searches do not have full recall. There may be results that match your query but are not returned, even in subsequent pages of results. These missing results may vary across repeated calls to search. Do not rely on this method if you need to guarantee full recall.
See [Data Catalog Search Syntax](/data-catalog/docs/how-to/search-reference) for more information.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build();
String query = "";
String orderBy = "";
SearchCatalogRequest request = SearchCatalogRequest.newBuilder()
.setScope(scope)
.setQuery(query)
.setOrderBy(orderBy)
.build();
ApiFuture<SearchCatalogPagedResponse> future = dataCatalogClient.searchCatalogPagedCallable().futureCall(request);
// Do something
for (SearchCatalogResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<SearchCatalogRequest,SearchCatalogResponse> searchCatalogCallable()
This is a custom method (https://cloud.google.com/apis/design/custom_methods) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call `Get` methods.
Note that searches do not have full recall. There may be results that match your query but are not returned, even in subsequent pages of results. These missing results may vary across repeated calls to search. Do not rely on this method if you need to guarantee full recall.
See [Data Catalog Search Syntax](/data-catalog/docs/how-to/search-reference) for more information.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build();
String query = "";
String orderBy = "";
SearchCatalogRequest request = SearchCatalogRequest.newBuilder()
.setScope(scope)
.setQuery(query)
.setOrderBy(orderBy)
.build();
while (true) {
SearchCatalogResponse response = dataCatalogClient.searchCatalogCallable().call(request);
for (SearchCatalogResult element : response.getResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final EntryGroup createEntryGroup(String parent, String entryGroupId, EntryGroup entryGroup)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String entryGroupId = "";
EntryGroup entryGroup = EntryGroup.newBuilder().build();
EntryGroup response = dataCatalogClient.createEntryGroup(formattedParent, entryGroupId, entryGroup);
}
parent
- 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.
entryGroupId
- Required. The id of the entry group to create.entryGroup
- Optional. The entry group to create. Defaults to an empty entry group.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntryGroup createEntryGroup(CreateEntryGroupRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String entryGroupId = "";
EntryGroup entryGroup = EntryGroup.newBuilder().build();
CreateEntryGroupRequest request = CreateEntryGroupRequest.newBuilder()
.setParent(formattedParent)
.setEntryGroupId(entryGroupId)
.setEntryGroup(entryGroup)
.build();
EntryGroup response = dataCatalogClient.createEntryGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateEntryGroupRequest,EntryGroup> createEntryGroupCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String entryGroupId = "";
EntryGroup entryGroup = EntryGroup.newBuilder().build();
CreateEntryGroupRequest request = CreateEntryGroupRequest.newBuilder()
.setParent(formattedParent)
.setEntryGroupId(entryGroupId)
.setEntryGroup(entryGroup)
.build();
ApiFuture<EntryGroup> future = dataCatalogClient.createEntryGroupCallable().futureCall(request);
// Do something
EntryGroup response = future.get();
}
public final EntryGroup getEntryGroup(String name, FieldMask readMask)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
FieldMask readMask = FieldMask.newBuilder().build();
EntryGroup response = dataCatalogClient.getEntryGroup(formattedName, readMask);
}
name
- Required. The name of the entry group. For example,
`projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.readMask
- Optional. The fields to return. If not set or empty, all fields are returned.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntryGroup getEntryGroup(GetEntryGroupRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
GetEntryGroupRequest request = GetEntryGroupRequest.newBuilder()
.setName(formattedName)
.build();
EntryGroup response = dataCatalogClient.getEntryGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEntryGroupRequest,EntryGroup> getEntryGroupCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
GetEntryGroupRequest request = GetEntryGroupRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<EntryGroup> future = dataCatalogClient.getEntryGroupCallable().futureCall(request);
// Do something
EntryGroup response = future.get();
}
public final void deleteEntryGroup(String name)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
dataCatalogClient.deleteEntryGroup(formattedName);
}
name
- Required. The name of the entry group. For example,
`projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteEntryGroup(DeleteEntryGroupRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder()
.setName(formattedName)
.build();
dataCatalogClient.deleteEntryGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteEntryGroupRequest,Empty> deleteEntryGroupCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataCatalogClient.deleteEntryGroupCallable().futureCall(request);
// Do something
future.get();
}
public final Entry createEntry(String parent, String entryId, Entry entry)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
String entryId = "";
Entry entry = Entry.newBuilder().build();
Entry response = dataCatalogClient.createEntry(formattedParent, entryId, entry);
}
parent
- 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.
entryId
- Required. The id of the entry to create.entry
- Required. The entry to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Entry createEntry(CreateEntryRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
String entryId = "";
Entry entry = Entry.newBuilder().build();
CreateEntryRequest request = CreateEntryRequest.newBuilder()
.setParent(formattedParent)
.setEntryId(entryId)
.setEntry(entry)
.build();
Entry response = dataCatalogClient.createEntry(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateEntryRequest,Entry> createEntryCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
String entryId = "";
Entry entry = Entry.newBuilder().build();
CreateEntryRequest request = CreateEntryRequest.newBuilder()
.setParent(formattedParent)
.setEntryId(entryId)
.setEntry(entry)
.build();
ApiFuture<Entry> future = dataCatalogClient.createEntryCallable().futureCall(request);
// Do something
Entry response = future.get();
}
public final Entry updateEntry(Entry entry, FieldMask updateMask)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
Entry entry = Entry.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Entry response = dataCatalogClient.updateEntry(entry, updateMask);
}
entry
- Required. The updated entry.updateMask
- Optional. The fields to update on the entry. If absent or empty, all
modifiable fields are updated.
Currently only `schema` field in Cloud Pub/Sub topic entries is modifiable.
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Entry updateEntry(UpdateEntryRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
Entry entry = Entry.newBuilder().build();
UpdateEntryRequest request = UpdateEntryRequest.newBuilder()
.setEntry(entry)
.build();
Entry response = dataCatalogClient.updateEntry(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateEntryRequest,Entry> updateEntryCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
Entry entry = Entry.newBuilder().build();
UpdateEntryRequest request = UpdateEntryRequest.newBuilder()
.setEntry(entry)
.build();
ApiFuture<Entry> future = dataCatalogClient.updateEntryCallable().futureCall(request);
// Do something
Entry response = future.get();
}
public final void deleteEntry(String name)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
dataCatalogClient.deleteEntry(formattedName);
}
name
- Required. The name of the entry. Example:
* projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteEntry(DeleteEntryRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
DeleteEntryRequest request = DeleteEntryRequest.newBuilder()
.setName(formattedName)
.build();
dataCatalogClient.deleteEntry(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteEntryRequest,Empty> deleteEntryCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
DeleteEntryRequest request = DeleteEntryRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataCatalogClient.deleteEntryCallable().futureCall(request);
// Do something
future.get();
}
public final Entry getEntry(String name)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
Entry response = dataCatalogClient.getEntry(formattedName);
}
name
- Required. The name of the entry. Example:
* projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
Entry groups are logical groupings of entries. Currently, users cannot create/modify entry groups. They are created by Data Catalog; they include `@bigquery` for all BigQuery entries, and `@pubsub` for all Cloud Pub/Sub entries.
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Entry getEntry(GetEntryRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
GetEntryRequest request = GetEntryRequest.newBuilder()
.setName(formattedName)
.build();
Entry response = dataCatalogClient.getEntry(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEntryRequest,Entry> getEntryCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
GetEntryRequest request = GetEntryRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Entry> future = dataCatalogClient.getEntryCallable().futureCall(request);
// Do something
Entry response = future.get();
}
public final Entry lookupEntry(LookupEntryRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
LookupEntryRequest request = LookupEntryRequest.newBuilder().build();
Entry response = dataCatalogClient.lookupEntry(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<LookupEntryRequest,Entry> lookupEntryCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
LookupEntryRequest request = LookupEntryRequest.newBuilder().build();
ApiFuture<Entry> future = dataCatalogClient.lookupEntryCallable().futureCall(request);
// Do something
Entry response = future.get();
}
public final TagTemplate createTagTemplate(String parent, String tagTemplateId, TagTemplate tagTemplate)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String tagTemplateId = "";
TagTemplate tagTemplate = TagTemplate.newBuilder().build();
TagTemplate response = dataCatalogClient.createTagTemplate(formattedParent, tagTemplateId, tagTemplate);
}
parent
- Required. The name of the project and the location this template is in. Example:
* projects/{project_id}/locations/{location}
TagTemplate and its child resources may not actually be stored in the location in this name.
tagTemplateId
- Required. The id of the tag template to create.tagTemplate
- Required. The tag template to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TagTemplate createTagTemplate(CreateTagTemplateRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String tagTemplateId = "";
TagTemplate tagTemplate = TagTemplate.newBuilder().build();
CreateTagTemplateRequest request = CreateTagTemplateRequest.newBuilder()
.setParent(formattedParent)
.setTagTemplateId(tagTemplateId)
.setTagTemplate(tagTemplate)
.build();
TagTemplate response = dataCatalogClient.createTagTemplate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateTagTemplateRequest,TagTemplate> createTagTemplateCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
String tagTemplateId = "";
TagTemplate tagTemplate = TagTemplate.newBuilder().build();
CreateTagTemplateRequest request = CreateTagTemplateRequest.newBuilder()
.setParent(formattedParent)
.setTagTemplateId(tagTemplateId)
.setTagTemplate(tagTemplate)
.build();
ApiFuture<TagTemplate> future = dataCatalogClient.createTagTemplateCallable().futureCall(request);
// Do something
TagTemplate response = future.get();
}
public final TagTemplate getTagTemplate(String name)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
TagTemplate response = dataCatalogClient.getTagTemplate(formattedName);
}
name
- Required. The name of the tag template. Example:
* projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TagTemplate getTagTemplate(GetTagTemplateRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
GetTagTemplateRequest request = GetTagTemplateRequest.newBuilder()
.setName(formattedName)
.build();
TagTemplate response = dataCatalogClient.getTagTemplate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTagTemplateRequest,TagTemplate> getTagTemplateCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
GetTagTemplateRequest request = GetTagTemplateRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<TagTemplate> future = dataCatalogClient.getTagTemplateCallable().futureCall(request);
// Do something
TagTemplate response = future.get();
}
public final TagTemplate updateTagTemplate(TagTemplate tagTemplate, FieldMask updateMask)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
TagTemplate tagTemplate = TagTemplate.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate, updateMask);
}
tagTemplate
- Required. The template to update.updateMask
- Optional. The field mask specifies the parts of the template to overwrite.
Allowed fields:
* `display_name`
If absent or empty, all of the allowed fields above will be updated.
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TagTemplate updateTagTemplate(UpdateTagTemplateRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
TagTemplate tagTemplate = TagTemplate.newBuilder().build();
UpdateTagTemplateRequest request = UpdateTagTemplateRequest.newBuilder()
.setTagTemplate(tagTemplate)
.build();
TagTemplate response = dataCatalogClient.updateTagTemplate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateTagTemplateRequest,TagTemplate> updateTagTemplateCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
TagTemplate tagTemplate = TagTemplate.newBuilder().build();
UpdateTagTemplateRequest request = UpdateTagTemplateRequest.newBuilder()
.setTagTemplate(tagTemplate)
.build();
ApiFuture<TagTemplate> future = dataCatalogClient.updateTagTemplateCallable().futureCall(request);
// Do something
TagTemplate response = future.get();
}
public final void deleteTagTemplate(String name, boolean force)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
boolean force = false;
dataCatalogClient.deleteTagTemplate(formattedName, force);
}
name
- Required. The name of the tag template to delete. Example:
* projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
force
- 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteTagTemplate(DeleteTagTemplateRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
boolean force = false;
DeleteTagTemplateRequest request = DeleteTagTemplateRequest.newBuilder()
.setName(formattedName)
.setForce(force)
.build();
dataCatalogClient.deleteTagTemplate(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteTagTemplateRequest,Empty> deleteTagTemplateCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
boolean force = false;
DeleteTagTemplateRequest request = DeleteTagTemplateRequest.newBuilder()
.setName(formattedName)
.setForce(force)
.build();
ApiFuture<Void> future = dataCatalogClient.deleteTagTemplateCallable().futureCall(request);
// Do something
future.get();
}
public final TagTemplateField createTagTemplateField(String parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
String tagTemplateFieldId = "";
TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
TagTemplateField response = dataCatalogClient.createTagTemplateField(formattedParent, tagTemplateFieldId, tagTemplateField);
}
parent
- Required. The name of the project this template is in. Example:
* projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
Note that this TagTemplateField may not actually be stored in the location in this name.
tagTemplateFieldId
- 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.tagTemplateField
- Required. The tag template field to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TagTemplateField createTagTemplateField(CreateTagTemplateFieldRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
String tagTemplateFieldId = "";
TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
CreateTagTemplateFieldRequest request = CreateTagTemplateFieldRequest.newBuilder()
.setParent(formattedParent)
.setTagTemplateFieldId(tagTemplateFieldId)
.setTagTemplateField(tagTemplateField)
.build();
TagTemplateField response = dataCatalogClient.createTagTemplateField(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateTagTemplateFieldRequest,TagTemplateField> createTagTemplateFieldCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
String tagTemplateFieldId = "";
TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
CreateTagTemplateFieldRequest request = CreateTagTemplateFieldRequest.newBuilder()
.setParent(formattedParent)
.setTagTemplateFieldId(tagTemplateFieldId)
.setTagTemplateField(tagTemplateField)
.build();
ApiFuture<TagTemplateField> future = dataCatalogClient.createTagTemplateFieldCallable().futureCall(request);
// Do something
TagTemplateField response = future.get();
}
public final TagTemplateField updateTagTemplateField(String name, TagTemplateField tagTemplateField, FieldMask updateMask)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TagTemplateField response = dataCatalogClient.updateTagTemplateField(formattedName, tagTemplateField, updateMask);
}
name
- Required. The name of the tag template field. Example:
* projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
tagTemplateField
- Required. The template to update.updateMask
- Optional. The field mask specifies the parts of the template to be updated.
Allowed fields:
* `display_name` * `type.enum_type`
If `update_mask` is not set or empty, all of the allowed fields above will be updated.
When updating an enum type, the provided values will be merged with the existing values. Therefore, enum values can only be added, existing enum values cannot be deleted nor renamed.
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
UpdateTagTemplateFieldRequest request = UpdateTagTemplateFieldRequest.newBuilder()
.setName(formattedName)
.setTagTemplateField(tagTemplateField)
.build();
TagTemplateField response = dataCatalogClient.updateTagTemplateField(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateTagTemplateFieldRequest,TagTemplateField> updateTagTemplateFieldCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
UpdateTagTemplateFieldRequest request = UpdateTagTemplateFieldRequest.newBuilder()
.setName(formattedName)
.setTagTemplateField(tagTemplateField)
.build();
ApiFuture<TagTemplateField> future = dataCatalogClient.updateTagTemplateFieldCallable().futureCall(request);
// Do something
TagTemplateField response = future.get();
}
public final TagTemplateField renameTagTemplateField(String name, String newTagTemplateFieldId)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
String newTagTemplateFieldId = "";
TagTemplateField response = dataCatalogClient.renameTagTemplateField(formattedName, newTagTemplateFieldId);
}
name
- Required. The name of the tag template. Example:
* projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
newTagTemplateFieldId
- Required. The new ID of this tag template field. For example,
`my_new_field`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TagTemplateField renameTagTemplateField(RenameTagTemplateFieldRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
String newTagTemplateFieldId = "";
RenameTagTemplateFieldRequest request = RenameTagTemplateFieldRequest.newBuilder()
.setName(formattedName)
.setNewTagTemplateFieldId(newTagTemplateFieldId)
.build();
TagTemplateField response = dataCatalogClient.renameTagTemplateField(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RenameTagTemplateFieldRequest,TagTemplateField> renameTagTemplateFieldCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
String newTagTemplateFieldId = "";
RenameTagTemplateFieldRequest request = RenameTagTemplateFieldRequest.newBuilder()
.setName(formattedName)
.setNewTagTemplateFieldId(newTagTemplateFieldId)
.build();
ApiFuture<TagTemplateField> future = dataCatalogClient.renameTagTemplateFieldCallable().futureCall(request);
// Do something
TagTemplateField response = future.get();
}
public final void deleteTagTemplateField(String name, boolean force)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
boolean force = false;
dataCatalogClient.deleteTagTemplateField(formattedName, force);
}
name
- 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}
force
- 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
boolean force = false;
DeleteTagTemplateFieldRequest request = DeleteTagTemplateFieldRequest.newBuilder()
.setName(formattedName)
.setForce(force)
.build();
dataCatalogClient.deleteTagTemplateField(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteTagTemplateFieldRequest,Empty> deleteTagTemplateFieldCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
boolean force = false;
DeleteTagTemplateFieldRequest request = DeleteTagTemplateFieldRequest.newBuilder()
.setName(formattedName)
.setForce(force)
.build();
ApiFuture<Void> future = dataCatalogClient.deleteTagTemplateFieldCallable().futureCall(request);
// Do something
future.get();
}
public final Tag createTag(String parent, Tag tag)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
Tag tag = Tag.newBuilder().build();
Tag response = dataCatalogClient.createTag(formattedParent, tag);
}
parent
- 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.
tag
- Required. The tag to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Tag createTag(CreateTagRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
Tag tag = Tag.newBuilder().build();
CreateTagRequest request = CreateTagRequest.newBuilder()
.setParent(formattedParent)
.setTag(tag)
.build();
Tag response = dataCatalogClient.createTag(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateTagRequest,Tag> createTagCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
Tag tag = Tag.newBuilder().build();
CreateTagRequest request = CreateTagRequest.newBuilder()
.setParent(formattedParent)
.setTag(tag)
.build();
ApiFuture<Tag> future = dataCatalogClient.createTagCallable().futureCall(request);
// Do something
Tag response = future.get();
}
public final Tag updateTag(Tag tag, FieldMask updateMask)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
Tag tag = Tag.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Tag response = dataCatalogClient.updateTag(tag, updateMask);
}
tag
- Required. The updated tag.updateMask
- Optional. The fields to update on the Tag. If absent or empty, all modifiable
fields are updated. Currently the only modifiable field is the field `fields`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Tag updateTag(UpdateTagRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
Tag tag = Tag.newBuilder().build();
UpdateTagRequest request = UpdateTagRequest.newBuilder()
.setTag(tag)
.build();
Tag response = dataCatalogClient.updateTag(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateTagRequest,Tag> updateTagCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
Tag tag = Tag.newBuilder().build();
UpdateTagRequest request = UpdateTagRequest.newBuilder()
.setTag(tag)
.build();
ApiFuture<Tag> future = dataCatalogClient.updateTagCallable().futureCall(request);
// Do something
Tag response = future.get();
}
public final void deleteTag(String name)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
dataCatalogClient.deleteTag(formattedName);
}
name
- Required. The name of the tag to delete. Example:
* projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteTag(DeleteTagRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
DeleteTagRequest request = DeleteTagRequest.newBuilder()
.setName(formattedName)
.build();
dataCatalogClient.deleteTag(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteTagRequest,Empty> deleteTagCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedName = DataCatalogClient.formatTagName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
DeleteTagRequest request = DeleteTagRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataCatalogClient.deleteTagCallable().futureCall(request);
// Do something
future.get();
}
public final DataCatalogClient.ListTagsPagedResponse listTags(String parent)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
for (Tag element : dataCatalogClient.listTags(formattedParent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The name of the Data Catalog resource to list the tags of. The resource
could be an [Entry][google.cloud.datacatalog.v1beta1.Entry].com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataCatalogClient.ListTagsPagedResponse listTags(ListTagsRequest request)
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
ListTagsRequest request = ListTagsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Tag element : dataCatalogClient.listTags(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,DataCatalogClient.ListTagsPagedResponse> listTagsPagedCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
ListTagsRequest request = ListTagsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListTagsPagedResponse> future = dataCatalogClient.listTagsPagedCallable().futureCall(request);
// Do something
for (Tag element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,ListTagsResponse> listTagsCallable()
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
ListTagsRequest request = ListTagsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListTagsResponse response = dataCatalogClient.listTagsCallable().call(request);
for (Tag element : response.getTagsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.iam.v1.Policy setIamPolicy(String resource, com.google.iam.v1.Policy policy)
Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
Policy policy = Policy.newBuilder().build();
Policy response = dataCatalogClient.setIamPolicy(formattedResource, policy);
}
resource
- REQUIRED: The resource for which the policy is being specified. See the
operation documentation for the appropriate value for this field.policy
- REQUIRED: The complete policy to be applied to the `resource`. The size of the
policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
Platform services (such as Projects) might reject them.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
Policy policy = Policy.newBuilder().build();
SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
.setResource(formattedResource)
.setPolicy(policy)
.build();
Policy response = dataCatalogClient.setIamPolicy(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
Policy policy = Policy.newBuilder().build();
SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
.setResource(formattedResource)
.setPolicy(policy)
.build();
ApiFuture<Policy> future = dataCatalogClient.setIamPolicyCallable().futureCall(request);
// Do something
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(String resource)
Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.
Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
Policy response = dataCatalogClient.getIamPolicy(formattedResource);
}
resource
- REQUIRED: The resource for which the policy is being requested. See the
operation documentation for the appropriate value for this field.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.
Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
.setResource(formattedResource)
.build();
Policy response = dataCatalogClient.getIamPolicy(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.
Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
.setResource(formattedResource)
.build();
ApiFuture<Policy> future = dataCatalogClient.getIamPolicyCallable().futureCall(request);
// Do something
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions)
Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.
A caller is not required to have Google IAM permission to make this request.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
List<String> permissions = new ArrayList<>();
TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(formattedResource, permissions);
}
resource
- REQUIRED: The resource for which the policy detail is being requested. See the
operation documentation for the appropriate value for this field.permissions
- The set of permissions to check for the `resource`. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more information see
[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.
A caller is not required to have Google IAM permission to make this request.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
List<String> permissions = new ArrayList<>();
TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
.setResource(formattedResource)
.addAllPermissions(permissions)
.build();
TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.
A caller is not required to have Google IAM permission to make this request.
Sample code:
try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
List<String> permissions = new ArrayList<>();
TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
.setResource(formattedResource)
.addAllPermissions(permissions)
.build();
ApiFuture<TestIamPermissionsResponse> future = dataCatalogClient.testIamPermissionsCallable().futureCall(request);
// Do something
TestIamPermissionsResponse response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.