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()) {
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy policy = Policy.newBuilder().build();
+ * Policy response = dataCatalogClient.setIamPolicy(resource, policy);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param 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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .setPolicy(policy)
+ .build();
+ return setIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Sets the access control policy for a resource. Replaces any existing policy. Supported
+ * resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to
+ * manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced
+ * to Data Catalog.
+ *
+ * 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()) {
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy policy = Policy.newBuilder().build();
+ * Policy response = dataCatalogClient.setIamPolicy(resource.toString(), policy);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param 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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(String resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build();
+ return setIamPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Sets the access control policy for a resource. Replaces any existing policy. Supported
@@ -3171,6 +3243,73 @@ public final UnaryCallableSupported resources are: - Tag templates. - Entries. - Entry groups. Note, this method + * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform + * resources synced to 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()) {
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy response = dataCatalogClient.getIamPolicy(resource);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(ResourceName resource) {
+ GetIamPolicyRequest request =
+ GetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .build();
+ return getIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
+ * does not exist. An empty policy is returned if the resource exists but does not have a policy
+ * set on it.
+ *
+ * Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method + * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform + * resources synced to 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()) {
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy response = dataCatalogClient.getIamPolicy(resource.toString());
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(String resource) {
+ GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return getIamPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
diff --git a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/DataCatalogClient.java b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/DataCatalogClient.java
index 8f382f66..5a6a1fcc 100644
--- a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/DataCatalogClient.java
+++ b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/DataCatalogClient.java
@@ -25,7 +25,7 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
import com.google.cloud.datacatalog.v1beta1.stub.DataCatalogStub;
import com.google.cloud.datacatalog.v1beta1.stub.DataCatalogStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -52,10 +52,8 @@
*
*
* 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);
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * dataCatalogClient.deleteEntryGroup(name);
* }
*
*
@@ -116,330 +114,6 @@ public class DataCatalogClient implements BackgroundResource {
private final DataCatalogSettings settings;
private final DataCatalogStub stub;
- private static final PathTemplate ENTRY_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}");
-
- private static final PathTemplate ENTRY_GROUP_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/entryGroups/{entry_group}");
-
- private static final PathTemplate FIELD_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}");
-
- private static final PathTemplate LOCATION_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}");
-
- private static final PathTemplate TAG_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}");
-
- private static final PathTemplate TAG_TEMPLATE_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/tagTemplates/{tag_template}");
-
- /**
- * Formats a string containing the fully-qualified path to represent a entry resource.
- *
- * @deprecated Use the {@link EntryName} class instead.
- */
- @Deprecated
- public static final String formatEntryName(
- String project, String location, String entryGroup, String entry) {
- return ENTRY_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "entry_group", entryGroup,
- "entry", entry);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a entry_group resource.
- *
- * @deprecated Use the {@link EntryGroupName} class instead.
- */
- @Deprecated
- public static final String formatEntryGroupName(
- String project, String location, String entryGroup) {
- return ENTRY_GROUP_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "entry_group", entryGroup);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a field resource.
- *
- * @deprecated Use the {@link FieldName} class instead.
- */
- @Deprecated
- public static final String formatFieldName(
- String project, String location, String tagTemplate, String field) {
- return FIELD_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "tag_template", tagTemplate,
- "field", field);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String formatLocationName(String project, String location) {
- return LOCATION_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a tag resource.
- *
- * @deprecated Use the {@link TagName} class instead.
- */
- @Deprecated
- public static final String formatTagName(
- String project, String location, String entryGroup, String entry, String tag) {
- return TAG_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "entry_group", entryGroup,
- "entry", entry,
- "tag", tag);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a tag_template resource.
- *
- * @deprecated Use the {@link TagTemplateName} class instead.
- */
- @Deprecated
- public static final String formatTagTemplateName(
- String project, String location, String tagTemplate) {
- return TAG_TEMPLATE_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "tag_template", tagTemplate);
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a entry resource.
- *
- * @deprecated Use the {@link EntryName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromEntryName(String entryName) {
- return ENTRY_PATH_TEMPLATE.parse(entryName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a entry resource.
- *
- * @deprecated Use the {@link EntryName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromEntryName(String entryName) {
- return ENTRY_PATH_TEMPLATE.parse(entryName).get("location");
- }
-
- /**
- * Parses the entry_group from the given fully-qualified path which represents a entry resource.
- *
- * @deprecated Use the {@link EntryName} class instead.
- */
- @Deprecated
- public static final String parseEntryGroupFromEntryName(String entryName) {
- return ENTRY_PATH_TEMPLATE.parse(entryName).get("entry_group");
- }
-
- /**
- * Parses the entry from the given fully-qualified path which represents a entry resource.
- *
- * @deprecated Use the {@link EntryName} class instead.
- */
- @Deprecated
- public static final String parseEntryFromEntryName(String entryName) {
- return ENTRY_PATH_TEMPLATE.parse(entryName).get("entry");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a entry_group resource.
- *
- * @deprecated Use the {@link EntryGroupName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromEntryGroupName(String entryGroupName) {
- return ENTRY_GROUP_PATH_TEMPLATE.parse(entryGroupName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a entry_group
- * resource.
- *
- * @deprecated Use the {@link EntryGroupName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromEntryGroupName(String entryGroupName) {
- return ENTRY_GROUP_PATH_TEMPLATE.parse(entryGroupName).get("location");
- }
-
- /**
- * Parses the entry_group from the given fully-qualified path which represents a entry_group
- * resource.
- *
- * @deprecated Use the {@link EntryGroupName} class instead.
- */
- @Deprecated
- public static final String parseEntryGroupFromEntryGroupName(String entryGroupName) {
- return ENTRY_GROUP_PATH_TEMPLATE.parse(entryGroupName).get("entry_group");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a field resource.
- *
- * @deprecated Use the {@link FieldName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromFieldName(String fieldName) {
- return FIELD_PATH_TEMPLATE.parse(fieldName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a field resource.
- *
- * @deprecated Use the {@link FieldName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromFieldName(String fieldName) {
- return FIELD_PATH_TEMPLATE.parse(fieldName).get("location");
- }
-
- /**
- * Parses the tag_template from the given fully-qualified path which represents a field resource.
- *
- * @deprecated Use the {@link FieldName} class instead.
- */
- @Deprecated
- public static final String parseTagTemplateFromFieldName(String fieldName) {
- return FIELD_PATH_TEMPLATE.parse(fieldName).get("tag_template");
- }
-
- /**
- * Parses the field from the given fully-qualified path which represents a field resource.
- *
- * @deprecated Use the {@link FieldName} class instead.
- */
- @Deprecated
- public static final String parseFieldFromFieldName(String fieldName) {
- return FIELD_PATH_TEMPLATE.parse(fieldName).get("field");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromLocationName(String locationName) {
- return LOCATION_PATH_TEMPLATE.parse(locationName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromLocationName(String locationName) {
- return LOCATION_PATH_TEMPLATE.parse(locationName).get("location");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a tag resource.
- *
- * @deprecated Use the {@link TagName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromTagName(String tagName) {
- return TAG_PATH_TEMPLATE.parse(tagName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a tag resource.
- *
- * @deprecated Use the {@link TagName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromTagName(String tagName) {
- return TAG_PATH_TEMPLATE.parse(tagName).get("location");
- }
-
- /**
- * Parses the entry_group from the given fully-qualified path which represents a tag resource.
- *
- * @deprecated Use the {@link TagName} class instead.
- */
- @Deprecated
- public static final String parseEntryGroupFromTagName(String tagName) {
- return TAG_PATH_TEMPLATE.parse(tagName).get("entry_group");
- }
-
- /**
- * Parses the entry from the given fully-qualified path which represents a tag resource.
- *
- * @deprecated Use the {@link TagName} class instead.
- */
- @Deprecated
- public static final String parseEntryFromTagName(String tagName) {
- return TAG_PATH_TEMPLATE.parse(tagName).get("entry");
- }
-
- /**
- * Parses the tag from the given fully-qualified path which represents a tag resource.
- *
- * @deprecated Use the {@link TagName} class instead.
- */
- @Deprecated
- public static final String parseTagFromTagName(String tagName) {
- return TAG_PATH_TEMPLATE.parse(tagName).get("tag");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a tag_template
- * resource.
- *
- * @deprecated Use the {@link TagTemplateName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromTagTemplateName(String tagTemplateName) {
- return TAG_TEMPLATE_PATH_TEMPLATE.parse(tagTemplateName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a tag_template
- * resource.
- *
- * @deprecated Use the {@link TagTemplateName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromTagTemplateName(String tagTemplateName) {
- return TAG_TEMPLATE_PATH_TEMPLATE.parse(tagTemplateName).get("location");
- }
-
- /**
- * Parses the tag_template from the given fully-qualified path which represents a tag_template
- * resource.
- *
- * @deprecated Use the {@link TagTemplateName} class instead.
- */
- @Deprecated
- public static final String parseTagTemplateFromTagTemplateName(String tagTemplateName) {
- return TAG_TEMPLATE_PATH_TEMPLATE.parse(tagTemplateName).get("tag_template");
- }
-
/** Constructs an instance of DataCatalogClient with default settings. */
public static final DataCatalogClient create() throws IOException {
return create(DataCatalogSettings.newBuilder().build());
@@ -509,8 +183,7 @@ public DataCatalogStub getStub() {
* 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()) {
+ * for (SearchCatalogResult element : dataCatalogClient.searchCatalog(scope, query).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -526,21 +199,12 @@ public DataCatalogStub getStub() {
* correctly. See [Data Catalog Search
* Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more
* information.
- * @param orderBy Specifies the ordering of results, currently supported case-sensitive choices
- * are:
- * * `relevance`, only supports descending * `last_modified_timestamp [asc|desc]`, - * defaults to descending if not specified - *
If not specified, defaults to `relevance` descending.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchCatalogPagedResponse searchCatalog(
- SearchCatalogRequest.Scope scope, String query, String orderBy) {
+ SearchCatalogRequest.Scope scope, String query) {
SearchCatalogRequest request =
- SearchCatalogRequest.newBuilder()
- .setScope(scope)
- .setQuery(query)
- .setOrderBy(orderBy)
- .build();
+ SearchCatalogRequest.newBuilder().setScope(scope).setQuery(query).build();
return searchCatalog(request);
}
@@ -669,700 +333,1570 @@ public final UnaryCallable Users should enable the Data Catalog API in the project identified by the `parent` parameter
- * (see [Data Catalog Resource Project]
+ * 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]
* (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
* Sample code:
*
* * projects/{project_id}/locations/{location}
- * Note that this EntryGroup and its child resources may not actually be stored in the
- * location in this name.
- * @param entryGroupId 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.
- * @param entryGroup The entry group to create. Defaults to an empty entry group.
+ * @param name Required. The name of the entry group. For example,
+ * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup createEntryGroup(
- String parent, String entryGroupId, EntryGroup entryGroup) {
- LOCATION_PATH_TEMPLATE.validate(parent, "createEntryGroup");
- CreateEntryGroupRequest request =
- CreateEntryGroupRequest.newBuilder()
- .setParent(parent)
- .setEntryGroupId(entryGroupId)
- .setEntryGroup(entryGroup)
- .build();
- return createEntryGroup(request);
+ public final void deleteEntryGroup(EntryGroupName name) {
+ DeleteEntryGroupRequest request =
+ DeleteEntryGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteEntryGroup(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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]
+ * 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]
* (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
* Sample code:
*
* Users should enable the Data Catalog API in the project identified by the `parent` parameter
- * (see [Data Catalog Resource Project]
+ * 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]
* (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
* Sample code:
*
* Sample code:
*
* Sample code:
*
* *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup getEntryGroup(GetEntryGroupRequest request) {
- return getEntryGroupCallable().call(request);
+ public final void deleteEntry(EntryName name) {
+ DeleteEntryRequest request =
+ DeleteEntryRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteEntry(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets an EntryGroup.
+ * Deletes an existing entry. Only entries created through
+ * [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.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]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
* Sample code:
*
* *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable Sample code:
*
* Sample code:
*
* Sample code:
*
* *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable Users should enable the Data Catalog API in the project identified by the `parent` parameter
- * (see [Data Catalog Resource Project]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
- *
- * A maximum of 100,000 entries may be created per entry group.
+ * Gets an entry.
*
* Sample code:
*
* * 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.
- * @param entryId Required. The id of the entry to create.
- * @param entry Required. The entry to create.
+ * @param name Required. The name of the entry. Example:
+ * *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry createEntry(String parent, String entryId, Entry entry) {
- ENTRY_GROUP_PATH_TEMPLATE.validate(parent, "createEntry");
- CreateEntryRequest request =
- CreateEntryRequest.newBuilder()
- .setParent(parent)
- .setEntryId(entryId)
- .setEntry(entry)
- .build();
- return createEntry(request);
+ public final Entry getEntry(String name) {
+ GetEntryRequest request = GetEntryRequest.newBuilder().setName(name).build();
+ return getEntry(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
- *
- * A maximum of 100,000 entries may be created per entry group.
+ * Gets an entry.
*
* Sample code:
*
* Users should enable the Data Catalog API in the project identified by the `parent` parameter
- * (see [Data Catalog Resource Project]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
- *
- * A maximum of 100,000 entries may be created per entry group.
+ * Gets an entry.
*
* Sample code:
*
* Sample code:
*
* The following fields are modifiable: * For entries with type `DATA_STREAM`: *
- * `schema` * For entries with type `FILESET` * `schema` * `display_name` *
- * `description` * `gcs_fileset_spec` * `gcs_fileset_spec.file_patterns` * For
- * entries with `user_specified_type` * `schema` * `display_name` * `description`
- * * user_specified_type * user_specified_system * linked_resource *
- * source_system_timestamps
+ * @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry updateEntry(Entry entry, FieldMask updateMask) {
- UpdateEntryRequest request =
- UpdateEntryRequest.newBuilder().setEntry(entry).setUpdateMask(updateMask).build();
- return updateEntry(request);
+ public final Entry lookupEntry(LookupEntryRequest request) {
+ return lookupEntryCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates an existing entry. Users should enable the Data Catalog API in the project identified
- * by the `entry.name` parameter (see [Data Catalog Resource Project]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ * Get an entry by target resource name. This method allows clients to use the resource name from
+ * the source Google Cloud Platform service to get the Data Catalog Entry.
*
* Sample code:
*
* Sample code:
*
* * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
+ * @param 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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable Sample code:
*
* *
- * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
+ * @param name Required. The name of the tag template to delete. Example:
+ * * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteEntry(String name) {
- ENTRY_PATH_TEMPLATE.validate(name, "deleteEntry");
- DeleteEntryRequest request = DeleteEntryRequest.newBuilder().setName(name).build();
- deleteEntry(request);
+ public final void deleteTagTemplate(String name, boolean force) {
+ DeleteTagTemplateRequest request =
+ DeleteTagTemplateRequest.newBuilder().setName(name).setForce(force).build();
+ deleteTagTemplate(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes an existing entry. Only entries created through
- * [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.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]
+ * 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]
* (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
* Sample code:
*
* Sample code:
*
* Sample code:
*
* *
- * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
+ * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry getEntry(String name) {
- ENTRY_PATH_TEMPLATE.validate(name, "getEntry");
- GetEntryRequest request = GetEntryRequest.newBuilder().setName(name).build();
- return getEntry(request);
+ public final void deleteTagTemplateField(TagTemplateFieldName name, boolean force) {
+ DeleteTagTemplateFieldRequest request =
+ DeleteTagTemplateFieldRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setForce(force)
+ .build();
+ deleteTagTemplateField(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets an entry.
+ * 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] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
+ * information).
*
* Sample code:
*
* *
+ * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
+ * @param 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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTagTemplateField(String name, boolean force) {
+ DeleteTagTemplateFieldRequest request =
+ DeleteTagTemplateFieldRequest.newBuilder().setName(name).setForce(force).build();
+ deleteTagTemplateField(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
+ * information).
+ *
+ * Sample code:
+ *
+ * Sample code:
*
* Sample code:
*
* *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTag(EntryName name) {
+ DeleteTagRequest request =
+ DeleteTagRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a tag.
+ *
+ * Sample code:
+ *
+ * *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTag(String name) {
+ DeleteTagRequest request = DeleteTagRequest.newBuilder().setName(name).build();
+ deleteTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a tag.
+ *
+ * Sample code:
+ *
+ * Sample code:
*
* Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
+ * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
+ * resources synced to 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:
*
* * projects/{project_id}/locations/{location}
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListEntryGroupsResponse listEntryGroups(String parent) {
- LOCATION_PATH_TEMPLATE.validate(parent, "listEntryGroups");
- ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder().setParent(parent).build();
- return listEntryGroups(request);
+ public final Policy getIamPolicy(ResourceName resource) {
+ GetIamPolicyRequest request =
+ GetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .build();
+ return getIamPolicy(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists entry groups.
+ * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
+ * does not exist. An empty policy is returned if the resource exists but does not have a policy
+ * set on it.
+ *
+ * Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
+ * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
+ * resources synced to 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:
*
* Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
+ * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
+ * resources synced to 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:
+ *
+ * Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
+ * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
+ * resources synced to 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:
+ *
+ * Users should enable the Data Catalog API in the project identified by the `parent` parameter
+ * (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * * projects/{project_id}/locations/{location}
+ * Note that this EntryGroup and its child resources may not actually be stored in the
+ * location in this name.
+ * @param entryGroupId 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.
+ * @param entryGroup The entry group to create. Defaults to an empty entry group.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup createEntryGroup(
+ LocationName parent, String entryGroupId, EntryGroup entryGroup) {
+ CreateEntryGroupRequest request =
+ CreateEntryGroupRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setEntryGroupId(entryGroupId)
+ .setEntryGroup(entryGroup)
+ .build();
+ return createEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * * projects/{project_id}/locations/{location}
+ * Note that this EntryGroup and its child resources may not actually be stored in the
+ * location in this name.
+ * @param entryGroupId 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.
+ * @param entryGroup The entry group to create. Defaults to an empty entry group.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup createEntryGroup(
+ String parent, String entryGroupId, EntryGroup entryGroup) {
+ CreateEntryGroupRequest request =
+ CreateEntryGroupRequest.newBuilder()
+ .setParent(parent)
+ .setEntryGroupId(entryGroupId)
+ .setEntryGroup(entryGroup)
+ .build();
+ return createEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * Users should enable the Data Catalog API in the project identified by the `parent` parameter
+ * (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * * projects/{project_id}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEntryGroupsPagedResponse listEntryGroups(EntryGroupName parent) {
+ ListEntryGroupsRequest request =
+ ListEntryGroupsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listEntryGroups(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists entry groups.
+ *
+ * Sample code:
+ *
+ * * projects/{project_id}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEntryGroupsPagedResponse listEntryGroups(String parent) {
+ ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder().setParent(parent).build();
+ return listEntryGroups(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists entry groups.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Users should enable the Data Catalog API in the project identified by the `parent` parameter
+ * (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * A maximum of 100,000 entries may be created per entry group.
+ *
+ * Sample code:
+ *
+ * * 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.
+ * @param entryId Required. The id of the entry to create.
+ * @param entry Required. The entry to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Entry createEntry(EntryGroupName parent, String entryId, Entry entry) {
+ CreateEntryRequest request =
+ CreateEntryRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setEntryId(entryId)
+ .setEntry(entry)
+ .build();
+ return createEntry(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * A maximum of 100,000 entries may be created per entry group.
+ *
+ * Sample code:
+ *
+ * * 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.
+ * @param entryId Required. The id of the entry to create.
+ * @param entry Required. The entry to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Entry createEntry(String parent, String entryId, Entry entry) {
+ CreateEntryRequest request =
+ CreateEntryRequest.newBuilder()
+ .setParent(parent)
+ .setEntryId(entryId)
+ .setEntry(entry)
+ .build();
+ return createEntry(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * A maximum of 100,000 entries may be created per entry group.
+ *
+ * Sample code:
+ *
+ * Users should enable the Data Catalog API in the project identified by the `parent` parameter
+ * (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * A maximum of 100,000 entries may be created per entry group.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The following fields are modifiable: * For entries with type `DATA_STREAM`: *
+ * `schema` * For entries with type `FILESET` * `schema` * `display_name` *
+ * `description` * `gcs_fileset_spec` * `gcs_fileset_spec.file_patterns` * For
+ * entries with `user_specified_type` * `schema` * `display_name` * `description`
+ * * user_specified_type * user_specified_system * linked_resource *
+ * source_system_timestamps
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Entry updateEntry(Entry entry, FieldMask updateMask) {
+ UpdateEntryRequest request =
+ UpdateEntryRequest.newBuilder().setEntry(entry).setUpdateMask(updateMask).build();
+ return updateEntry(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an existing entry. Users should enable the Data Catalog API in the project identified
+ * by the `entry.name` parameter (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * Sample code:
*
* * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListEntriesResponse listEntries(String parent) {
- ENTRY_GROUP_PATH_TEMPLATE.validate(parent, "listEntries");
- ListEntriesRequest request = ListEntriesRequest.newBuilder().setParent(parent).build();
+ public final ListEntriesPagedResponse listEntries(EntryGroupName parent) {
+ ListEntriesRequest request =
+ ListEntriesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
return listEntries(request);
}
@@ -1397,19 +1935,21 @@ public final ListEntriesResponse listEntries(String parent) {
*
* * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListEntriesResponse listEntries(ListEntriesRequest request) {
- return listEntriesCallable().call(request);
+ public final ListEntriesPagedResponse listEntries(String parent) {
+ ListEntriesRequest request = ListEntriesRequest.newBuilder().setParent(parent).build();
+ return listEntries(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -1420,121 +1960,114 @@ public final ListEntriesResponse listEntries(ListEntriesRequest request) {
*
* Sample code:
- *
- * Sample code:
*
* Sample code:
*
* Sample code:
*
* Example:
+ * * projects/{project_id}/locations/us-central1
+ * @param tagTemplateId Required. The id of the tag template to create.
+ * @param tagTemplate Required. The tag template to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TagTemplate getTagTemplate(TagTemplateName name) {
+ GetTagTemplateRequest request =
+ GetTagTemplateRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getTagTemplate(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a tag template.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
- *
- * * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
- * @param 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.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteTagTemplate(String name, boolean force) {
- TAG_TEMPLATE_PATH_TEMPLATE.validate(name, "deleteTagTemplate");
- DeleteTagTemplateRequest request =
- DeleteTagTemplateRequest.newBuilder().setName(name).setForce(force).build();
- deleteTagTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ * 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](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
+ * information).
*
* Sample code:
*
* Example:
+ * * projects/{project_id}/locations/us-central1/tagTemplates/{tag_template_id}
+ * @param 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.
+ * @param tagTemplateField Required. The tag template field to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteTagTemplate(DeleteTagTemplateRequest request) {
- deleteTagTemplateCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
- *
- * Sample code:
- *
- * *
+ * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
+ * @param tagTemplateField Required. The template to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TagTemplateField updateTagTemplateField(
+ TagTemplateFieldName name, TagTemplateField tagTemplateField) {
+ UpdateTagTemplateFieldRequest request =
+ UpdateTagTemplateFieldRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setTagTemplateField(tagTemplateField)
+ .build();
+ return updateTagTemplateField(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a field in a tag template. This method cannot be used to update the field type. Users
+ * should enable the Data Catalog API in the project identified by the `name` parameter (see [Data
+ * Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * *
+ * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
+ * @param tagTemplateField Required. The template to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TagTemplateField updateTagTemplateField(
+ String name, TagTemplateField tagTemplateField) {
+ UpdateTagTemplateFieldRequest request =
+ UpdateTagTemplateFieldRequest.newBuilder()
+ .setName(name)
+ .setTagTemplateField(tagTemplateField)
+ .build();
+ return updateTagTemplateField(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a field in a tag template. This method cannot be used to update the field type. Users
+ * should enable the Data Catalog API in the project identified by the `name` parameter (see [Data
+ * Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * *
+ * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
+ * @param tagTemplateField Required. The template to update.
+ * @param updateMask Optional. The field mask specifies the parts of the template to be updated.
+ * Allowed fields:
+ * * `display_name` * `type.enum_type` * `is_required`
+ * 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. Updating a template field from optional to required is NOT allowed.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TagTemplateField updateTagTemplateField(
+ TagTemplateFieldName name, TagTemplateField tagTemplateField, FieldMask updateMask) {
+ UpdateTagTemplateFieldRequest request =
+ UpdateTagTemplateFieldRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setTagTemplateField(tagTemplateField)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateTagTemplateField(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a field in a tag template. This method cannot be used to update the field type. Users
+ * should enable the Data Catalog API in the project identified by the `name` parameter (see [Data
+ * Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ * Sample code:
+ *
+ * *
+ * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
+ * @param newTagTemplateFieldId Required. The new ID of this tag template field. For example,
+ * `my_new_field`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TagTemplateField renameTagTemplateField(
+ TagTemplateFieldName name, String newTagTemplateFieldId) {
+ RenameTagTemplateFieldRequest request =
+ RenameTagTemplateFieldRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setNewTagTemplateFieldId(newTagTemplateFieldId)
+ .build();
+ return renameTagTemplateField(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Renames a field in a tag template. The user should enable the Data Catalog API in the project
+ * identified by the `name` parameter (see [Data Catalog Resource
+ * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
+ * information).
+ *
+ * Sample code:
+ *
+ * Sample code:
*
* *
- * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
- * @param 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.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteTagTemplateField(String name, boolean force) {
- FIELD_PATH_TEMPLATE.validate(name, "deleteTagTemplateField");
- DeleteTagTemplateFieldRequest request =
- DeleteTagTemplateFieldRequest.newBuilder().setName(name).setForce(force).build();
- deleteTagTemplateField(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
- * information).
- *
- * Sample code:
- *
- * Note that this Tag and its child resources may not actually be stored in the location in
+ * this name.
+ * @param tag Required. The tag to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request) {
- deleteTagTemplateFieldCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
- * information).
- *
- * Sample code:
- *
- * Sample code:
- *
- * *
- * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}
+ * @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteTag(String name) {
- TAG_PATH_TEMPLATE.validate(name, "deleteTag");
- DeleteTagRequest request = DeleteTagRequest.newBuilder().setName(name).build();
- deleteTag(request);
+ public final Tag updateTag(UpdateTagRequest request) {
+ return updateTagCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a tag.
+ * Updates an existing tag.
*
* Sample code:
*
* Sample code:
*
* Examples:
+ * * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} *
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
- * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
- * resources synced to 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:
- *
- * Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
- * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
- * resources synced to 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:
- *
- * Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
- * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
- * resources synced to Data Catalog.
+ * Sets the access control policy for a resource. Replaces any existing policy. Supported
+ * resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to
+ * manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced
+ * to 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.
+ * 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:
*
* Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method
- * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform
- * resources synced to Data Catalog.
- *
- * A caller is not required to have Google IAM permission to make this request.
- *
- * Sample code:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- * For example, to set the total timeout of createEntryGroup to 30 seconds:
+ * For example, to set the total timeout of deleteEntryGroup to 30 seconds:
*
* Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ *
*
- * @param parent Required. The name of the project this entry group is in. Example:
- *
* 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);
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * dataCatalogClient.deleteEntryGroup(name);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param name Required. The name of the entry group. For example,
+ * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup createEntryGroup(CreateEntryGroupRequest request) {
- return createEntryGroupCallable().call(request);
+ public final void deleteEntryGroup(String name) {
+ DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder().setName(name).build();
+ deleteEntryGroup(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * A maximum of 10,000 entry groups may be created per organization across all locations.
- *
- *
* 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);
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * dataCatalogClient.deleteEntryGroup(name.toString());
* }
*
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable
* 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)
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<EntryGroup> future = dataCatalogClient.createEntryGroupCallable().futureCall(request);
- * // Do something
- * EntryGroup response = future.get();
+ * dataCatalogClient.deleteEntryGroup(request);
* }
*
- *
- * @param name Required. The name of the entry group. For example,
- * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
- * @param readMask The fields to return. If not set or empty, all fields are returned.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup getEntryGroup(String name, FieldMask readMask) {
- ENTRY_GROUP_PATH_TEMPLATE.validate(name, "getEntryGroup");
- GetEntryGroupRequest request =
- GetEntryGroupRequest.newBuilder().setName(name).setReadMask(readMask).build();
- return getEntryGroup(request);
+ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
- * FieldMask readMask = FieldMask.newBuilder().build();
- * EntryGroup response = dataCatalogClient.getEntryGroup(formattedName, readMask);
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = dataCatalogClient.deleteEntryGroupCallable().futureCall(request);
+ * // Do something
+ * future.get();
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param name Required. The name of the entry. Example:
+ *
* 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);
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * dataCatalogClient.deleteEntry(name);
* }
*
+ *
+ * @param name Required. The name of the entry. Example:
+ *
* 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();
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * dataCatalogClient.deleteEntry(name.toString());
* }
*
*
- * @param name Required. The name of the entry group. For example,
- * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
+ * @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteEntryGroup(String name) {
- ENTRY_GROUP_PATH_TEMPLATE.validate(name, "deleteEntryGroup");
- DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder().setName(name).build();
- deleteEntryGroup(request);
+ public final void deleteEntry(DeleteEntryRequest request) {
+ deleteEntryCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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]
+ * Deletes an existing entry. Only entries created through
+ * [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.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]
* (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
- * dataCatalogClient.deleteEntryGroup(formattedName);
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * DeleteEntryRequest request = DeleteEntryRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * dataCatalogClient.deleteEntry(request);
* }
*
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteEntryGroup(DeleteEntryGroupRequest request) {
- deleteEntryGroupCallable().call(request);
+ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
- * DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder()
- * .setName(formattedName)
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * DeleteEntryRequest request = DeleteEntryRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * dataCatalogClient.deleteEntryGroup(request);
+ * ApiFuture<Void> future = dataCatalogClient.deleteEntryCallable().futureCall(request);
+ * // Do something
+ * future.get();
* }
*
+ *
+ * @param name Required. The name of the entry. Example:
+ *
* 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();
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Entry response = dataCatalogClient.getEntry(name);
* }
*
*
- * @param parent Required. The name of the entry group this entry is in. Example:
- *
* 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);
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Entry response = dataCatalogClient.getEntry(name.toString());
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry createEntry(CreateEntryRequest request) {
- return createEntryCallable().call(request);
+ public final Entry getEntry(GetEntryRequest request) {
+ return getEntryCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.
- *
- *
* 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)
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * GetEntryRequest request = GetEntryRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * Entry response = dataCatalogClient.createEntry(request);
+ * Entry response = dataCatalogClient.getEntry(request);
* }
*
*/
- public final UnaryCallable
* 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)
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * GetEntryRequest request = GetEntryRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<Entry> future = dataCatalogClient.createEntryCallable().futureCall(request);
+ * ApiFuture<Entry> future = dataCatalogClient.getEntryCallable().futureCall(request);
* // Do something
* Entry response = future.get();
* }
*
*
- * @param entry Required. The updated entry. The "name" field must be set.
- * @param updateMask The fields to update on the entry. If absent or empty, all modifiable fields
- * are updated.
- *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * Entry entry = Entry.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Entry response = dataCatalogClient.updateEntry(entry, updateMask);
+ * LookupEntryRequest request = LookupEntryRequest.newBuilder().build();
+ * Entry response = dataCatalogClient.lookupEntry(request);
* }
*
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry updateEntry(UpdateEntryRequest request) {
- return updateEntryCallable().call(request);
+ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * Entry entry = Entry.newBuilder().build();
- * UpdateEntryRequest request = UpdateEntryRequest.newBuilder()
- * .setEntry(entry)
- * .build();
- * Entry response = dataCatalogClient.updateEntry(request);
+ * LookupEntryRequest request = LookupEntryRequest.newBuilder().build();
+ * ApiFuture<Entry> future = dataCatalogClient.lookupEntryCallable().futureCall(request);
+ * // Do something
+ * Entry response = future.get();
* }
*
+ *
+ * @param name Required. The name of the tag template to delete. Example:
+ *
* 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();
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * boolean force = false;
+ * dataCatalogClient.deleteTagTemplate(name, force);
* }
*
*
- * @param name Required. The name of the entry. Example:
- *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * dataCatalogClient.deleteEntry(formattedName);
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * boolean force = false;
+ * dataCatalogClient.deleteTagTemplate(name.toString(), force);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteEntry(DeleteEntryRequest request) {
- deleteEntryCallable().call(request);
+ public final void deleteTagTemplate(DeleteTagTemplateRequest request) {
+ deleteTagTemplateCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes an existing entry. Only entries created through
- * [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.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]
+ * 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]
* (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * DeleteEntryRequest request = DeleteEntryRequest.newBuilder()
- * .setName(formattedName)
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * boolean force = false;
+ * DeleteTagTemplateRequest request = DeleteTagTemplateRequest.newBuilder()
+ * .setName(name.toString())
+ * .setForce(force)
* .build();
- * dataCatalogClient.deleteEntry(request);
+ * dataCatalogClient.deleteTagTemplate(request);
* }
*
*/
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * DeleteEntryRequest request = DeleteEntryRequest.newBuilder()
- * .setName(formattedName)
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * boolean force = false;
+ * DeleteTagTemplateRequest request = DeleteTagTemplateRequest.newBuilder()
+ * .setName(name.toString())
+ * .setForce(force)
* .build();
- * ApiFuture<Void> future = dataCatalogClient.deleteEntryCallable().futureCall(request);
+ * ApiFuture<Void> future = dataCatalogClient.deleteTagTemplateCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*
- * @param name Required. The name of the entry. Example:
+ * @param name Required. The name of the tag template field to delete. Example:
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * Entry response = dataCatalogClient.getEntry(formattedName);
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * boolean force = false;
+ * dataCatalogClient.deleteTagTemplateField(name, force);
* }
*
+ *
+ * @param name Required. The name of the tag template field to delete. Example:
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * GetEntryRequest request = GetEntryRequest.newBuilder()
- * .setName(formattedName)
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * boolean force = false;
+ * dataCatalogClient.deleteTagTemplateField(name.toString(), force);
+ * }
+ *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry getEntry(GetEntryRequest request) {
- return getEntryCallable().call(request);
+ public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request) {
+ deleteTagTemplateFieldCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets an entry.
+ * 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] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
+ * information).
*
*
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * boolean force = false;
+ * DeleteTagTemplateFieldRequest request = DeleteTagTemplateFieldRequest.newBuilder()
+ * .setName(name.toString())
+ * .setForce(force)
* .build();
- * Entry response = dataCatalogClient.getEntry(request);
+ * dataCatalogClient.deleteTagTemplateField(request);
* }
*
*/
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * GetEntryRequest request = GetEntryRequest.newBuilder()
- * .setName(formattedName)
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * boolean force = false;
+ * DeleteTagTemplateFieldRequest request = DeleteTagTemplateFieldRequest.newBuilder()
+ * .setName(name.toString())
+ * .setForce(force)
* .build();
- * ApiFuture<Entry> future = dataCatalogClient.getEntryCallable().futureCall(request);
+ * ApiFuture<Void> future = dataCatalogClient.deleteTagTemplateFieldCallable().futureCall(request);
* // Do something
- * Entry response = future.get();
+ * future.get();
* }
*
+ *
+ * @param name Required. The name of the tag to delete. Example:
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * LookupEntryRequest request = LookupEntryRequest.newBuilder().build();
- * Entry response = dataCatalogClient.lookupEntry(request);
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * dataCatalogClient.deleteTag(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the tag to delete. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * dataCatalogClient.deleteTag(name.toString());
+ * }
+ *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Entry lookupEntry(LookupEntryRequest request) {
- return lookupEntryCallable().call(request);
+ public final void deleteTag(DeleteTagRequest request) {
+ deleteTagCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Get an entry by target resource name. This method allows clients to use the resource name from
- * the source Google Cloud Platform service to get the Data Catalog Entry.
+ * Deletes a tag.
*
*
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * DeleteTagRequest request = DeleteTagRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * dataCatalogClient.deleteTag(request);
* }
*
*/
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * LookupEntryRequest request = LookupEntryRequest.newBuilder().build();
- * ApiFuture<Entry> future = dataCatalogClient.lookupEntryCallable().futureCall(request);
+ * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * DeleteTagRequest request = DeleteTagRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = dataCatalogClient.deleteTagCallable().futureCall(request);
* // Do something
- * Entry response = future.get();
+ * future.get();
* }
*
*
- * @param parent Required. The name of the location that contains the entry groups, which can be
- * provided in URL format. Example:
- *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListEntryGroupsResponse response = dataCatalogClient.listEntryGroups(formattedParent);
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy response = dataCatalogClient.getIamPolicy(resource);
* }
*
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(String resource) {
+ GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return getIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
+ * does not exist. An empty policy is returned if the resource exists but does not have a policy
+ * set on it.
+ *
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder()
- * .setParent(formattedParent)
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy response = dataCatalogClient.getIamPolicy(resource.toString());
+ * }
+ *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListEntryGroupsResponse listEntryGroups(ListEntryGroupsRequest request) {
- return listEntryGroupsCallable().call(request);
+ public final Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists entry groups.
+ * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
+ * does not exist. An empty policy is returned if the resource exists but does not have a policy
+ * set on it.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
* .build();
- * ListEntryGroupsResponse response = dataCatalogClient.listEntryGroups(request);
+ * Policy response = dataCatalogClient.getIamPolicy(request);
* }
*
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .build();
+ * ApiFuture<Policy> future = dataCatalogClient.getIamPolicyCallable().futureCall(request);
+ * // Do something
+ * Policy response = future.get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the project this entry group is in. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String entryGroupId = "";
+ * EntryGroup entryGroup = EntryGroup.newBuilder().build();
+ * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
+ * }
+ *
+ *
+ * @param parent Required. The name of the project this entry group is in. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String entryGroupId = "";
+ * EntryGroup entryGroup = EntryGroup.newBuilder().build();
+ * EntryGroup response = dataCatalogClient.createEntryGroup(parent.toString(), entryGroupId, entryGroup);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup createEntryGroup(CreateEntryGroupRequest request) {
+ return createEntryGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * A maximum of 10,000 entry groups may be created per organization across all locations.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String entryGroupId = "";
+ * CreateEntryGroupRequest request = CreateEntryGroupRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setEntryGroupId(entryGroupId)
+ * .build();
+ * EntryGroup response = dataCatalogClient.createEntryGroup(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String entryGroupId = "";
+ * CreateEntryGroupRequest request = CreateEntryGroupRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setEntryGroupId(entryGroupId)
+ * .build();
+ * ApiFuture<EntryGroup> future = dataCatalogClient.createEntryGroupCallable().futureCall(request);
+ * // Do something
+ * EntryGroup response = future.get();
+ * }
+ *
+ *
+ * @param entryGroup Required. The updated entry group. "name" field must be set.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup updateEntryGroup(EntryGroup entryGroup) {
+ UpdateEntryGroupRequest request =
+ UpdateEntryGroupRequest.newBuilder().setEntryGroup(entryGroup).build();
+ return updateEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an EntryGroup. The user should enable the Data Catalog API in the project identified by
+ * the `entry_group.name` parameter (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroup entryGroup = EntryGroup.newBuilder().build();
+ * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup);
+ * }
+ *
+ *
+ * @param entryGroup Required. The updated entry group. "name" field must be set.
+ * @param updateMask The fields to update on the entry group. If absent or empty, all modifiable
+ * fields are updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup updateEntryGroup(EntryGroup entryGroup, FieldMask updateMask) {
+ UpdateEntryGroupRequest request =
+ UpdateEntryGroupRequest.newBuilder()
+ .setEntryGroup(entryGroup)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an EntryGroup. The user should enable the Data Catalog API in the project identified by
+ * the `entry_group.name` parameter (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroup entryGroup = EntryGroup.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup, updateMask);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup updateEntryGroup(UpdateEntryGroupRequest request) {
+ return updateEntryGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an EntryGroup. The user should enable the Data Catalog API in the project identified by
+ * the `entry_group.name` parameter (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroup entryGroup = EntryGroup.newBuilder().build();
+ * UpdateEntryGroupRequest request = UpdateEntryGroupRequest.newBuilder()
+ * .setEntryGroup(entryGroup)
+ * .build();
+ * EntryGroup response = dataCatalogClient.updateEntryGroup(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroup entryGroup = EntryGroup.newBuilder().build();
+ * UpdateEntryGroupRequest request = UpdateEntryGroupRequest.newBuilder()
+ * .setEntryGroup(entryGroup)
+ * .build();
+ * ApiFuture<EntryGroup> future = dataCatalogClient.updateEntryGroupCallable().futureCall(request);
+ * // Do something
+ * EntryGroup response = future.get();
+ * }
+ *
+ *
+ * @param name Required. The name of the entry group. For example,
+ * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup getEntryGroup(EntryGroupName name) {
+ GetEntryGroupRequest request =
+ GetEntryGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets an EntryGroup.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * EntryGroup response = dataCatalogClient.getEntryGroup(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the entry group. For example,
+ * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup getEntryGroup(String name) {
+ GetEntryGroupRequest request = GetEntryGroupRequest.newBuilder().setName(name).build();
+ return getEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets an EntryGroup.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * EntryGroup response = dataCatalogClient.getEntryGroup(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The name of the entry group. For example,
+ * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
+ * @param readMask The fields to return. If not set or empty, all fields are returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup getEntryGroup(EntryGroupName name, FieldMask readMask) {
+ GetEntryGroupRequest request =
+ GetEntryGroupRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setReadMask(readMask)
+ .build();
+ return getEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets an EntryGroup.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * FieldMask readMask = FieldMask.newBuilder().build();
+ * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask);
+ * }
+ *
+ *
+ * @param name Required. The name of the entry group. For example,
+ * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
+ * @param readMask The fields to return. If not set or empty, all fields are returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup getEntryGroup(String name, FieldMask readMask) {
+ GetEntryGroupRequest request =
+ GetEntryGroupRequest.newBuilder().setName(name).setReadMask(readMask).build();
+ return getEntryGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets an EntryGroup.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * FieldMask readMask = FieldMask.newBuilder().build();
+ * EntryGroup response = dataCatalogClient.getEntryGroup(name.toString(), readMask);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EntryGroup getEntryGroup(GetEntryGroupRequest request) {
+ return getEntryGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets an EntryGroup.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * GetEntryGroupRequest request = GetEntryGroupRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * EntryGroup response = dataCatalogClient.getEntryGroup(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * GetEntryGroupRequest request = GetEntryGroupRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<EntryGroup> future = dataCatalogClient.getEntryGroupCallable().futureCall(request);
+ * // Do something
+ * EntryGroup response = future.get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the location that contains the entry groups, which can be
+ * provided in URL format. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * for (EntryGroup element : dataCatalogClient.listEntryGroups(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The name of the location that contains the entry groups, which can be
+ * provided in URL format. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * for (EntryGroup element : dataCatalogClient.listEntryGroups(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEntryGroupsPagedResponse listEntryGroups(ListEntryGroupsRequest request) {
+ return listEntryGroupsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists entry groups.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (EntryGroup element : dataCatalogClient.listEntryGroups(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListEntryGroupsPagedResponse> future = dataCatalogClient.listEntryGroupsPagedCallable().futureCall(request);
+ * // Do something
+ * for (EntryGroup element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListEntryGroupsResponse response = dataCatalogClient.listEntryGroupsCallable().call(request);
+ * for (EntryGroup element : response.getEntryGroupsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The name of the entry group this entry is in. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * String entryId = "";
+ * Entry entry = Entry.newBuilder().build();
+ * Entry response = dataCatalogClient.createEntry(parent, entryId, entry);
+ * }
+ *
+ *
+ * @param parent Required. The name of the entry group this entry is in. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * String entryId = "";
+ * Entry entry = Entry.newBuilder().build();
+ * Entry response = dataCatalogClient.createEntry(parent.toString(), entryId, entry);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Entry createEntry(CreateEntryRequest request) {
+ return createEntryCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * String entryId = "";
+ * Entry entry = Entry.newBuilder().build();
+ * CreateEntryRequest request = CreateEntryRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setEntryId(entryId)
+ * .setEntry(entry)
+ * .build();
+ * Entry response = dataCatalogClient.createEntry(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * String entryId = "";
+ * Entry entry = Entry.newBuilder().build();
+ * CreateEntryRequest request = CreateEntryRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setEntryId(entryId)
+ * .setEntry(entry)
+ * .build();
+ * ApiFuture<Entry> future = dataCatalogClient.createEntryCallable().futureCall(request);
+ * // Do something
+ * Entry response = future.get();
+ * }
+ *
+ *
+ * @param entry Required. The updated entry. The "name" field must be set.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Entry updateEntry(Entry entry) {
+ UpdateEntryRequest request = UpdateEntryRequest.newBuilder().setEntry(entry).build();
+ return updateEntry(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an existing entry. Users should enable the Data Catalog API in the project identified
+ * by the `entry.name` parameter (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ *
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * Entry entry = Entry.newBuilder().build();
+ * Entry response = dataCatalogClient.updateEntry(entry);
+ * }
+ *
+ *
+ * @param entry Required. The updated entry. The "name" field must be set.
+ * @param updateMask The fields to update on the entry. If absent or empty, all modifiable fields
+ * are updated.
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * Entry entry = Entry.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Entry response = dataCatalogClient.updateEntry(entry, updateMask);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Entry updateEntry(UpdateEntryRequest request) {
+ return updateEntryCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an existing entry. Users should enable the Data Catalog API in the project identified
+ * by the `entry.name` parameter (see [Data Catalog Resource Project]
+ * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
*
*
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * Entry entry = Entry.newBuilder().build();
+ * UpdateEntryRequest request = UpdateEntryRequest.newBuilder()
+ * .setEntry(entry)
+ * .build();
+ * Entry response = dataCatalogClient.updateEntry(request);
+ * }
+ *
*/
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder()
- * .setParent(formattedParent)
+ * Entry entry = Entry.newBuilder().build();
+ * UpdateEntryRequest request = UpdateEntryRequest.newBuilder()
+ * .setEntry(entry)
* .build();
- * ApiFuture<ListEntryGroupsResponse> future = dataCatalogClient.listEntryGroupsCallable().futureCall(request);
+ * ApiFuture<Entry> future = dataCatalogClient.updateEntryCallable().futureCall(request);
* // Do something
- * ListEntryGroupsResponse response = future.get();
+ * Entry response = future.get();
* }
*
*
@@ -1383,9 +1919,11 @@ public final ListEntryGroupsResponse listEntryGroups(ListEntryGroupsRequest requ
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
- * ListEntriesResponse response = dataCatalogClient.listEntries(formattedParent);
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The name of the entry group that contains the entries, which can be
+ * provided in URL format. Example:
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
- * ListEntriesRequest request = ListEntriesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * ListEntriesResponse response = dataCatalogClient.listEntries(request);
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * for (Entry element : dataCatalogClient.listEntries(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
- */
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryGroupName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
* ListEntriesRequest request = ListEntriesRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
- * ApiFuture<ListEntriesResponse> future = dataCatalogClient.listEntriesCallable().futureCall(request);
- * // Do something
- * ListEntriesResponse response = future.get();
- * }
- *
*
- * @param entryGroup Required. The updated entry group. "name" field must be set.
+ * @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup updateEntryGroup(EntryGroup entryGroup) {
- UpdateEntryGroupRequest request =
- UpdateEntryGroupRequest.newBuilder().setEntryGroup(entryGroup).build();
- return updateEntryGroup(request);
+ public final ListEntriesPagedResponse listEntries(ListEntriesRequest request) {
+ return listEntriesPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates an EntryGroup. The user should enable the Data Catalog API in the project identified by
- * the `entry_group.name` parameter (see [Data Catalog Resource Project]
- * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
+ * Lists entries.
*
*
- * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * EntryGroup entryGroup = EntryGroup.newBuilder().build();
- * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup);
+ * for (Entry element : dataCatalogClient.listEntries(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
- *
- * @param entryGroup Required. The updated entry group. "name" field must be set.
- * @param updateMask The fields to update on the entry group. If absent or empty, all modifiable
- * fields are updated.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup updateEntryGroup(EntryGroup entryGroup, FieldMask updateMask) {
- UpdateEntryGroupRequest request =
- UpdateEntryGroupRequest.newBuilder()
- .setEntryGroup(entryGroup)
- .setUpdateMask(updateMask)
- .build();
- return updateEntryGroup(request);
+ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * EntryGroup entryGroup = EntryGroup.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup, updateMask);
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * ListEntriesRequest request = ListEntriesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListEntriesPagedResponse> future = dataCatalogClient.listEntriesPagedCallable().futureCall(request);
+ * // Do something
+ * for (Entry element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntryGroup updateEntryGroup(UpdateEntryGroupRequest request) {
- return updateEntryGroupCallable().call(request);
+ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * EntryGroup entryGroup = EntryGroup.newBuilder().build();
- * UpdateEntryGroupRequest request = UpdateEntryGroupRequest.newBuilder()
- * .setEntryGroup(entryGroup)
+ * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * ListEntriesRequest request = ListEntriesRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * EntryGroup response = dataCatalogClient.updateEntryGroup(request);
+ * while (true) {
+ * ListEntriesResponse response = dataCatalogClient.listEntriesCallable().call(request);
+ * for (Entry element : response.getEntriesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
* }
*
+ *
+ * @param parent Required. The name of the project and the template location
+ * [region](https://cloud.google.com/data-catalog/docs/concepts/regions.
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * EntryGroup entryGroup = EntryGroup.newBuilder().build();
- * UpdateEntryGroupRequest request = UpdateEntryGroupRequest.newBuilder()
- * .setEntryGroup(entryGroup)
- * .build();
- * ApiFuture<EntryGroup> future = dataCatalogClient.updateEntryGroupCallable().futureCall(request);
- * // Do something
- * EntryGroup response = future.get();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String tagTemplateId = "";
+ * TagTemplate tagTemplate = TagTemplate.newBuilder().build();
+ * TagTemplate response = dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate);
* }
*
*
@@ -1565,7 +2098,6 @@ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String tagTemplateId = "";
* TagTemplate tagTemplate = TagTemplate.newBuilder().build();
- * TagTemplate response = dataCatalogClient.createTagTemplate(formattedParent, tagTemplateId, tagTemplate);
+ * TagTemplate response = dataCatalogClient.createTagTemplate(parent.toString(), tagTemplateId, tagTemplate);
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String tagTemplateId = "";
* TagTemplate tagTemplate = TagTemplate.newBuilder().build();
* CreateTagTemplateRequest request = CreateTagTemplateRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setTagTemplateId(tagTemplateId)
* .setTagTemplate(tagTemplate)
* .build();
@@ -1616,11 +2148,11 @@ public final TagTemplate createTagTemplate(CreateTagTemplateRequest request) {
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatLocationName("[PROJECT]", "[LOCATION]");
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String tagTemplateId = "";
* TagTemplate tagTemplate = TagTemplate.newBuilder().build();
* CreateTagTemplateRequest request = CreateTagTemplateRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setTagTemplateId(tagTemplateId)
* .setTagTemplate(tagTemplate)
* .build();
@@ -1642,8 +2174,31 @@ public final UnaryCallable
+ *
+ * @param name Required. The name of the tag template. Example:
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
- * TagTemplate response = dataCatalogClient.getTagTemplate(formattedName);
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplate response = dataCatalogClient.getTagTemplate(name);
+ * }
+ *
*
@@ -1652,7 +2207,6 @@ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplate response = dataCatalogClient.getTagTemplate(name.toString());
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
* GetTagTemplateRequest request = GetTagTemplateRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* TagTemplate response = dataCatalogClient.getTagTemplate(request);
* }
@@ -1688,9 +2242,9 @@ public final TagTemplate getTagTemplate(GetTagTemplateRequest request) {
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
* GetTagTemplateRequest request = GetTagTemplateRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* ApiFuture<TagTemplate> future = dataCatalogClient.getTagTemplateCallable().futureCall(request);
* // Do something
@@ -1702,6 +2256,32 @@ public final UnaryCallable
+ *
+ * @param tagTemplate Required. The template to update. The "name" field must be set.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TagTemplate updateTagTemplate(TagTemplate tagTemplate) {
+ UpdateTagTemplateRequest request =
+ UpdateTagTemplateRequest.newBuilder().setTagTemplate(tagTemplate).build();
+ return updateTagTemplate(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates a tag template. This method cannot be used to update the fields of a template. The tag
@@ -1791,85 +2371,42 @@ public final UnaryCallable
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplate tagTemplate = TagTemplate.newBuilder().build();
+ * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate);
+ * }
+ *
- *
- * @param name Required. The name of the tag template to delete. Example:
- *
- * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
- * boolean force = false;
- * dataCatalogClient.deleteTagTemplate(formattedName, force);
- * }
- *
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The name of the project and the template location
+ * [region](https://cloud.google.com/data-catalog/docs/concepts/regions).
+ *
* 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);
+ * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * String tagTemplateFieldId = "";
+ * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
+ * TagTemplateField response = dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField);
* }
*
- */
- public final UnaryCallable
- * 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();
- * }
- *
*
@@ -1903,7 +2440,6 @@ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
* String tagTemplateFieldId = "";
* TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
- * TagTemplateField response = dataCatalogClient.createTagTemplateField(formattedParent, tagTemplateFieldId, tagTemplateField);
+ * TagTemplateField response = dataCatalogClient.createTagTemplateField(parent.toString(), tagTemplateFieldId, tagTemplateField);
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
* String tagTemplateFieldId = "";
* TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
* CreateTagTemplateFieldRequest request = CreateTagTemplateFieldRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setTagTemplateFieldId(tagTemplateFieldId)
* .setTagTemplateField(tagTemplateField)
* .build();
@@ -1954,11 +2490,11 @@ public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldReque
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
* String tagTemplateFieldId = "";
* TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
* CreateTagTemplateFieldRequest request = CreateTagTemplateFieldRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setTagTemplateFieldId(tagTemplateFieldId)
* .setTagTemplateField(tagTemplateField)
* .build();
@@ -1984,10 +2520,118 @@ public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldReque
*
*
+ *
+ * @param name Required. The name of the tag template field. Example:
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
+ * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name, tagTemplateField);
+ * }
+ *
+ *
+ * @param name Required. The name of the tag template field. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
+ * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name.toString(), tagTemplateField);
+ * }
+ *
+ *
+ * @param name Required. The name of the tag template field. Example:
+ *
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name, tagTemplateField, updateMask);
+ * }
+ *
*
@@ -2006,7 +2650,6 @@ public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldReque
*/
public final TagTemplateField updateTagTemplateField(
String name, TagTemplateField tagTemplateField, FieldMask updateMask) {
- FIELD_PATH_TEMPLATE.validate(name, "updateTagTemplateField");
UpdateTagTemplateFieldRequest request =
UpdateTagTemplateFieldRequest.newBuilder()
.setName(name)
@@ -2027,10 +2670,10 @@ public final TagTemplateField updateTagTemplateField(
*
*
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
* TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
- * TagTemplateField response = dataCatalogClient.updateTagTemplateField(formattedName, tagTemplateField, updateMask);
+ * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name.toString(), tagTemplateField, updateMask);
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
* TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
* UpdateTagTemplateFieldRequest request = UpdateTagTemplateFieldRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setTagTemplateField(tagTemplateField)
* .build();
* TagTemplateField response = dataCatalogClient.updateTagTemplateField(request);
@@ -2055,10 +2698,10 @@ public final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldReque
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
* TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build();
* UpdateTagTemplateFieldRequest request = UpdateTagTemplateFieldRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setTagTemplateField(tagTemplateField)
* .build();
* ApiFuture<TagTemplateField> future = dataCatalogClient.updateTagTemplateFieldCallable().futureCall(request);
@@ -2083,9 +2726,43 @@ public final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldReque
*
*
+ *
+ * @param name Required. The name of the tag template. Example:
+ *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * String newTagTemplateFieldId = "";
+ * TagTemplateField response = dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId);
+ * }
+ *
*
@@ -2097,7 +2774,6 @@ public final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldReque
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final TagTemplateField renameTagTemplateField(String name, String newTagTemplateFieldId) {
- FIELD_PATH_TEMPLATE.validate(name, "renameTagTemplateField");
RenameTagTemplateFieldRequest request =
RenameTagTemplateFieldRequest.newBuilder()
.setName(name)
@@ -2117,10 +2793,10 @@ public final TagTemplateField renameTagTemplateField(String name, String newTagT
*
*
+ * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
* String newTagTemplateFieldId = "";
- * TagTemplateField response = dataCatalogClient.renameTagTemplateField(formattedName, newTagTemplateFieldId);
+ * TagTemplateField response = dataCatalogClient.renameTagTemplateField(name.toString(), newTagTemplateFieldId);
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
* String newTagTemplateFieldId = "";
* RenameTagTemplateFieldRequest request = RenameTagTemplateFieldRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setNewTagTemplateFieldId(newTagTemplateFieldId)
* .build();
* TagTemplateField response = dataCatalogClient.renameTagTemplateField(request);
@@ -2145,10 +2821,10 @@ public final TagTemplateField renameTagTemplateField(RenameTagTemplateFieldReque
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
+ * TagTemplateFieldName name = TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
* String newTagTemplateFieldId = "";
* RenameTagTemplateFieldRequest request = RenameTagTemplateFieldRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setNewTagTemplateFieldId(newTagTemplateFieldId)
* .build();
* ApiFuture<TagTemplateField> future = dataCatalogClient.renameTagTemplateFieldCallable().futureCall(request);
@@ -2164,90 +2840,39 @@ public final TagTemplateField renameTagTemplateField(RenameTagTemplateFieldReque
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more
- * information).
+ * Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. Note: The project
+ * identified by the `parent` parameter for the
+ * [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters)
+ * and the [tag
+ * template](https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters)
+ * used to create the tag must be from the same organization.
*
*
*
- * @param name Required. The name of the tag template field to delete. Example:
+ * @param parent Required. The name of the resource to attach this tag to. Tags can be attached to
+ * Entries. Example:
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatFieldName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]");
- * boolean force = false;
- * dataCatalogClient.deleteTagTemplateField(formattedName, force);
+ * TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
+ * Tag tag = Tag.newBuilder().build();
+ * Tag response = dataCatalogClient.createTag(parent, tag);
* }
*
- *
- * @param request The request object containing all of the parameters for the API call.
+ * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
+ *
- * 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);
- * }
- *
- */
- public final UnaryCallable
- * 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();
- * }
- *
*
@@ -2279,7 +2904,6 @@ public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request)
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Tag createTag(String parent, Tag tag) {
- ENTRY_PATH_TEMPLATE.validate(parent, "createTag");
CreateTagRequest request = CreateTagRequest.newBuilder().setParent(parent).setTag(tag).build();
return createTag(request);
}
@@ -2297,10 +2921,10 @@ public final Tag createTag(String parent, Tag tag) {
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
* Tag tag = Tag.newBuilder().build();
- * Tag response = dataCatalogClient.createTag(formattedParent, tag);
+ * Tag response = dataCatalogClient.createTag(parent.toString(), tag);
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
* Tag tag = Tag.newBuilder().build();
* CreateTagRequest request = CreateTagRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setTag(tag)
* .build();
* Tag response = dataCatalogClient.createTag(request);
@@ -2327,10 +2951,10 @@ public final Tag createTag(CreateTagRequest request) {
*
*
- */
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
* Tag tag = Tag.newBuilder().build();
* CreateTagRequest request = CreateTagRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setTag(tag)
* .build();
* ApiFuture<Tag> future = dataCatalogClient.createTagCallable().futureCall(request);
@@ -2352,19 +2976,15 @@ public final UnaryCallable
*
* @param tag Required. The updated tag. The "name" field must be set.
- * @param updateMask 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`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Tag updateTag(Tag tag, FieldMask updateMask) {
- UpdateTagRequest request =
- UpdateTagRequest.newBuilder().setTag(tag).setUpdateMask(updateMask).build();
+ public final Tag updateTag(Tag tag) {
+ UpdateTagRequest request = UpdateTagRequest.newBuilder().setTag(tag).build();
return updateTag(request);
}
@@ -2377,18 +2997,20 @@ public final Tag updateTag(Tag tag, FieldMask updateMask) {
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
* Tag tag = Tag.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Tag response = dataCatalogClient.updateTag(tag, updateMask);
+ * Tag response = dataCatalogClient.updateTag(tag);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param tag Required. The updated tag. The "name" field must be set.
+ * @param updateMask 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`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Tag updateTag(UpdateTagRequest request) {
- return updateTagCallable().call(request);
+ public final Tag updateTag(Tag tag, FieldMask updateMask) {
+ UpdateTagRequest request =
+ UpdateTagRequest.newBuilder().setTag(tag).setUpdateMask(updateMask).build();
+ return updateTag(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -2403,83 +3025,66 @@ public final Tag updateTag(UpdateTagRequest request) {
* UpdateTagRequest request = UpdateTagRequest.newBuilder()
* .setTag(tag)
* .build();
- * ApiFuture<Tag> future = dataCatalogClient.updateTagCallable().futureCall(request);
- * // Do something
- * Tag response = future.get();
- * }
- *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
* Tag tag = Tag.newBuilder().build();
- * UpdateTagRequest request = UpdateTagRequest.newBuilder()
- * .setTag(tag)
- * .build();
- * Tag response = dataCatalogClient.updateTag(request);
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Tag response = dataCatalogClient.updateTag(tag, updateMask);
* }
*
*
- * @param name Required. The name of the tag to delete. Example:
- *
- * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatTagName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
- * dataCatalogClient.deleteTag(formattedName);
+ * Tag response = dataCatalogClient.updateTag(request);
* }
*
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteTag(DeleteTagRequest request) {
- deleteTagCallable().call(request);
+ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedName = DataCatalogClient.formatTagName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]");
- * DeleteTagRequest request = DeleteTagRequest.newBuilder()
- * .setName(formattedName)
+ * Tag tag = Tag.newBuilder().build();
+ * UpdateTagRequest request = UpdateTagRequest.newBuilder()
+ * .setTag(tag)
* .build();
- * dataCatalogClient.deleteTag(request);
+ * ApiFuture<Tag> future = dataCatalogClient.updateTagCallable().futureCall(request);
+ * // Do something
+ * Tag response = future.get();
* }
*
+ *
+ * @param 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] or an
+ * [EntryGroup][google.cloud.datacatalog.v1beta1.EntryGroup].
+ *
* 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();
+ * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
- * for (Tag element : dataCatalogClient.listTags(formattedParent).iterateAll()) {
+ * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * for (Tag element : dataCatalogClient.listTags(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -2506,7 +3111,6 @@ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* ListTagsRequest request = ListTagsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* for (Tag element : dataCatalogClient.listTags(request).iterateAll()) {
* // doThingsWith(element);
@@ -2544,9 +3148,9 @@ public final ListTagsPagedResponse listTags(ListTagsRequest request) {
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* ListTagsRequest request = ListTagsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* ApiFuture<ListTagsPagedResponse> future = dataCatalogClient.listTagsPagedCallable().futureCall(request);
* // Do something
@@ -2568,9 +3172,9 @@ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedParent = DataCatalogClient.formatEntryName("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* ListTagsRequest request = ListTagsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* while (true) {
* ListTagsResponse response = dataCatalogClient.listTagsCallable().call(request);
@@ -2606,9 +3210,9 @@ public final UnaryCallable
*
@@ -2619,10 +3223,12 @@ public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* Policy policy = Policy.newBuilder().build();
- * Policy response = dataCatalogClient.setIamPolicy(formattedResource, policy);
+ * Policy response = dataCatalogClient.setIamPolicy(resource, policy);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Policy setIamPolicy(SetIamPolicyRequest request) {
- return setIamPolicyCallable().call(request);
+ public final Policy setIamPolicy(String resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build();
+ return setIamPolicy(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -2673,157 +3281,52 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* Policy policy = Policy.newBuilder().build();
- * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
- * .setResource(formattedResource)
- * .setPolicy(policy)
- * .build();
- * Policy response = dataCatalogClient.setIamPolicy(request);
+ * Policy response = dataCatalogClient.setIamPolicy(resource.toString(), policy);
* }
*
- */
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* Policy policy = Policy.newBuilder().build();
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
- * .setResource(formattedResource)
+ * .setResource(resource.toString())
* .setPolicy(policy)
* .build();
- * ApiFuture<Policy> future = dataCatalogClient.setIamPolicyCallable().futureCall(request);
- * // Do something
- * Policy response = future.get();
- * }
- *
- *
- * @param resource REQUIRED: The resource for which the policy is being requested. See the
- * operation documentation for the appropriate value for this field.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Policy getIamPolicy(String resource) {
- TAG_TEMPLATE_PATH_TEMPLATE.validate(resource, "getIamPolicy");
- GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
- return getIamPolicy(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
- * does not exist. An empty policy is returned if the resource exists but does not have a policy
- * set on it.
- *
- *
- * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
- * Policy response = dataCatalogClient.getIamPolicy(formattedResource);
- * }
- *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Policy getIamPolicy(GetIamPolicyRequest request) {
- return getIamPolicyCallable().call(request);
+ public final Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
- * does not exist. An empty policy is returned if the resource exists but does not have a policy
- * set on it.
- *
- *
- * 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);
+ * Policy response = dataCatalogClient.setIamPolicy(request);
* }
*
*/
- public final UnaryCallable
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
- * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
- * .setResource(formattedResource)
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy policy = Policy.newBuilder().build();
+ * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .setPolicy(policy)
* .build();
- * ApiFuture<Policy> future = dataCatalogClient.getIamPolicyCallable().futureCall(request);
+ * ApiFuture<Policy> future = dataCatalogClient.setIamPolicyCallable().futureCall(request);
* // Do something
* Policy response = future.get();
* }
*
- *
- * @param resource REQUIRED: The resource for which the policy detail is being requested. See the
- * operation documentation for the appropriate value for this field.
- * @param 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).
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final TestIamPermissionsResponse testIamPermissions(
- String resource, List
- * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
- * List<String> permissions = new ArrayList<>();
- * TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(formattedResource, permissions);
- * }
- *
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
- * .setResource(formattedResource)
+ * .setResource(resource.toString())
* .addAllPermissions(permissions)
* .build();
* TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(request);
@@ -2873,10 +3376,10 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
*
*
* try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
- * String formattedResource = DataCatalogClient.formatTagTemplateName("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]");
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
- * .setResource(formattedResource)
+ * .setResource(resource.toString())
* .addAllPermissions(permissions)
* .build();
* ApiFuture<TestIamPermissionsResponse> future = dataCatalogClient.testIamPermissionsCallable().futureCall(request);
@@ -3001,6 +3504,168 @@ protected SearchCatalogFixedSizeCollection createCollection(
}
}
+ public static class ListEntryGroupsPagedResponse
+ extends AbstractPagedListResponse<
+ ListEntryGroupsRequest,
+ ListEntryGroupsResponse,
+ EntryGroup,
+ ListEntryGroupsPage,
+ ListEntryGroupsFixedSizeCollection> {
+
+ public static ApiFuture
*
* DataCatalogSettings.Builder dataCatalogSettingsBuilder =
* DataCatalogSettings.newBuilder();
* dataCatalogSettingsBuilder
- * .createEntryGroupSettings()
+ * .deleteEntryGroupSettings()
* .setRetrySettings(
- * dataCatalogSettingsBuilder.createEntryGroupSettings().getRetrySettings().toBuilder()
+ * dataCatalogSettingsBuilder.deleteEntryGroupSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* DataCatalogSettings dataCatalogSettings = dataCatalogSettingsBuilder.build();
@@ -80,31 +82,11 @@ public class DataCatalogSettings extends ClientSettings
*
@@ -160,7 +170,61 @@ public PolicyTagManagerStub getStub() {
*
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * CreateTaxonomyRequest request = CreateTaxonomyRequest.newBuilder().build();
- * Taxonomy response = policyTagManagerClient.createTaxonomy(request);
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Taxonomy taxonomy = Taxonomy.newBuilder().build();
+ * Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
* }
*
*
+ *
+ * @param parent Required. Resource name of the project that the taxonomy will belong to.
+ * @param taxonomy The taxonomy to be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Taxonomy createTaxonomy(LocationName parent, Taxonomy taxonomy) {
+ CreateTaxonomyRequest request =
+ CreateTaxonomyRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTaxonomy(taxonomy)
+ .build();
+ return createTaxonomy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a taxonomy in the specified project.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * CreateTaxonomyRequest request = CreateTaxonomyRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Taxonomy taxonomy = Taxonomy.newBuilder().build();
+ * Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the project that the taxonomy will belong to.
+ * @param taxonomy The taxonomy to be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Taxonomy createTaxonomy(String parent, Taxonomy taxonomy) {
+ CreateTaxonomyRequest request =
+ CreateTaxonomyRequest.newBuilder().setParent(parent).setTaxonomy(taxonomy).build();
+ return createTaxonomy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a taxonomy in the specified project.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Taxonomy taxonomy = Taxonomy.newBuilder().build();
+ * Taxonomy response = policyTagManagerClient.createTaxonomy(parent.toString(), taxonomy);
+ * }
+ *
@@ -180,7 +244,10 @@ public final Taxonomy createTaxonomy(CreateTaxonomyRequest request) {
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * CreateTaxonomyRequest request = CreateTaxonomyRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* Taxonomy response = policyTagManagerClient.createTaxonomy(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * CreateTaxonomyRequest request = CreateTaxonomyRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * CreateTaxonomyRequest request = CreateTaxonomyRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ApiFuture<Taxonomy> future = policyTagManagerClient.createTaxonomyCallable().futureCall(request);
* // Do something
* Taxonomy response = future.get();
@@ -200,7 +267,57 @@ public final UnaryCallable
+ *
+ * @param name Required. Resource name of the taxonomy to be deleted. All policy tags in this
+ * taxonomy will also be deleted.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTaxonomy(TaxonomyName name) {
+ DeleteTaxonomyRequest request =
+ DeleteTaxonomyRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteTaxonomy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with
+ * their associated policies.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * DeleteTaxonomyRequest request = DeleteTaxonomyRequest.newBuilder().build();
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * policyTagManagerClient.deleteTaxonomy(name);
+ * }
+ *
+ *
+ * @param name Required. Resource name of the taxonomy to be deleted. All policy tags in this
+ * taxonomy will also be deleted.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTaxonomy(String name) {
+ DeleteTaxonomyRequest request = DeleteTaxonomyRequest.newBuilder().setName(name).build();
+ deleteTaxonomy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with
+ * their associated policies.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * policyTagManagerClient.deleteTaxonomy(name.toString());
+ * }
+ *
@@ -221,7 +338,10 @@ public final void deleteTaxonomy(DeleteTaxonomyRequest request) {
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * DeleteTaxonomyRequest request = DeleteTaxonomyRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* policyTagManagerClient.deleteTaxonomy(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * DeleteTaxonomyRequest request = DeleteTaxonomyRequest.newBuilder().build();
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * DeleteTaxonomyRequest request = DeleteTaxonomyRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* ApiFuture<Void> future = policyTagManagerClient.deleteTaxonomyCallable().futureCall(request);
* // Do something
* future.get();
@@ -232,6 +352,29 @@ public final UnaryCallable
+ *
+ * @param taxonomy The taxonomy to update. Only description, display_name, and activated policy
+ * types can be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Taxonomy updateTaxonomy(Taxonomy taxonomy) {
+ UpdateTaxonomyRequest request =
+ UpdateTaxonomyRequest.newBuilder().setTaxonomy(taxonomy).build();
+ return updateTaxonomy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates a taxonomy.
@@ -280,16 +423,72 @@ public final UnaryCallable
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * Taxonomy taxonomy = Taxonomy.newBuilder().build();
+ * Taxonomy response = policyTagManagerClient.updateTaxonomy(taxonomy);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the project to list the taxonomies of.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTaxonomiesPagedResponse listTaxonomies(LocationName parent) {
+ ListTaxonomiesRequest request =
+ ListTaxonomiesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listTaxonomies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all taxonomies in a project in a particular location that the caller has permission to
+ * view.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * ListTaxonomiesRequest request = ListTaxonomiesRequest.newBuilder().build();
- * ListTaxonomiesResponse response = policyTagManagerClient.listTaxonomies(request);
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Taxonomy element : policyTagManagerClient.listTaxonomies(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the project to list the taxonomies of.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTaxonomiesPagedResponse listTaxonomies(String parent) {
+ ListTaxonomiesRequest request = ListTaxonomiesRequest.newBuilder().setParent(parent).build();
+ return listTaxonomies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all taxonomies in a project in a particular location that the caller has permission to
+ * view.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Taxonomy element : policyTagManagerClient.listTaxonomies(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListTaxonomiesResponse listTaxonomies(ListTaxonomiesRequest request) {
- return listTaxonomiesCallable().call(request);
+ public final ListTaxonomiesPagedResponse listTaxonomies(ListTaxonomiesRequest request) {
+ return listTaxonomiesPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -301,10 +500,48 @@ public final ListTaxonomiesResponse listTaxonomies(ListTaxonomiesRequest request
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ListTaxonomiesRequest request = ListTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (Taxonomy element : policyTagManagerClient.listTaxonomies(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
+ */
+ public final UnaryCallable
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * ListTaxonomiesRequest request = ListTaxonomiesRequest.newBuilder().build();
- * ApiFuture<ListTaxonomiesResponse> future = policyTagManagerClient.listTaxonomiesCallable().futureCall(request);
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ListTaxonomiesRequest request = ListTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListTaxonomiesPagedResponse> future = policyTagManagerClient.listTaxonomiesPagedCallable().futureCall(request);
* // Do something
- * ListTaxonomiesResponse response = future.get();
+ * for (Taxonomy element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
*/
@@ -321,7 +558,53 @@ public final ListTaxonomiesResponse listTaxonomies(ListTaxonomiesRequest request
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ListTaxonomiesRequest request = ListTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListTaxonomiesResponse response = policyTagManagerClient.listTaxonomiesCallable().call(request);
+ * for (Taxonomy element : response.getTaxonomiesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
* }
*
+ *
+ * @param name Required. Resource name of the requested taxonomy.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Taxonomy getTaxonomy(TaxonomyName name) {
+ GetTaxonomyRequest request =
+ GetTaxonomyRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getTaxonomy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a taxonomy.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * GetTaxonomyRequest request = GetTaxonomyRequest.newBuilder().build();
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * Taxonomy response = policyTagManagerClient.getTaxonomy(name);
+ * }
+ *
+ *
+ * @param name Required. Resource name of the requested taxonomy.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Taxonomy getTaxonomy(String name) {
+ GetTaxonomyRequest request = GetTaxonomyRequest.newBuilder().setName(name).build();
+ return getTaxonomy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a taxonomy.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * Taxonomy response = policyTagManagerClient.getTaxonomy(name.toString());
+ * }
+ *
@@ -341,7 +624,10 @@ public final Taxonomy getTaxonomy(GetTaxonomyRequest request) {
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * GetTaxonomyRequest request = GetTaxonomyRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* Taxonomy response = policyTagManagerClient.getTaxonomy(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * GetTaxonomyRequest request = GetTaxonomyRequest.newBuilder().build();
+ * TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * GetTaxonomyRequest request = GetTaxonomyRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* ApiFuture<Taxonomy> future = policyTagManagerClient.getTaxonomyCallable().futureCall(request);
* // Do something
* Taxonomy response = future.get();
@@ -360,7 +646,61 @@ public final UnaryCallable
+ *
+ * @param parent Required. Resource name of the taxonomy that the policy tag will belong to.
+ * @param policyTag The policy tag to be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PolicyTag createPolicyTag(TaxonomyName parent, PolicyTag policyTag) {
+ CreatePolicyTagRequest request =
+ CreatePolicyTagRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setPolicyTag(policyTag)
+ .build();
+ return createPolicyTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a policy tag in the specified taxonomy.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * CreatePolicyTagRequest request = CreatePolicyTagRequest.newBuilder().build();
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * PolicyTag policyTag = PolicyTag.newBuilder().build();
+ * PolicyTag response = policyTagManagerClient.createPolicyTag(parent, policyTag);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the taxonomy that the policy tag will belong to.
+ * @param policyTag The policy tag to be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PolicyTag createPolicyTag(String parent, PolicyTag policyTag) {
+ CreatePolicyTagRequest request =
+ CreatePolicyTagRequest.newBuilder().setParent(parent).setPolicyTag(policyTag).build();
+ return createPolicyTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a policy tag in the specified taxonomy.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * PolicyTag policyTag = PolicyTag.newBuilder().build();
+ * PolicyTag response = policyTagManagerClient.createPolicyTag(parent.toString(), policyTag);
+ * }
+ *
@@ -380,7 +720,10 @@ public final PolicyTag createPolicyTag(CreatePolicyTagRequest request) {
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * CreatePolicyTagRequest request = CreatePolicyTagRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* PolicyTag response = policyTagManagerClient.createPolicyTag(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * CreatePolicyTagRequest request = CreatePolicyTagRequest.newBuilder().build();
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * CreatePolicyTagRequest request = CreatePolicyTagRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ApiFuture<PolicyTag> future = policyTagManagerClient.createPolicyTagCallable().futureCall(request);
* // Do something
* PolicyTag response = future.get();
@@ -399,7 +742,55 @@ public final UnaryCallable
+ *
+ * @param name Required. Resource name of the policy tag to be deleted. All of its descendant
+ * policy tags will also be deleted.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePolicyTag(PolicyTagName name) {
+ DeletePolicyTagRequest request =
+ DeletePolicyTagRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deletePolicyTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a policy tag. Also deletes all of its descendant policy tags.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * DeletePolicyTagRequest request = DeletePolicyTagRequest.newBuilder().build();
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * policyTagManagerClient.deletePolicyTag(name);
+ * }
+ *
+ *
+ * @param name Required. Resource name of the policy tag to be deleted. All of its descendant
+ * policy tags will also be deleted.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePolicyTag(String name) {
+ DeletePolicyTagRequest request = DeletePolicyTagRequest.newBuilder().setName(name).build();
+ deletePolicyTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a policy tag. Also deletes all of its descendant policy tags.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * policyTagManagerClient.deletePolicyTag(name.toString());
+ * }
+ *
@@ -419,7 +810,10 @@ public final void deletePolicyTag(DeletePolicyTagRequest request) {
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * DeletePolicyTagRequest request = DeletePolicyTagRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* policyTagManagerClient.deletePolicyTag(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * DeletePolicyTagRequest request = DeletePolicyTagRequest.newBuilder().build();
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * DeletePolicyTagRequest request = DeletePolicyTagRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* ApiFuture<Void> future = policyTagManagerClient.deletePolicyTagCallable().futureCall(request);
* // Do something
* future.get();
@@ -430,6 +824,29 @@ public final UnaryCallable
+ *
+ * @param policyTag The policy tag to update. Only the description, display_name, and
+ * parent_policy_tag fields can be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PolicyTag updatePolicyTag(PolicyTag policyTag) {
+ UpdatePolicyTagRequest request =
+ UpdatePolicyTagRequest.newBuilder().setPolicyTag(policyTag).build();
+ return updatePolicyTag(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates a policy tag.
@@ -477,16 +894,70 @@ public final UnaryCallable
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * PolicyTag policyTag = PolicyTag.newBuilder().build();
+ * PolicyTag response = policyTagManagerClient.updatePolicyTag(policyTag);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the taxonomy to list the policy tags of.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPolicyTagsPagedResponse listPolicyTags(TaxonomyName parent) {
+ ListPolicyTagsRequest request =
+ ListPolicyTagsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listPolicyTags(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all policy tags in a taxonomy.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * ListPolicyTagsRequest request = ListPolicyTagsRequest.newBuilder().build();
- * ListPolicyTagsResponse response = policyTagManagerClient.listPolicyTags(request);
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * for (PolicyTag element : policyTagManagerClient.listPolicyTags(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the taxonomy to list the policy tags of.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPolicyTagsPagedResponse listPolicyTags(String parent) {
+ ListPolicyTagsRequest request = ListPolicyTagsRequest.newBuilder().setParent(parent).build();
+ return listPolicyTags(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all policy tags in a taxonomy.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * for (PolicyTag element : policyTagManagerClient.listPolicyTags(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListPolicyTagsResponse listPolicyTags(ListPolicyTagsRequest request) {
- return listPolicyTagsCallable().call(request);
+ public final ListPolicyTagsPagedResponse listPolicyTags(ListPolicyTagsRequest request) {
+ return listPolicyTagsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -497,10 +968,47 @@ public final ListPolicyTagsResponse listPolicyTags(ListPolicyTagsRequest request
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * ListPolicyTagsRequest request = ListPolicyTagsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (PolicyTag element : policyTagManagerClient.listPolicyTags(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
+ */
+ public final UnaryCallable
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * ListPolicyTagsRequest request = ListPolicyTagsRequest.newBuilder().build();
- * ApiFuture<ListPolicyTagsResponse> future = policyTagManagerClient.listPolicyTagsCallable().futureCall(request);
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * ListPolicyTagsRequest request = ListPolicyTagsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListPolicyTagsPagedResponse> future = policyTagManagerClient.listPolicyTagsPagedCallable().futureCall(request);
* // Do something
- * ListPolicyTagsResponse response = future.get();
+ * for (PolicyTag element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
*/
@@ -517,7 +1025,53 @@ public final ListPolicyTagsResponse listPolicyTags(ListPolicyTagsRequest request
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
+ * ListPolicyTagsRequest request = ListPolicyTagsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListPolicyTagsResponse response = policyTagManagerClient.listPolicyTagsCallable().call(request);
+ * for (PolicyTag element : response.getPolicyTagsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
* }
*
+ *
+ * @param name Required. Resource name of the requested policy tag.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PolicyTag getPolicyTag(PolicyTagName name) {
+ GetPolicyTagRequest request =
+ GetPolicyTagRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getPolicyTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a policy tag.
+ *
+ *
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * GetPolicyTagRequest request = GetPolicyTagRequest.newBuilder().build();
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * PolicyTag response = policyTagManagerClient.getPolicyTag(name);
+ * }
+ *
+ *
+ * @param name Required. Resource name of the requested policy tag.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PolicyTag getPolicyTag(String name) {
+ GetPolicyTagRequest request = GetPolicyTagRequest.newBuilder().setName(name).build();
+ return getPolicyTag(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a policy tag.
+ *
+ *
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * PolicyTag response = policyTagManagerClient.getPolicyTag(name.toString());
+ * }
+ *
@@ -537,7 +1091,10 @@ public final PolicyTag getPolicyTag(GetPolicyTagRequest request) {
*
*
+ * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * GetPolicyTagRequest request = GetPolicyTagRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* PolicyTag response = policyTagManagerClient.getPolicyTag(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * GetPolicyTagRequest request = GetPolicyTagRequest.newBuilder().build();
+ * PolicyTagName name = PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
+ * GetPolicyTagRequest request = GetPolicyTagRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* ApiFuture<PolicyTag> future = policyTagManagerClient.getPolicyTagCallable().futureCall(request);
* // Do something
* PolicyTag response = future.get();
@@ -556,7 +1113,10 @@ public final UnaryCallable
@@ -576,7 +1136,10 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
*
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().build();
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .build();
* Policy response = policyTagManagerClient.getIamPolicy(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().build();
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .build();
* ApiFuture<Policy> future = policyTagManagerClient.getIamPolicyCallable().futureCall(request);
* // Do something
* Policy response = future.get();
@@ -595,7 +1158,12 @@ public final UnaryCallable
@@ -615,7 +1183,12 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
*
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder().build();
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy policy = Policy.newBuilder().build();
+ * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .setPolicy(policy)
+ * .build();
* Policy response = policyTagManagerClient.setIamPolicy(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder().build();
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * Policy policy = Policy.newBuilder().build();
+ * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .setPolicy(policy)
+ * .build();
* ApiFuture<Policy> future = policyTagManagerClient.setIamPolicyCallable().futureCall(request);
* // Do something
* Policy response = future.get();
@@ -634,7 +1207,12 @@ public final UnaryCallable
@@ -654,7 +1232,12 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
*
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder().build();
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .addAllPermissions(permissions)
+ * .build();
* TestIamPermissionsResponse response = policyTagManagerClient.testIamPermissions(request);
* }
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder().build();
+ * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .addAllPermissions(permissions)
+ * .build();
* ApiFuture<TestIamPermissionsResponse> future = policyTagManagerClient.testIamPermissionsCallable().futureCall(request);
* // Do something
* TestIamPermissionsResponse response = future.get();
@@ -695,4 +1278,166 @@ public void shutdownNow() {
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return stub.awaitTermination(duration, unit);
}
+
+ public static class ListTaxonomiesPagedResponse
+ extends AbstractPagedListResponse<
+ ListTaxonomiesRequest,
+ ListTaxonomiesResponse,
+ Taxonomy,
+ ListTaxonomiesPage,
+ ListTaxonomiesFixedSizeCollection> {
+
+ public static ApiFuture
*
* try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.create()) {
- * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ImportTaxonomiesResponse response = policyTagManagerSerializationClient.importTaxonomies(request);
* }
*
@@ -160,7 +163,10 @@ public PolicyTagManagerSerializationStub getStub() {
*
*
@@ -182,7 +188,10 @@ public final ImportTaxonomiesResponse importTaxonomies(ImportTaxonomiesRequest r
*
*
* try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.create()) {
- * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ImportTaxonomiesResponse response = policyTagManagerSerializationClient.importTaxonomies(request);
* }
*
* try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.create()) {
- * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ApiFuture<ImportTaxonomiesResponse> future = policyTagManagerSerializationClient.importTaxonomiesCallable().futureCall(request);
* // Do something
* ImportTaxonomiesResponse response = future.get();
@@ -205,7 +214,12 @@ public final ImportTaxonomiesResponse importTaxonomies(ImportTaxonomiesRequest r
*
*
@@ -228,7 +242,12 @@ public final ExportTaxonomiesResponse exportTaxonomies(ExportTaxonomiesRequest r
*
*
* try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.create()) {
- * ExportTaxonomiesRequest request = ExportTaxonomiesRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * List<TaxonomyName> taxonomies = new ArrayList<>();
+ * ExportTaxonomiesRequest request = ExportTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllTaxonomies(TaxonomyName.toStringList(taxonomies))
+ * .build();
* ExportTaxonomiesResponse response = policyTagManagerSerializationClient.exportTaxonomies(request);
* }
*
* try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.create()) {
- * ExportTaxonomiesRequest request = ExportTaxonomiesRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * List<TaxonomyName> taxonomies = new ArrayList<>();
+ * ExportTaxonomiesRequest request = ExportTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllTaxonomies(TaxonomyName.toStringList(taxonomies))
+ * .build();
* ApiFuture<ExportTaxonomiesResponse> future = policyTagManagerSerializationClient.exportTaxonomiesCallable().futureCall(request);
* // Do something
* ExportTaxonomiesResponse response = future.get();
diff --git a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/PolicyTagManagerSettings.java b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/PolicyTagManagerSettings.java
index 7c68ebaf..538b7705 100644
--- a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/PolicyTagManagerSettings.java
+++ b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/PolicyTagManagerSettings.java
@@ -15,6 +15,9 @@
*/
package com.google.cloud.datacatalog.v1beta1;
+import static com.google.cloud.datacatalog.v1beta1.PolicyTagManagerClient.ListPolicyTagsPagedResponse;
+import static com.google.cloud.datacatalog.v1beta1.PolicyTagManagerClient.ListTaxonomiesPagedResponse;
+
import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
@@ -23,6 +26,7 @@
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.datacatalog.v1beta1.stub.PolicyTagManagerStubSettings;
@@ -86,7 +90,9 @@ public UnaryCallSettings
*
@@ -47,8 +45,9 @@
*
* 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);
+ * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
+ * dataCatalogClient.deleteEntryGroup(name);
* }
*
*
*
@@ -64,7 +63,10 @@
*
* try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
- * CreateTaxonomyRequest request = CreateTaxonomyRequest.newBuilder().build();
- * Taxonomy response = policyTagManagerClient.createTaxonomy(request);
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Taxonomy taxonomy = Taxonomy.newBuilder().build();
+ * Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
* }
*
*
*
* try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.create()) {
- * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder().build();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ImportTaxonomiesRequest request = ImportTaxonomiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ImportTaxonomiesResponse response = policyTagManagerSerializationClient.importTaxonomies(request);
* }
*
diff --git a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/stub/DataCatalogStub.java b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/stub/DataCatalogStub.java
index 6fd1242d..cf044518 100644
--- a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/stub/DataCatalogStub.java
+++ b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1beta1/stub/DataCatalogStub.java
@@ -15,6 +15,8 @@
*/
package com.google.cloud.datacatalog.v1beta1.stub;
+import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.ListEntriesPagedResponse;
+import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.ListEntryGroupsPagedResponse;
import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.ListTagsPagedResponse;
import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.SearchCatalogPagedResponse;
@@ -81,26 +83,10 @@ public UnaryCallable