diff --git a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1/DataCatalogClient.java b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1/DataCatalogClient.java index 537fccc2..a1380094 100644 --- a/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1/DataCatalogClient.java +++ b/google-cloud-datacatalog/src/main/java/com/google/cloud/datacatalog/v1/DataCatalogClient.java @@ -50,6 +50,15 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String entryGroupId = "entryGroupId1228924712"; + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); + * } + * }+ * *
Note: close() needs to be called on the DataCatalogClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -164,6 +173,19 @@ public DataCatalogStub getStub() { * Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more * information. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build(); + * String query = "query107944136"; + * for (SearchCatalogResult element : + * dataCatalogClient.searchCatalog(scope, query).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param scope Required. The scope of this search request. A `scope` that has empty * `include_org_ids`, `include_project_ids` AND false `include_gcp_public_datasets` is * considered invalid. Data Catalog will return an error in such a case. @@ -203,6 +225,24 @@ public final SearchCatalogPagedResponse searchCatalog( * Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more * information. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SearchCatalogRequest request = + * SearchCatalogRequest.newBuilder() + * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) + * .setQuery("query107944136") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (SearchCatalogResult element : dataCatalogClient.searchCatalog(request).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 */ @@ -227,6 +267,25 @@ public final SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest reque * information. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SearchCatalogRequest request = + * SearchCatalogRequest.newBuilder() + * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) + * .setQuery("query107944136") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.searchCatalogPagedCallable().futureCall(request); + * // Do something. + * for (SearchCatalogResult element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * SearchCatalogResponse response = dataCatalogClient.searchCatalogCallable().call(request); + * for (SearchCatalogResult element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String entryGroupId = "entryGroupId1228924712"; + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); + * } + * }+ * * @param parent Required. The name of the project this entry group is in. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * String entryGroupId = "entryGroupId1228924712"; + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryGroupRequest request = + * CreateEntryGroupRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryGroupId("entryGroupId1228924712") + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(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 */ @@ -385,6 +497,21 @@ public final EntryGroup createEntryGroup(CreateEntryGroupRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryGroupRequest request = + * CreateEntryGroupRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryGroupId("entryGroupId1228924712") + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.createEntryGroupCallable().futureCall(request); + * // Do something. + * EntryGroup response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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 @@ -408,6 +544,15 @@ public final EntryGroup getEntryGroup(EntryGroupName name) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * 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 @@ -421,6 +566,16 @@ public final EntryGroup getEntryGroup(String name) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * FieldMask readMask = FieldMask.newBuilder().build(); + * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask); + * } + * }+ * * @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. @@ -439,6 +594,16 @@ public final EntryGroup getEntryGroup(EntryGroupName name, FieldMask readMask) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * FieldMask readMask = FieldMask.newBuilder().build(); + * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask); + * } + * }+ * * @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. @@ -454,6 +619,19 @@ public final EntryGroup getEntryGroup(String name, FieldMask readMask) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryGroupRequest request = + * GetEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * EntryGroup response = dataCatalogClient.getEntryGroup(request); + * } + * }+ * * @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 */ @@ -466,6 +644,19 @@ public final EntryGroup getEntryGroup(GetEntryGroupRequest request) { * Gets an EntryGroup. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryGroupRequest request = + * GetEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.getEntryGroupCallable().futureCall(request); + * // Do something. + * EntryGroup response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -492,6 +692,16 @@ public final EntryGroup updateEntryGroup(EntryGroup entryGroup) { * the `entry_group.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup, updateMask); + * } + * }+ * * @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. @@ -512,6 +722,19 @@ public final EntryGroup updateEntryGroup(EntryGroup entryGroup, FieldMask update * the `entry_group.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryGroupRequest request = + * UpdateEntryGroupRequest.newBuilder() + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * EntryGroup response = dataCatalogClient.updateEntryGroup(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 */ @@ -526,6 +749,20 @@ public final EntryGroup updateEntryGroup(UpdateEntryGroupRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryGroupRequest request = + * UpdateEntryGroupRequest.newBuilder() + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.updateEntryGroupCallable().futureCall(request); + * // Do something. + * EntryGroup response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * dataCatalogClient.deleteEntryGroup(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 @@ -555,6 +801,15 @@ public final void deleteEntryGroup(EntryGroupName name) { * Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * dataCatalogClient.deleteEntryGroup(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 @@ -571,6 +826,19 @@ public final void deleteEntryGroup(String name) { * Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryGroupRequest request = + * DeleteEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setForce(true) + * .build(); + * dataCatalogClient.deleteEntryGroup(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 */ @@ -586,6 +854,19 @@ public final void deleteEntryGroup(DeleteEntryGroupRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryGroupRequest request = + * DeleteEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteEntryGroupCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntryGroupsRequest request = + * ListEntryGroupsRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (EntryGroup element : dataCatalogClient.listEntryGroups(request).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 */ @@ -644,6 +963,23 @@ public final ListEntryGroupsPagedResponse listEntryGroups(ListEntryGroupsRequest * Lists entry groups. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntryGroupsRequest request = + * ListEntryGroupsRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.listEntryGroupsPagedCallable().futureCall(request); + * // Do something. + * for (EntryGroup element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * ListEntryGroupsResponse response = + * dataCatalogClient.listEntryGroupsCallable().call(request); + * for (EntryGroup element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
A maximum of 100,000 entries may be created per entry group. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * String entryId = "entryId-1591558867"; + * Entry entry = Entry.newBuilder().build(); + * Entry response = dataCatalogClient.createEntry(parent, entryId, entry); + * } + * }+ * * @param parent Required. The name of the entry group this entry is in. Example: *
A maximum of 100,000 entries may be created per entry group. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * String entryId = "entryId-1591558867"; + * Entry entry = Entry.newBuilder().build(); + * Entry response = dataCatalogClient.createEntry(parent, entryId, entry); + * } + * }+ * * @param parent Required. The name of the entry group this entry is in. Example: *
A maximum of 100,000 entries may be created per entry group. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryRequest request = + * CreateEntryRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryId("entryId-1591558867") + * .setEntry(Entry.newBuilder().build()) + * .build(); + * Entry response = dataCatalogClient.createEntry(request); + * } + * }+ * * @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 */ @@ -749,6 +1139,20 @@ public final Entry createEntry(CreateEntryRequest request) { *
A maximum of 100,000 entries may be created per entry group. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryRequest request = + * CreateEntryRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryId("entryId-1591558867") + * .setEntry(Entry.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.createEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -774,6 +1187,16 @@ public final Entry updateEntry(Entry entry) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * Entry entry = Entry.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Entry response = dataCatalogClient.updateEntry(entry, updateMask); + * } + * }+ * * @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. @@ -801,6 +1224,19 @@ public final Entry updateEntry(Entry entry, FieldMask updateMask) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryRequest request = + * UpdateEntryRequest.newBuilder() + * .setEntry(Entry.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Entry response = dataCatalogClient.updateEntry(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 */ @@ -815,6 +1251,19 @@ public final Entry updateEntry(UpdateEntryRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryRequest request = + * UpdateEntryRequest.newBuilder() + * .setEntry(Entry.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.updateEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * dataCatalogClient.deleteEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); + * dataCatalogClient.deleteEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryRequest request = + * DeleteEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").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 */ @@ -885,6 +1365,19 @@ public final void deleteEntry(DeleteEntryRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryRequest request = + * DeleteEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteEntryCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * Entry response = dataCatalogClient.getEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); + * Entry response = dataCatalogClient.getEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryRequest request = + * GetEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) + * .build(); + * Entry response = dataCatalogClient.getEntry(request); + * } + * }+ * * @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 */ @@ -939,6 +1463,19 @@ public final Entry getEntry(GetEntryRequest request) { * Gets an entry. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryRequest request = + * GetEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.getEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * 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 */ @@ -962,6 +1508,15 @@ public final Entry lookupEntry(LookupEntryRequest request) { * the source Google Cloud Platform service to get the Data Catalog Entry. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LookupEntryRequest request = LookupEntryRequest.newBuilder().build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.lookupEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the entry group that contains the entries, which can be * provided in URL format. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the entry group that contains the entries, which can be * provided in URL format. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntriesRequest request = + * ListEntriesRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * for (Entry element : dataCatalogClient.listEntries(request).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 */ @@ -1020,6 +1614,23 @@ public final ListEntriesPagedResponse listEntries(ListEntriesRequest request) { * Lists entries. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntriesRequest request = + * ListEntriesRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.listEntriesPagedCallable().futureCall(request); + * // Do something. + * for (Entry element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * ListEntriesResponse response = dataCatalogClient.listEntriesCallable().call(request); + * for (Entry element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String tagTemplateId = "tagTemplateId-1438776721"; + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * TagTemplate response = + * dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). *
Example: @@ -1072,6 +1712,18 @@ public final TagTemplate createTagTemplate( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * String tagTemplateId = "tagTemplateId-1438776721"; + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * TagTemplate response = + * dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). *
Example: @@ -1101,6 +1753,20 @@ public final TagTemplate createTagTemplate( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateRequest request = + * CreateTagTemplateRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateId("tagTemplateId-1438776721") + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .build(); + * TagTemplate response = dataCatalogClient.createTagTemplate(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 */ @@ -1116,6 +1782,21 @@ public final TagTemplate createTagTemplate(CreateTagTemplateRequest request) { * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateRequest request = + * CreateTagTemplateRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateId("tagTemplateId-1438776721") + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.createTagTemplateCallable().futureCall(request); + * // Do something. + * TagTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * TagTemplate response = dataCatalogClient.getTagTemplate(name); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * TagTemplate response = dataCatalogClient.getTagTemplate(name); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetTagTemplateRequest request = + * GetTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .build(); + * TagTemplate response = dataCatalogClient.getTagTemplate(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 */ @@ -1170,6 +1881,19 @@ public final TagTemplate getTagTemplate(GetTagTemplateRequest request) { * Gets a tag template. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetTagTemplateRequest request = + * GetTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.getTagTemplateCallable().futureCall(request); + * // Do something. + * TagTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate); + * } + * }+ * * @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 */ @@ -1200,6 +1933,16 @@ public final TagTemplate updateTagTemplate(TagTemplate tagTemplate) { * identified by the `tag_template.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate, updateMask); + * } + * }+ * * @param tagTemplate Required. The template to update. The "name" field must be set. * @param updateMask The field mask specifies the parts of the template to overwrite. *
Allowed fields: @@ -1224,6 +1967,19 @@ public final TagTemplate updateTagTemplate(TagTemplate tagTemplate, FieldMask up * identified by the `tag_template.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateRequest request = + * UpdateTagTemplateRequest.newBuilder() + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * TagTemplate response = dataCatalogClient.updateTagTemplate(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 */ @@ -1240,6 +1996,20 @@ public final TagTemplate updateTagTemplate(UpdateTagTemplateRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateRequest request = + * UpdateTagTemplateRequest.newBuilder() + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.updateTagTemplateCallable().futureCall(request); + * // Do something. + * TagTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * boolean force = true; + * dataCatalogClient.deleteTagTemplate(name, force); + * } + * }+ * * @param name Required. The name of the tag template to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * boolean force = true; + * dataCatalogClient.deleteTagTemplate(name, force); + * } + * }+ * * @param name Required. The name of the tag template to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateRequest request = + * DeleteTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setForce(true) + * .build(); + * dataCatalogClient.deleteTagTemplate(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 */ @@ -1312,6 +2115,19 @@ public final void deleteTagTemplate(DeleteTagTemplateRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateRequest request = + * DeleteTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteTagTemplateCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * String tagTemplateFieldId = "tagTemplateFieldId-1556835615"; + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * TagTemplateField response = + * dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). *
Example: @@ -1356,6 +2184,18 @@ public final TagTemplateField createTagTemplateField( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * String tagTemplateFieldId = "tagTemplateFieldId-1556835615"; + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * TagTemplateField response = + * dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). *
Example: @@ -1388,6 +2228,20 @@ public final TagTemplateField createTagTemplateField( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateFieldRequest request = + * CreateTagTemplateFieldRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateFieldId("tagTemplateFieldId-1556835615") + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .build(); + * TagTemplateField response = dataCatalogClient.createTagTemplateField(request); + * } + * }+ * * @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 */ @@ -1403,6 +2257,21 @@ public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldReque * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateFieldRequest request = + * CreateTagTemplateFieldRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateFieldId("tagTemplateFieldId-1556835615") + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.createTagTemplateFieldCallable().futureCall(request); + * // Do something. + * TagTemplateField response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name, tagTemplateField); + * } + * }+ * * @param name Required. The name of the tag template field. Example: *
Sample code: + * + *
{@code + * 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); + * } + * }+ * * @param name Required. The name of the tag template field. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * TagTemplateField response = + * dataCatalogClient.updateTagTemplateField(name, tagTemplateField, updateMask); + * } + * }+ * * @param name Required. The name of the tag template field. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateFieldRequest request = + * UpdateTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * TagTemplateField response = dataCatalogClient.updateTagTemplateField(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 */ @@ -1547,6 +2482,23 @@ public final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldReque * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateFieldRequest request = + * UpdateTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.updateTagTemplateFieldCallable().futureCall(request); + * // Do something. + * TagTemplateField response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateFieldName name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); + * String newTagTemplateFieldId = "newTagTemplateFieldId2008993953"; + * TagTemplateField response = + * dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * String newTagTemplateFieldId = "newTagTemplateFieldId2008993953"; + * TagTemplateField response = + * dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * RenameTagTemplateFieldRequest request = + * RenameTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setNewTagTemplateFieldId("newTagTemplateFieldId2008993953") + * .build(); + * TagTemplateField response = dataCatalogClient.renameTagTemplateField(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 */ @@ -1626,6 +2618,22 @@ public final TagTemplateField renameTagTemplateField(RenameTagTemplateFieldReque * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * RenameTagTemplateFieldRequest request = + * RenameTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setNewTagTemplateFieldId("newTagTemplateFieldId2008993953") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.renameTagTemplateFieldCallable().futureCall(request); + * // Do something. + * TagTemplateField response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateFieldName name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); + * boolean force = true; + * dataCatalogClient.deleteTagTemplateField(name, force); + * } + * }+ * * @param name Required. The name of the tag template field to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * boolean force = true; + * dataCatalogClient.deleteTagTemplateField(name, force); + * } + * }+ * * @param name Required. The name of the tag template field to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateFieldRequest request = + * DeleteTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setForce(true) + * .build(); + * dataCatalogClient.deleteTagTemplateField(request); + * } + * }+ * * @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 */ @@ -1703,6 +2749,22 @@ public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request) * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateFieldRequest request = + * DeleteTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.deleteTagTemplateFieldCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]"); + * Tag tag = Tag.newBuilder().build(); + * Tag response = dataCatalogClient.createTag(parent, tag); + * } + * }+ * * @param parent Required. The name of the resource to attach this tag to. Tags can be attached to * Entries. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString(); + * Tag tag = Tag.newBuilder().build(); + * Tag response = dataCatalogClient.createTag(parent, tag); + * } + * }+ * * @param parent Required. The name of the resource to attach this tag to. Tags can be attached to * Entries. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagRequest request = + * CreateTagRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setTag(Tag.newBuilder().build()) + * .build(); + * Tag response = dataCatalogClient.createTag(request); + * } + * }+ * * @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 */ @@ -1787,6 +2885,21 @@ public final Tag createTag(CreateTagRequest request) { * used to create the tag must be from the same organization. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagRequest request = + * CreateTagRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setTag(Tag.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.createTagCallable().futureCall(request); + * // Do something. + * Tag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * Tag tag = Tag.newBuilder().build(); + * Tag response = dataCatalogClient.updateTag(tag); + * } + * }+ * * @param tag Required. The updated tag. The "name" field must be set. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1808,6 +2930,16 @@ public final Tag updateTag(Tag tag) { /** * Updates an existing tag. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * Tag tag = Tag.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Tag response = dataCatalogClient.updateTag(tag, updateMask); + * } + * }+ * * @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`. @@ -1823,6 +2955,19 @@ public final Tag updateTag(Tag tag, FieldMask updateMask) { /** * Updates an existing tag. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagRequest request = + * UpdateTagRequest.newBuilder() + * .setTag(Tag.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * 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 */ @@ -1835,6 +2980,19 @@ public final Tag updateTag(UpdateTagRequest request) { * Updates an existing tag. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagRequest request = + * UpdateTagRequest.newBuilder() + * .setTag(Tag.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.updateTagCallable().futureCall(request); + * // Do something. + * Tag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * dataCatalogClient.deleteTag(name); + * } + * }+ * * @param name Required. The name of the tag to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString(); + * dataCatalogClient.deleteTag(name); + * } + * }+ * * @param name Required. The name of the tag to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagRequest request = + * DeleteTagRequest.newBuilder() + * .setName( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .build(); + * dataCatalogClient.deleteTag(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 */ @@ -1889,6 +3080,20 @@ public final void deleteTag(DeleteTagRequest request) { * Deletes a tag. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagRequest request = + * DeleteTagRequest.newBuilder() + * .setName( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteTagCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the Data Catalog resource to list the tags of. The resource * could be an [Entry][google.cloud.datacatalog.v1.Entry] or an * [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]. @@ -1919,6 +3135,18 @@ public final ListTagsPagedResponse listTags(EntryName parent) { /** * Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString(); + * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the Data Catalog resource to list the tags of. The resource * could be an [Entry][google.cloud.datacatalog.v1.Entry] or an * [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]. @@ -1939,6 +3167,24 @@ public final ListTagsPagedResponse listTags(String parent) { /** * Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListTagsRequest request = + * ListTagsRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Tag element : dataCatalogClient.listTags(request).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 */ @@ -1951,6 +3197,24 @@ public final ListTagsPagedResponse listTags(ListTagsRequest request) { * Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListTagsRequest request = + * ListTagsRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.listTagsPagedCallable().futureCall(request); + * // Do something. + * for (Tag element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * ListTagsResponse response = dataCatalogClient.listTagsCallable().call(request); + * for (Tag element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ResourceName resource = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * 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 @@ -2004,6 +3295,16 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String resource = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * 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 @@ -2028,6 +3329,20 @@ public final Policy setIamPolicy(String resource, Policy policy) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * Policy response = dataCatalogClient.setIamPolicy(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 */ @@ -2047,6 +3362,20 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ResourceName resource = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * 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 @@ -2092,6 +3430,15 @@ public final Policy getIamPolicy(ResourceName resource) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String resource = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * 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 @@ -2115,6 +3462,20 @@ public final Policy getIamPolicy(String resource) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * Policy response = dataCatalogClient.getIamPolicy(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 */ @@ -2137,6 +3498,20 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
A caller is not required to have Google IAM permission to make this request. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .addAllPermissions(new ArrayList+ * * @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 */ @@ -2172,6 +3561,21 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq *()) + * .build(); + * TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(request); + * } + * }
A caller is not required to have Google IAM permission to make this request. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .addAllPermissions(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * dataCatalogClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
Sample for DataCatalogClient: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String entryGroupId = "entryGroupId1228924712"; + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.datacatalog.v1; 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 e050c4d2..76af96a6 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 @@ -50,6 +50,15 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String entryGroupId = "entryGroupId1228924712"; + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); + * } + * }+ * *
Note: close() needs to be called on the DataCatalogClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -165,6 +174,19 @@ public DataCatalogStub getStub() { * Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more * information. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build(); + * String query = "query107944136"; + * for (SearchCatalogResult element : + * dataCatalogClient.searchCatalog(scope, query).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param scope Required. The scope of this search request. A `scope` that has empty * `include_org_ids`, `include_project_ids` AND false `include_gcp_public_datasets` is * considered invalid. Data Catalog will return an error in such a case. @@ -204,6 +226,24 @@ public final SearchCatalogPagedResponse searchCatalog( * Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more * information. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SearchCatalogRequest request = + * SearchCatalogRequest.newBuilder() + * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) + * .setQuery("query107944136") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (SearchCatalogResult element : dataCatalogClient.searchCatalog(request).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 */ @@ -228,6 +268,25 @@ public final SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest reque * information. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SearchCatalogRequest request = + * SearchCatalogRequest.newBuilder() + * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) + * .setQuery("query107944136") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.searchCatalogPagedCallable().futureCall(request); + * // Do something. + * for (SearchCatalogResult element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * SearchCatalogResponse response = dataCatalogClient.searchCatalogCallable().call(request); + * for (SearchCatalogResult element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String entryGroupId = "entryGroupId1228924712"; + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); + * } + * }+ * * @param parent Required. The name of the project this entry group is in. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * String entryGroupId = "entryGroupId1228924712"; + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryGroupRequest request = + * CreateEntryGroupRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryGroupId("entryGroupId1228924712") + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(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 */ @@ -342,6 +454,21 @@ public final EntryGroup createEntryGroup(CreateEntryGroupRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryGroupRequest request = + * CreateEntryGroupRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryGroupId("entryGroupId1228924712") + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.createEntryGroupCallable().futureCall(request); + * // Do something. + * EntryGroup response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -368,6 +504,16 @@ public final EntryGroup updateEntryGroup(EntryGroup entryGroup) { * the `entry_group.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup, updateMask); + * } + * }+ * * @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. @@ -388,6 +534,19 @@ public final EntryGroup updateEntryGroup(EntryGroup entryGroup, FieldMask update * the `entry_group.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryGroupRequest request = + * UpdateEntryGroupRequest.newBuilder() + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * EntryGroup response = dataCatalogClient.updateEntryGroup(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 */ @@ -402,6 +561,20 @@ public final EntryGroup updateEntryGroup(UpdateEntryGroupRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryGroupRequest request = + * UpdateEntryGroupRequest.newBuilder() + * .setEntryGroup(EntryGroup.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.updateEntryGroupCallable().futureCall(request); + * // Do something. + * EntryGroup response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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 @@ -425,6 +607,15 @@ public final EntryGroup getEntryGroup(EntryGroupName name) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * 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 @@ -438,6 +629,16 @@ public final EntryGroup getEntryGroup(String name) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * FieldMask readMask = FieldMask.newBuilder().build(); + * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask); + * } + * }+ * * @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. @@ -456,6 +657,16 @@ public final EntryGroup getEntryGroup(EntryGroupName name, FieldMask readMask) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * FieldMask readMask = FieldMask.newBuilder().build(); + * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask); + * } + * }+ * * @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. @@ -471,6 +682,19 @@ public final EntryGroup getEntryGroup(String name, FieldMask readMask) { /** * Gets an EntryGroup. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryGroupRequest request = + * GetEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * EntryGroup response = dataCatalogClient.getEntryGroup(request); + * } + * }+ * * @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 */ @@ -483,6 +707,19 @@ public final EntryGroup getEntryGroup(GetEntryGroupRequest request) { * Gets an EntryGroup. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryGroupRequest request = + * GetEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.getEntryGroupCallable().futureCall(request); + * // Do something. + * EntryGroup response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * dataCatalogClient.deleteEntryGroup(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 @@ -512,6 +758,15 @@ public final void deleteEntryGroup(EntryGroupName name) { * Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * dataCatalogClient.deleteEntryGroup(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 @@ -528,6 +783,19 @@ public final void deleteEntryGroup(String name) { * Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryGroupRequest request = + * DeleteEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setForce(true) + * .build(); + * dataCatalogClient.deleteEntryGroup(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 */ @@ -543,6 +811,19 @@ public final void deleteEntryGroup(DeleteEntryGroupRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryGroupRequest request = + * DeleteEntryGroupRequest.newBuilder() + * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteEntryGroupCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntryGroupsRequest request = + * ListEntryGroupsRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (EntryGroup element : dataCatalogClient.listEntryGroups(request).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 */ @@ -601,6 +920,23 @@ public final ListEntryGroupsPagedResponse listEntryGroups(ListEntryGroupsRequest * Lists entry groups. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntryGroupsRequest request = + * ListEntryGroupsRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.listEntryGroupsPagedCallable().futureCall(request); + * // Do something. + * for (EntryGroup element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * ListEntryGroupsResponse response = + * dataCatalogClient.listEntryGroupsCallable().call(request); + * for (EntryGroup element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
A maximum of 100,000 entries may be created per entry group. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * String entryId = "entryId-1591558867"; + * Entry entry = Entry.newBuilder().build(); + * Entry response = dataCatalogClient.createEntry(parent, entryId, entry); + * } + * }+ * * @param parent Required. The name of the entry group this entry is in. Example: *
A maximum of 100,000 entries may be created per entry group. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * String entryId = "entryId-1591558867"; + * Entry entry = Entry.newBuilder().build(); + * Entry response = dataCatalogClient.createEntry(parent, entryId, entry); + * } + * }+ * * @param parent Required. The name of the entry group this entry is in. Example: *
A maximum of 100,000 entries may be created per entry group. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryRequest request = + * CreateEntryRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryId("entryId-1591558867") + * .setEntry(Entry.newBuilder().build()) + * .build(); + * Entry response = dataCatalogClient.createEntry(request); + * } + * }+ * * @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 */ @@ -706,6 +1096,20 @@ public final Entry createEntry(CreateEntryRequest request) { *
A maximum of 100,000 entries may be created per entry group. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateEntryRequest request = + * CreateEntryRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setEntryId("entryId-1591558867") + * .setEntry(Entry.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.createEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -731,6 +1144,16 @@ public final Entry updateEntry(Entry entry) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * Entry entry = Entry.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Entry response = dataCatalogClient.updateEntry(entry, updateMask); + * } + * }+ * * @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. @@ -758,6 +1181,19 @@ public final Entry updateEntry(Entry entry, FieldMask updateMask) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryRequest request = + * UpdateEntryRequest.newBuilder() + * .setEntry(Entry.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Entry response = dataCatalogClient.updateEntry(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 */ @@ -772,6 +1208,19 @@ public final Entry updateEntry(UpdateEntryRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateEntryRequest request = + * UpdateEntryRequest.newBuilder() + * .setEntry(Entry.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.updateEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * dataCatalogClient.deleteEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); + * dataCatalogClient.deleteEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryRequest request = + * DeleteEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").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 */ @@ -842,6 +1322,19 @@ public final void deleteEntry(DeleteEntryRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteEntryRequest request = + * DeleteEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteEntryCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * Entry response = dataCatalogClient.getEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); + * Entry response = dataCatalogClient.getEntry(name); + * } + * }+ * * @param name Required. The name of the entry. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryRequest request = + * GetEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) + * .build(); + * Entry response = dataCatalogClient.getEntry(request); + * } + * }+ * * @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 */ @@ -896,6 +1420,19 @@ public final Entry getEntry(GetEntryRequest request) { * Gets an entry. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetEntryRequest request = + * GetEntryRequest.newBuilder() + * .setName( + * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.getEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * 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 */ @@ -919,6 +1465,15 @@ public final Entry lookupEntry(LookupEntryRequest request) { * the source Google Cloud Platform service to get the Data Catalog Entry. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LookupEntryRequest request = LookupEntryRequest.newBuilder().build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.lookupEntryCallable().futureCall(request); + * // Do something. + * Entry response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); + * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the entry group that contains the entries, which can be * provided in URL format. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); + * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the entry group that contains the entries, which can be * provided in URL format. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntriesRequest request = + * ListEntriesRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * for (Entry element : dataCatalogClient.listEntries(request).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 */ @@ -977,6 +1571,23 @@ public final ListEntriesPagedResponse listEntries(ListEntriesRequest request) { * Lists entries. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListEntriesRequest request = + * ListEntriesRequest.newBuilder() + * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.listEntriesPagedCallable().futureCall(request); + * // Do something. + * for (Entry element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * ListEntriesResponse response = dataCatalogClient.listEntriesCallable().call(request); + * for (Entry element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String tagTemplateId = "tagTemplateId-1438776721"; + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * TagTemplate response = + * dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions. *
Example: @@ -1029,6 +1669,18 @@ public final TagTemplate createTagTemplate( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * String tagTemplateId = "tagTemplateId-1438776721"; + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * TagTemplate response = + * dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions. *
Example: @@ -1058,6 +1710,20 @@ public final TagTemplate createTagTemplate( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateRequest request = + * CreateTagTemplateRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateId("tagTemplateId-1438776721") + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .build(); + * TagTemplate response = dataCatalogClient.createTagTemplate(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 */ @@ -1073,6 +1739,21 @@ public final TagTemplate createTagTemplate(CreateTagTemplateRequest request) { * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateRequest request = + * CreateTagTemplateRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateId("tagTemplateId-1438776721") + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.createTagTemplateCallable().futureCall(request); + * // Do something. + * TagTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * TagTemplate response = dataCatalogClient.getTagTemplate(name); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * TagTemplate response = dataCatalogClient.getTagTemplate(name); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetTagTemplateRequest request = + * GetTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .build(); + * TagTemplate response = dataCatalogClient.getTagTemplate(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 */ @@ -1127,6 +1838,19 @@ public final TagTemplate getTagTemplate(GetTagTemplateRequest request) { * Gets a tag template. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetTagTemplateRequest request = + * GetTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.getTagTemplateCallable().futureCall(request); + * // Do something. + * TagTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate); + * } + * }+ * * @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 */ @@ -1157,6 +1890,16 @@ public final TagTemplate updateTagTemplate(TagTemplate tagTemplate) { * identified by the `tag_template.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate, updateMask); + * } + * }+ * * @param tagTemplate Required. The template to update. The "name" field must be set. * @param updateMask The field mask specifies the parts of the template to overwrite. *
Allowed fields: @@ -1181,6 +1924,19 @@ public final TagTemplate updateTagTemplate(TagTemplate tagTemplate, FieldMask up * identified by the `tag_template.name` parameter (see [Data Catalog Resource Project] * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateRequest request = + * UpdateTagTemplateRequest.newBuilder() + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * TagTemplate response = dataCatalogClient.updateTagTemplate(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 */ @@ -1197,6 +1953,20 @@ public final TagTemplate updateTagTemplate(UpdateTagTemplateRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateRequest request = + * UpdateTagTemplateRequest.newBuilder() + * .setTagTemplate(TagTemplate.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.updateTagTemplateCallable().futureCall(request); + * // Do something. + * TagTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * boolean force = true; + * dataCatalogClient.deleteTagTemplate(name, force); + * } + * }+ * * @param name Required. The name of the tag template to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * boolean force = true; + * dataCatalogClient.deleteTagTemplate(name, force); + * } + * }+ * * @param name Required. The name of the tag template to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateRequest request = + * DeleteTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setForce(true) + * .build(); + * dataCatalogClient.deleteTagTemplate(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 */ @@ -1269,6 +2072,19 @@ public final void deleteTagTemplate(DeleteTagTemplateRequest request) { * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateRequest request = + * DeleteTagTemplateRequest.newBuilder() + * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteTagTemplateCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); + * String tagTemplateFieldId = "tagTemplateFieldId-1556835615"; + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * TagTemplateField response = + * dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). *
Example: @@ -1313,6 +2141,18 @@ public final TagTemplateField createTagTemplateField( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); + * String tagTemplateFieldId = "tagTemplateFieldId-1556835615"; + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * TagTemplateField response = + * dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField); + * } + * }+ * * @param parent Required. The name of the project and the template location * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). *
Example: @@ -1345,6 +2185,20 @@ public final TagTemplateField createTagTemplateField( * Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more * information). * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateFieldRequest request = + * CreateTagTemplateFieldRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateFieldId("tagTemplateFieldId-1556835615") + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .build(); + * TagTemplateField response = dataCatalogClient.createTagTemplateField(request); + * } + * }+ * * @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 */ @@ -1360,6 +2214,21 @@ public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldReque * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagTemplateFieldRequest request = + * CreateTagTemplateFieldRequest.newBuilder() + * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) + * .setTagTemplateFieldId("tagTemplateFieldId-1556835615") + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.createTagTemplateFieldCallable().futureCall(request); + * // Do something. + * TagTemplateField response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * 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: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name, tagTemplateField); + * } + * }+ * * @param name Required. The name of the tag template field. Example: *
Sample code: + * + *
{@code + * 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); + * } + * }+ * * @param name Required. The name of the tag template field. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * TagTemplateField response = + * dataCatalogClient.updateTagTemplateField(name, tagTemplateField, updateMask); + * } + * }+ * * @param name Required. The name of the tag template field. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateFieldRequest request = + * UpdateTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * TagTemplateField response = dataCatalogClient.updateTagTemplateField(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 */ @@ -1504,6 +2439,23 @@ public final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldReque * (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagTemplateFieldRequest request = + * UpdateTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setTagTemplateField(TagTemplateField.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.updateTagTemplateFieldCallable().futureCall(request); + * // Do something. + * TagTemplateField response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateFieldName name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); + * String newTagTemplateFieldId = "newTagTemplateFieldId2008993953"; + * TagTemplateField response = + * dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * String newTagTemplateFieldId = "newTagTemplateFieldId2008993953"; + * TagTemplateField response = + * dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId); + * } + * }+ * * @param name Required. The name of the tag template. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * RenameTagTemplateFieldRequest request = + * RenameTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setNewTagTemplateFieldId("newTagTemplateFieldId2008993953") + * .build(); + * TagTemplateField response = dataCatalogClient.renameTagTemplateField(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 */ @@ -1583,6 +2575,22 @@ public final TagTemplateField renameTagTemplateField(RenameTagTemplateFieldReque * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * RenameTagTemplateFieldRequest request = + * RenameTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setNewTagTemplateFieldId("newTagTemplateFieldId2008993953") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.renameTagTemplateFieldCallable().futureCall(request); + * // Do something. + * TagTemplateField response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagTemplateFieldName name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); + * boolean force = true; + * dataCatalogClient.deleteTagTemplateField(name, force); + * } + * }+ * * @param name Required. The name of the tag template field to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString(); + * boolean force = true; + * dataCatalogClient.deleteTagTemplateField(name, force); + * } + * }+ * * @param name Required. The name of the tag template field to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateFieldRequest request = + * DeleteTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setForce(true) + * .build(); + * dataCatalogClient.deleteTagTemplateField(request); + * } + * }+ * * @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 */ @@ -1660,6 +2706,22 @@ public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request) * information). * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagTemplateFieldRequest request = + * DeleteTagTemplateFieldRequest.newBuilder() + * .setName( + * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") + * .toString()) + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataCatalogClient.deleteTagTemplateFieldCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TagName parent = TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]"); + * Tag tag = Tag.newBuilder().build(); + * Tag response = dataCatalogClient.createTag(parent, tag); + * } + * }+ * * @param parent Required. The name of the resource to attach this tag to. Tags can be attached to * Entries. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString(); + * Tag tag = Tag.newBuilder().build(); + * Tag response = dataCatalogClient.createTag(parent, tag); + * } + * }+ * * @param parent Required. The name of the resource to attach this tag to. Tags can be attached to * Entries. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagRequest request = + * CreateTagRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setTag(Tag.newBuilder().build()) + * .build(); + * Tag response = dataCatalogClient.createTag(request); + * } + * }+ * * @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 */ @@ -1744,6 +2842,21 @@ public final Tag createTag(CreateTagRequest request) { * used to create the tag must be from the same organization. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * CreateTagRequest request = + * CreateTagRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setTag(Tag.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.createTagCallable().futureCall(request); + * // Do something. + * Tag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * Tag tag = Tag.newBuilder().build(); + * Tag response = dataCatalogClient.updateTag(tag); + * } + * }+ * * @param tag Required. The updated tag. The "name" field must be set. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1765,6 +2887,16 @@ public final Tag updateTag(Tag tag) { /** * Updates an existing tag. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * Tag tag = Tag.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Tag response = dataCatalogClient.updateTag(tag, updateMask); + * } + * }+ * * @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`. @@ -1780,6 +2912,19 @@ public final Tag updateTag(Tag tag, FieldMask updateMask) { /** * Updates an existing tag. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagRequest request = + * UpdateTagRequest.newBuilder() + * .setTag(Tag.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * 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 */ @@ -1792,6 +2937,19 @@ public final Tag updateTag(UpdateTagRequest request) { * Updates an existing tag. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * UpdateTagRequest request = + * UpdateTagRequest.newBuilder() + * .setTag(Tag.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.updateTagCallable().futureCall(request); + * // Do something. + * Tag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * dataCatalogClient.deleteTag(name); + * } + * }+ * * @param name Required. The name of the tag to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String name = + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString(); + * dataCatalogClient.deleteTag(name); + * } + * }+ * * @param name Required. The name of the tag to delete. Example: *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagRequest request = + * DeleteTagRequest.newBuilder() + * .setName( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .build(); + * dataCatalogClient.deleteTag(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 */ @@ -1846,6 +3037,20 @@ public final void deleteTag(DeleteTagRequest request) { * Deletes a tag. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * DeleteTagRequest request = + * DeleteTagRequest.newBuilder() + * .setName( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.deleteTagCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); + * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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]. @@ -1876,6 +3092,18 @@ public final ListTagsPagedResponse listTags(EntryName parent) { /** * Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String parent = + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]").toString(); + * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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]. @@ -1896,6 +3124,24 @@ public final ListTagsPagedResponse listTags(String parent) { /** * Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListTagsRequest request = + * ListTagsRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Tag element : dataCatalogClient.listTags(request).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 */ @@ -1908,6 +3154,24 @@ public final ListTagsPagedResponse listTags(ListTagsRequest request) { * Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ListTagsRequest request = + * ListTagsRequest.newBuilder() + * .setParent( + * TagName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.listTagsPagedCallable().futureCall(request); + * // Do something. + * for (Tag element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * while (true) { + * ListTagsResponse response = dataCatalogClient.listTagsCallable().call(request); + * for (Tag element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ResourceName resource = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]"); + * 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 @@ -1961,6 +3252,16 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String resource = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString(); + * 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 @@ -1985,6 +3286,19 @@ public final Policy setIamPolicy(String resource, Policy policy) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * Policy response = dataCatalogClient.setIamPolicy(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 */ @@ -2004,6 +3318,19 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * ResourceName resource = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]"); + * 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 @@ -2049,6 +3385,15 @@ public final Policy getIamPolicy(ResourceName resource) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * String resource = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString(); + * 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 @@ -2072,6 +3417,19 @@ public final Policy getIamPolicy(String resource) { * 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: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * Policy response = dataCatalogClient.getIamPolicy(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 */ @@ -2094,6 +3452,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = dataCatalogClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
A caller is not required to have Google IAM permission to make this request. * + *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .addAllPermissions(new ArrayList+ * * @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 */ @@ -2129,6 +3513,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq *()) + * .build(); + * TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(request); + * } + * }
A caller is not required to have Google IAM permission to make this request. * *
Sample code: + * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .addAllPermissions(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * dataCatalogClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Taxonomy taxonomy = Taxonomy.newBuilder().build(); + * Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy); + * } + * }+ * *
Note: close() needs to be called on the PolicyTagManagerClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -155,6 +163,16 @@ public PolicyTagManagerStub getStub() { /** * Creates a taxonomy in the specified project. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 @@ -172,6 +190,16 @@ public final Taxonomy createTaxonomy(LocationName parent, Taxonomy taxonomy) { /** * Creates a taxonomy in the specified project. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString(); + * 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 @@ -186,6 +214,19 @@ public final Taxonomy createTaxonomy(String parent, Taxonomy taxonomy) { /** * Creates a taxonomy in the specified project. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * CreateTaxonomyRequest request = + * CreateTaxonomyRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setTaxonomy(Taxonomy.newBuilder().build()) + * .build(); + * Taxonomy response = policyTagManagerClient.createTaxonomy(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 */ @@ -198,6 +239,20 @@ public final Taxonomy createTaxonomy(CreateTaxonomyRequest request) { * Creates a taxonomy in the specified project. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * CreateTaxonomyRequest request = + * CreateTaxonomyRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setTaxonomy(Taxonomy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.createTaxonomyCallable().futureCall(request); + * // Do something. + * Taxonomy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 @@ -223,6 +287,15 @@ public final void deleteTaxonomy(TaxonomyName name) { * Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with * their associated policies. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString(); + * 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 @@ -237,6 +310,18 @@ public final void deleteTaxonomy(String name) { * Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with * their associated policies. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * DeleteTaxonomyRequest request = + * DeleteTaxonomyRequest.newBuilder() + * .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * policyTagManagerClient.deleteTaxonomy(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 */ @@ -250,6 +335,18 @@ public final void deleteTaxonomy(DeleteTaxonomyRequest request) { * their associated policies. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * DeleteTaxonomyRequest request = + * DeleteTaxonomyRequest.newBuilder() + * .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = policyTagManagerClient.deleteTaxonomyCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * Taxonomy taxonomy = Taxonomy.newBuilder().build(); + * Taxonomy response = policyTagManagerClient.updateTaxonomy(taxonomy); + * } + * }+ * * @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 @@ -273,6 +379,19 @@ public final Taxonomy updateTaxonomy(Taxonomy taxonomy) { /** * Updates a taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * UpdateTaxonomyRequest request = + * UpdateTaxonomyRequest.newBuilder() + * .setTaxonomy(Taxonomy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Taxonomy response = policyTagManagerClient.updateTaxonomy(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 */ @@ -285,6 +404,20 @@ public final Taxonomy updateTaxonomy(UpdateTaxonomyRequest request) { * Updates a taxonomy. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * UpdateTaxonomyRequest request = + * UpdateTaxonomyRequest.newBuilder() + * .setTaxonomy(Taxonomy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.updateTaxonomyCallable().futureCall(request); + * // Do something. + * Taxonomy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 */ @@ -311,6 +455,17 @@ public final ListTaxonomiesPagedResponse listTaxonomies(LocationName parent) { * Lists all taxonomies in a project in a particular location that the caller has permission to * view. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString(); + * 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 */ @@ -324,6 +479,22 @@ public final ListTaxonomiesPagedResponse listTaxonomies(String parent) { * Lists all taxonomies in a project in a particular location that the caller has permission to * view. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * ListTaxonomiesRequest request = + * ListTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Taxonomy element : policyTagManagerClient.listTaxonomies(request).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 */ @@ -337,6 +508,23 @@ public final ListTaxonomiesPagedResponse listTaxonomies(ListTaxonomiesRequest re * view. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * ListTaxonomiesRequest request = + * ListTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.listTaxonomiesPagedCallable().futureCall(request); + * // Do something. + * for (Taxonomy element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * while (true) { + * ListTaxonomiesResponse response = + * policyTagManagerClient.listTaxonomiesCallable().call(request); + * for (Taxonomy element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 */ @@ -372,6 +587,15 @@ public final Taxonomy getTaxonomy(TaxonomyName name) { /** * Gets a taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString(); + * 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 */ @@ -384,6 +608,18 @@ public final Taxonomy getTaxonomy(String name) { /** * Gets a taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * GetTaxonomyRequest request = + * GetTaxonomyRequest.newBuilder() + * .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * Taxonomy response = policyTagManagerClient.getTaxonomy(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 */ @@ -396,6 +632,18 @@ public final Taxonomy getTaxonomy(GetTaxonomyRequest request) { * Gets a taxonomy. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * GetTaxonomyRequest request = + * GetTaxonomyRequest.newBuilder() + * .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = policyTagManagerClient.getTaxonomyCallable().futureCall(request); + * // Do something. + * Taxonomy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 @@ -422,6 +680,17 @@ public final PolicyTag createPolicyTag(TaxonomyName parent, PolicyTag policyTag) /** * Creates a policy tag in the specified taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String parent = + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString(); + * 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 @@ -436,6 +705,21 @@ public final PolicyTag createPolicyTag(String parent, PolicyTag policyTag) { /** * Creates a policy tag in the specified taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * CreatePolicyTagRequest request = + * CreatePolicyTagRequest.newBuilder() + * .setParent( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .setPolicyTag(PolicyTag.newBuilder().build()) + * .build(); + * PolicyTag response = policyTagManagerClient.createPolicyTag(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 */ @@ -448,6 +732,22 @@ public final PolicyTag createPolicyTag(CreatePolicyTagRequest request) { * Creates a policy tag in the specified taxonomy. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * CreatePolicyTagRequest request = + * CreatePolicyTagRequest.newBuilder() + * .setParent( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .setPolicyTag(PolicyTag.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.createPolicyTagCallable().futureCall(request); + * // Do something. + * PolicyTag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 @@ -471,6 +781,16 @@ public final void deletePolicyTag(PolicyTagName name) { /** * Deletes a policy tag. Also deletes all of its descendant policy tags. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String name = + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString(); + * 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 @@ -484,6 +804,20 @@ public final void deletePolicyTag(String name) { /** * Deletes a policy tag. Also deletes all of its descendant policy tags. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * DeletePolicyTagRequest request = + * DeletePolicyTagRequest.newBuilder() + * .setName( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .build(); + * policyTagManagerClient.deletePolicyTag(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 */ @@ -496,6 +830,21 @@ public final void deletePolicyTag(DeletePolicyTagRequest request) { * Deletes a policy tag. Also deletes all of its descendant policy tags. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * DeletePolicyTagRequest request = + * DeletePolicyTagRequest.newBuilder() + * .setName( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.deletePolicyTagCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * PolicyTag policyTag = PolicyTag.newBuilder().build(); + * PolicyTag response = policyTagManagerClient.updatePolicyTag(policyTag); + * } + * }+ * * @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 @@ -519,6 +877,19 @@ public final PolicyTag updatePolicyTag(PolicyTag policyTag) { /** * Updates a policy tag. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * UpdatePolicyTagRequest request = + * UpdatePolicyTagRequest.newBuilder() + * .setPolicyTag(PolicyTag.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * PolicyTag response = policyTagManagerClient.updatePolicyTag(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 */ @@ -531,6 +902,20 @@ public final PolicyTag updatePolicyTag(UpdatePolicyTagRequest request) { * Updates a policy tag. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * UpdatePolicyTagRequest request = + * UpdatePolicyTagRequest.newBuilder() + * .setPolicyTag(PolicyTag.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.updatePolicyTagCallable().futureCall(request); + * // Do something. + * PolicyTag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 */ @@ -555,6 +951,18 @@ public final ListPolicyTagsPagedResponse listPolicyTags(TaxonomyName parent) { /** * Lists all policy tags in a taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String parent = + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString(); + * 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 */ @@ -567,6 +975,24 @@ public final ListPolicyTagsPagedResponse listPolicyTags(String parent) { /** * Lists all policy tags in a taxonomy. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * ListPolicyTagsRequest request = + * ListPolicyTagsRequest.newBuilder() + * .setParent( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (PolicyTag element : policyTagManagerClient.listPolicyTags(request).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 */ @@ -579,6 +1005,25 @@ public final ListPolicyTagsPagedResponse listPolicyTags(ListPolicyTagsRequest re * Lists all policy tags in a taxonomy. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * ListPolicyTagsRequest request = + * ListPolicyTagsRequest.newBuilder() + * .setParent( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.listPolicyTagsPagedCallable().futureCall(request); + * // Do something. + * for (PolicyTag element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * while (true) { + * ListPolicyTagsResponse response = + * policyTagManagerClient.listPolicyTagsCallable().call(request); + * for (PolicyTag element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * 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 */ @@ -613,6 +1086,16 @@ public final PolicyTag getPolicyTag(PolicyTagName name) { /** * Gets a policy tag. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * String name = + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString(); + * 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 */ @@ -625,6 +1108,20 @@ public final PolicyTag getPolicyTag(String name) { /** * Gets a policy tag. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * GetPolicyTagRequest request = + * GetPolicyTagRequest.newBuilder() + * .setName( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .build(); + * PolicyTag response = policyTagManagerClient.getPolicyTag(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 */ @@ -637,6 +1134,21 @@ public final PolicyTag getPolicyTag(GetPolicyTagRequest request) { * Gets a policy tag. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * GetPolicyTagRequest request = + * GetPolicyTagRequest.newBuilder() + * .setName( + * PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerClient.getPolicyTagCallable().futureCall(request); + * // Do something. + * PolicyTag response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * Policy response = policyTagManagerClient.getIamPolicy(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 */ @@ -658,6 +1183,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * Gets the IAM policy for a taxonomy or a policy tag. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = policyTagManagerClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * Policy response = policyTagManagerClient.setIamPolicy(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 */ @@ -679,6 +1230,19 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * Sets the IAM policy for a taxonomy or a policy tag. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = policyTagManagerClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .addAllPermissions(new ArrayList+ * * @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 */ @@ -700,6 +1277,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * Returns the permissions that a caller has on the specified taxonomy or policy tag. * *()) + * .build(); + * TestIamPermissionsResponse response = policyTagManagerClient.testIamPermissions(request); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .addAllPermissions(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * policyTagManagerClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = + * PolicyTagManagerSerializationClient.create()) { + * ImportTaxonomiesRequest request = + * ImportTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * ImportTaxonomiesResponse response = + * policyTagManagerSerializationClient.importTaxonomies(request); + * } + * }+ * *
Note: close() needs to be called on the PolicyTagManagerSerializationClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -146,6 +158,20 @@ public PolicyTagManagerSerializationStub getStub() { * *
This method provides a bulk taxonomy / policy tag creation using nested proto structure. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = + * PolicyTagManagerSerializationClient.create()) { + * ImportTaxonomiesRequest request = + * ImportTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * ImportTaxonomiesResponse response = + * policyTagManagerSerializationClient.importTaxonomies(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 */ @@ -160,6 +186,20 @@ public final ImportTaxonomiesResponse importTaxonomies(ImportTaxonomiesRequest r *
This method provides a bulk taxonomy / policy tag creation using nested proto structure. * *
Sample code: + * + *
{@code + * try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = + * PolicyTagManagerSerializationClient.create()) { + * ImportTaxonomiesRequest request = + * ImportTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * policyTagManagerSerializationClient.importTaxonomiesCallable().futureCall(request); + * // Do something. + * ImportTaxonomiesResponse response = future.get(); + * } + * }
This method generates SerializedTaxonomy protos with nested policy tags that can be used as * an input for future ImportTaxonomies calls. * + *
Sample code: + * + *
{@code + * try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = + * PolicyTagManagerSerializationClient.create()) { + * ExportTaxonomiesRequest request = + * ExportTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .addAllTaxonomies(new ArrayList+ * * @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 */ @@ -188,6 +243,21 @@ public final ExportTaxonomiesResponse exportTaxonomies(ExportTaxonomiesRequest r * an input for future ImportTaxonomies calls. * *()) + * .build(); + * ExportTaxonomiesResponse response = + * policyTagManagerSerializationClient.exportTaxonomies(request); + * } + * }
Sample code: + * + *
{@code + * try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = + * PolicyTagManagerSerializationClient.create()) { + * ExportTaxonomiesRequest request = + * ExportTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .addAllTaxonomies(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * policyTagManagerSerializationClient.exportTaxonomiesCallable().futureCall(request); + * // Do something. + * ExportTaxonomiesResponse response = future.get(); + * } + * }
Sample for DataCatalogClient: * + *
{@code + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String entryGroupId = "entryGroupId1228924712"; + * EntryGroup entryGroup = EntryGroup.newBuilder().build(); + * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); + * } + * }+ * *
======================= PolicyTagManagerClient ======================= * *
Service Description: The policy tag manager API service allows clients to manage their @@ -31,12 +40,32 @@ * *
Sample for PolicyTagManagerClient: * + *
{@code + * try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Taxonomy taxonomy = Taxonomy.newBuilder().build(); + * Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy); + * } + * }+ * *
======================= PolicyTagManagerSerializationClient ======================= * *
Service Description: Policy tag manager serialization API service allows clients to manipulate * their taxonomies and policy tags data with serialized format. * *
Sample for PolicyTagManagerSerializationClient: + * + *
{@code + * try (PolicyTagManagerSerializationClient policyTagManagerSerializationClient = + * PolicyTagManagerSerializationClient.create()) { + * ImportTaxonomiesRequest request = + * ImportTaxonomiesRequest.newBuilder() + * .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString()) + * .build(); + * ImportTaxonomiesResponse response = + * policyTagManagerSerializationClient.importTaxonomies(request); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.datacatalog.v1beta1; diff --git a/synth.metadata b/synth.metadata index c699241e..fa4d8cce 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-datacatalog.git", - "sha": "754c24ce407650ac73e5c493c0b8c29516dc3dfa" + "sha": "175f1f67f58690415545a249d45b44797bc19e39" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {