1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.cloud.datacatalog.v1; 18 19 import com.google.api.core.ApiFuture; 20 import com.google.api.core.ApiFutures; 21 import com.google.api.core.BetaApi; 22 import com.google.api.gax.core.BackgroundResource; 23 import com.google.api.gax.httpjson.longrunning.OperationsClient; 24 import com.google.api.gax.longrunning.OperationFuture; 25 import com.google.api.gax.paging.AbstractFixedSizeCollection; 26 import com.google.api.gax.paging.AbstractPage; 27 import com.google.api.gax.paging.AbstractPagedListResponse; 28 import com.google.api.gax.rpc.OperationCallable; 29 import com.google.api.gax.rpc.PageContext; 30 import com.google.api.gax.rpc.UnaryCallable; 31 import com.google.api.resourcenames.ResourceName; 32 import com.google.cloud.datacatalog.v1.stub.DataCatalogStub; 33 import com.google.cloud.datacatalog.v1.stub.DataCatalogStubSettings; 34 import com.google.common.util.concurrent.MoreExecutors; 35 import com.google.iam.v1.GetIamPolicyRequest; 36 import com.google.iam.v1.Policy; 37 import com.google.iam.v1.SetIamPolicyRequest; 38 import com.google.iam.v1.TestIamPermissionsRequest; 39 import com.google.iam.v1.TestIamPermissionsResponse; 40 import com.google.longrunning.Operation; 41 import com.google.protobuf.Empty; 42 import com.google.protobuf.FieldMask; 43 import java.io.IOException; 44 import java.util.List; 45 import java.util.concurrent.TimeUnit; 46 import javax.annotation.Generated; 47 48 // AUTO-GENERATED DOCUMENTATION AND CLASS. 49 /** 50 * Service Description: Data Catalog API service allows you to discover, understand, and manage your 51 * data. 52 * 53 * <p>This class provides the ability to make remote calls to the backing service through method 54 * calls that map to API methods. Sample code to get started: 55 * 56 * <pre>{@code 57 * // This snippet has been automatically generated and should be regarded as a code template only. 58 * // It will require modifications to work: 59 * // - It may require correct/in-range values for request initialization. 60 * // - It may require specifying regional endpoints when creating the service client as shown in 61 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 62 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 63 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 64 * String entryGroupId = "entryGroupId1228924712"; 65 * EntryGroup entryGroup = EntryGroup.newBuilder().build(); 66 * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); 67 * } 68 * }</pre> 69 * 70 * <p>Note: close() needs to be called on the DataCatalogClient object to clean up resources such as 71 * threads. In the example above, try-with-resources is used, which automatically calls close(). 72 * 73 * <p>The surface of this class includes several types of Java methods for each of the API's 74 * methods: 75 * 76 * <ol> 77 * <li>A "flattened" method. With this type of method, the fields of the request type have been 78 * converted into function parameters. It may be the case that not all fields are available as 79 * parameters, and not every API method will have a flattened method entry point. 80 * <li>A "request object" method. This type of method only takes one parameter, a request object, 81 * which must be constructed before the call. Not every API method will have a request object 82 * method. 83 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 84 * callable object, which can be used to initiate calls to the service. 85 * </ol> 86 * 87 * <p>See the individual methods for example code. 88 * 89 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 90 * these names, this class includes a format method for each type of name, and additionally a parse 91 * method to extract the individual identifiers contained within names that are returned. 92 * 93 * <p>This class can be customized by passing in a custom instance of DataCatalogSettings to 94 * create(). For example: 95 * 96 * <p>To customize credentials: 97 * 98 * <pre>{@code 99 * // This snippet has been automatically generated and should be regarded as a code template only. 100 * // It will require modifications to work: 101 * // - It may require correct/in-range values for request initialization. 102 * // - It may require specifying regional endpoints when creating the service client as shown in 103 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 104 * DataCatalogSettings dataCatalogSettings = 105 * DataCatalogSettings.newBuilder() 106 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 107 * .build(); 108 * DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings); 109 * }</pre> 110 * 111 * <p>To customize the endpoint: 112 * 113 * <pre>{@code 114 * // This snippet has been automatically generated and should be regarded as a code template only. 115 * // It will require modifications to work: 116 * // - It may require correct/in-range values for request initialization. 117 * // - It may require specifying regional endpoints when creating the service client as shown in 118 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 119 * DataCatalogSettings dataCatalogSettings = 120 * DataCatalogSettings.newBuilder().setEndpoint(myEndpoint).build(); 121 * DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings); 122 * }</pre> 123 * 124 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 125 * the wire: 126 * 127 * <pre>{@code 128 * // This snippet has been automatically generated and should be regarded as a code template only. 129 * // It will require modifications to work: 130 * // - It may require correct/in-range values for request initialization. 131 * // - It may require specifying regional endpoints when creating the service client as shown in 132 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 133 * DataCatalogSettings dataCatalogSettings = DataCatalogSettings.newHttpJsonBuilder().build(); 134 * DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings); 135 * }</pre> 136 * 137 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 138 */ 139 @Generated("by gapic-generator-java") 140 public class DataCatalogClient implements BackgroundResource { 141 private final DataCatalogSettings settings; 142 private final DataCatalogStub stub; 143 private final OperationsClient httpJsonOperationsClient; 144 private final com.google.longrunning.OperationsClient operationsClient; 145 146 /** Constructs an instance of DataCatalogClient with default settings. */ create()147 public static final DataCatalogClient create() throws IOException { 148 return create(DataCatalogSettings.newBuilder().build()); 149 } 150 151 /** 152 * Constructs an instance of DataCatalogClient, using the given settings. The channels are created 153 * based on the settings passed in, or defaults for any settings that are not set. 154 */ create(DataCatalogSettings settings)155 public static final DataCatalogClient create(DataCatalogSettings settings) throws IOException { 156 return new DataCatalogClient(settings); 157 } 158 159 /** 160 * Constructs an instance of DataCatalogClient, using the given stub for making calls. This is for 161 * advanced usage - prefer using create(DataCatalogSettings). 162 */ create(DataCatalogStub stub)163 public static final DataCatalogClient create(DataCatalogStub stub) { 164 return new DataCatalogClient(stub); 165 } 166 167 /** 168 * Constructs an instance of DataCatalogClient, using the given settings. This is protected so 169 * that it is easy to make a subclass, but otherwise, the static factory methods should be 170 * preferred. 171 */ DataCatalogClient(DataCatalogSettings settings)172 protected DataCatalogClient(DataCatalogSettings settings) throws IOException { 173 this.settings = settings; 174 this.stub = ((DataCatalogStubSettings) settings.getStubSettings()).createStub(); 175 this.operationsClient = 176 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 177 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 178 } 179 DataCatalogClient(DataCatalogStub stub)180 protected DataCatalogClient(DataCatalogStub stub) { 181 this.settings = null; 182 this.stub = stub; 183 this.operationsClient = 184 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 185 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 186 } 187 getSettings()188 public final DataCatalogSettings getSettings() { 189 return settings; 190 } 191 getStub()192 public DataCatalogStub getStub() { 193 return stub; 194 } 195 196 /** 197 * Returns the OperationsClient that can be used to query the status of a long-running operation 198 * returned by another API method call. 199 */ getOperationsClient()200 public final com.google.longrunning.OperationsClient getOperationsClient() { 201 return operationsClient; 202 } 203 204 /** 205 * Returns the OperationsClient that can be used to query the status of a long-running operation 206 * returned by another API method call. 207 */ 208 @BetaApi getHttpJsonOperationsClient()209 public final OperationsClient getHttpJsonOperationsClient() { 210 return httpJsonOperationsClient; 211 } 212 213 // AUTO-GENERATED DOCUMENTATION AND METHOD. 214 /** 215 * Searches Data Catalog for multiple resources like entries and tags that match a query. 216 * 217 * <p>This is a [Custom Method] (https://cloud.google.com/apis/design/custom_methods) that doesn't 218 * return all information on a resource, only its ID and high level fields. To get more 219 * information, you can subsequently call specific get methods. 220 * 221 * <p>Note: Data Catalog search queries don't guarantee full recall. Results that match your query 222 * might not be returned, even in subsequent result pages. Additionally, returned (and not 223 * returned) results can vary if you repeat search queries. 224 * 225 * <p>For more information, see [Data Catalog search syntax] 226 * (https://cloud.google.com/data-catalog/docs/how-to/search-reference). 227 * 228 * <p>Sample code: 229 * 230 * <pre>{@code 231 * // This snippet has been automatically generated and should be regarded as a code template only. 232 * // It will require modifications to work: 233 * // - It may require correct/in-range values for request initialization. 234 * // - It may require specifying regional endpoints when creating the service client as shown in 235 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 236 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 237 * SearchCatalogRequest.Scope scope = SearchCatalogRequest.Scope.newBuilder().build(); 238 * String query = "query107944136"; 239 * for (SearchCatalogResult element : 240 * dataCatalogClient.searchCatalog(scope, query).iterateAll()) { 241 * // doThingsWith(element); 242 * } 243 * } 244 * }</pre> 245 * 246 * @param scope Required. The scope of this search request. 247 * <p>The `scope` is invalid if `include_org_ids`, `include_project_ids` are empty AND 248 * `include_gcp_public_datasets` is set to `false`. In this case, the request returns an 249 * error. 250 * @param query Optional. The query string with a minimum of 3 characters and specific syntax. For 251 * more information, see [Data Catalog search 252 * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). 253 * <p>An empty query string returns all data assets (in the specified scope) that you have 254 * access to. 255 * <p>A query string can be a simple `xyz` or qualified by predicates: 256 * <ul> 257 * <li>`name:x` 258 * <li>`column:y` 259 * <li>`description:z` 260 * </ul> 261 * 262 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 263 */ searchCatalog( SearchCatalogRequest.Scope scope, String query)264 public final SearchCatalogPagedResponse searchCatalog( 265 SearchCatalogRequest.Scope scope, String query) { 266 SearchCatalogRequest request = 267 SearchCatalogRequest.newBuilder().setScope(scope).setQuery(query).build(); 268 return searchCatalog(request); 269 } 270 271 // AUTO-GENERATED DOCUMENTATION AND METHOD. 272 /** 273 * Searches Data Catalog for multiple resources like entries and tags that match a query. 274 * 275 * <p>This is a [Custom Method] (https://cloud.google.com/apis/design/custom_methods) that doesn't 276 * return all information on a resource, only its ID and high level fields. To get more 277 * information, you can subsequently call specific get methods. 278 * 279 * <p>Note: Data Catalog search queries don't guarantee full recall. Results that match your query 280 * might not be returned, even in subsequent result pages. Additionally, returned (and not 281 * returned) results can vary if you repeat search queries. 282 * 283 * <p>For more information, see [Data Catalog search syntax] 284 * (https://cloud.google.com/data-catalog/docs/how-to/search-reference). 285 * 286 * <p>Sample code: 287 * 288 * <pre>{@code 289 * // This snippet has been automatically generated and should be regarded as a code template only. 290 * // It will require modifications to work: 291 * // - It may require correct/in-range values for request initialization. 292 * // - It may require specifying regional endpoints when creating the service client as shown in 293 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 294 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 295 * SearchCatalogRequest request = 296 * SearchCatalogRequest.newBuilder() 297 * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) 298 * .setQuery("query107944136") 299 * .setPageSize(883849137) 300 * .setPageToken("pageToken873572522") 301 * .setOrderBy("orderBy-1207110587") 302 * .build(); 303 * for (SearchCatalogResult element : dataCatalogClient.searchCatalog(request).iterateAll()) { 304 * // doThingsWith(element); 305 * } 306 * } 307 * }</pre> 308 * 309 * @param request The request object containing all of the parameters for the API call. 310 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 311 */ searchCatalog(SearchCatalogRequest request)312 public final SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest request) { 313 return searchCatalogPagedCallable().call(request); 314 } 315 316 // AUTO-GENERATED DOCUMENTATION AND METHOD. 317 /** 318 * Searches Data Catalog for multiple resources like entries and tags that match a query. 319 * 320 * <p>This is a [Custom Method] (https://cloud.google.com/apis/design/custom_methods) that doesn't 321 * return all information on a resource, only its ID and high level fields. To get more 322 * information, you can subsequently call specific get methods. 323 * 324 * <p>Note: Data Catalog search queries don't guarantee full recall. Results that match your query 325 * might not be returned, even in subsequent result pages. Additionally, returned (and not 326 * returned) results can vary if you repeat search queries. 327 * 328 * <p>For more information, see [Data Catalog search syntax] 329 * (https://cloud.google.com/data-catalog/docs/how-to/search-reference). 330 * 331 * <p>Sample code: 332 * 333 * <pre>{@code 334 * // This snippet has been automatically generated and should be regarded as a code template only. 335 * // It will require modifications to work: 336 * // - It may require correct/in-range values for request initialization. 337 * // - It may require specifying regional endpoints when creating the service client as shown in 338 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 339 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 340 * SearchCatalogRequest request = 341 * SearchCatalogRequest.newBuilder() 342 * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) 343 * .setQuery("query107944136") 344 * .setPageSize(883849137) 345 * .setPageToken("pageToken873572522") 346 * .setOrderBy("orderBy-1207110587") 347 * .build(); 348 * ApiFuture<SearchCatalogResult> future = 349 * dataCatalogClient.searchCatalogPagedCallable().futureCall(request); 350 * // Do something. 351 * for (SearchCatalogResult element : future.get().iterateAll()) { 352 * // doThingsWith(element); 353 * } 354 * } 355 * }</pre> 356 */ 357 public final UnaryCallable<SearchCatalogRequest, SearchCatalogPagedResponse> searchCatalogPagedCallable()358 searchCatalogPagedCallable() { 359 return stub.searchCatalogPagedCallable(); 360 } 361 362 // AUTO-GENERATED DOCUMENTATION AND METHOD. 363 /** 364 * Searches Data Catalog for multiple resources like entries and tags that match a query. 365 * 366 * <p>This is a [Custom Method] (https://cloud.google.com/apis/design/custom_methods) that doesn't 367 * return all information on a resource, only its ID and high level fields. To get more 368 * information, you can subsequently call specific get methods. 369 * 370 * <p>Note: Data Catalog search queries don't guarantee full recall. Results that match your query 371 * might not be returned, even in subsequent result pages. Additionally, returned (and not 372 * returned) results can vary if you repeat search queries. 373 * 374 * <p>For more information, see [Data Catalog search syntax] 375 * (https://cloud.google.com/data-catalog/docs/how-to/search-reference). 376 * 377 * <p>Sample code: 378 * 379 * <pre>{@code 380 * // This snippet has been automatically generated and should be regarded as a code template only. 381 * // It will require modifications to work: 382 * // - It may require correct/in-range values for request initialization. 383 * // - It may require specifying regional endpoints when creating the service client as shown in 384 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 385 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 386 * SearchCatalogRequest request = 387 * SearchCatalogRequest.newBuilder() 388 * .setScope(SearchCatalogRequest.Scope.newBuilder().build()) 389 * .setQuery("query107944136") 390 * .setPageSize(883849137) 391 * .setPageToken("pageToken873572522") 392 * .setOrderBy("orderBy-1207110587") 393 * .build(); 394 * while (true) { 395 * SearchCatalogResponse response = dataCatalogClient.searchCatalogCallable().call(request); 396 * for (SearchCatalogResult element : response.getResultsList()) { 397 * // doThingsWith(element); 398 * } 399 * String nextPageToken = response.getNextPageToken(); 400 * if (!Strings.isNullOrEmpty(nextPageToken)) { 401 * request = request.toBuilder().setPageToken(nextPageToken).build(); 402 * } else { 403 * break; 404 * } 405 * } 406 * } 407 * }</pre> 408 */ searchCatalogCallable()409 public final UnaryCallable<SearchCatalogRequest, SearchCatalogResponse> searchCatalogCallable() { 410 return stub.searchCatalogCallable(); 411 } 412 413 // AUTO-GENERATED DOCUMENTATION AND METHOD. 414 /** 415 * Creates an entry group. 416 * 417 * <p>An entry group contains logically related entries together with [Cloud Identity and Access 418 * Management](/data-catalog/docs/concepts/iam) policies. These policies specify users who can 419 * create, edit, and view entries within entry groups. 420 * 421 * <p>Data Catalog automatically creates entry groups with names that start with the 422 * `{@literal @}` symbol for the following resources: 423 * 424 * <ul> 425 * <li>BigQuery entries (`{@literal @}bigquery`) 426 * <li>Pub/Sub topics (`{@literal @}pubsub`) 427 * <li>Dataproc Metastore services (`{@literal @}dataproc_metastore_{SERVICE_NAME_HASH}`) 428 * </ul> 429 * 430 * <p>You can create your own entry groups for Cloud Storage fileset entries and custom entries 431 * together with the corresponding IAM policies. User-created entry groups can't contain the 432 * `{@literal @}` symbol, it is reserved for automatically created groups. 433 * 434 * <p>Entry groups, like entries, can be searched. 435 * 436 * <p>A maximum of 10,000 entry groups may be created per organization across all locations. 437 * 438 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 439 * For more information, see [Data Catalog resource 440 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 441 * 442 * <p>Sample code: 443 * 444 * <pre>{@code 445 * // This snippet has been automatically generated and should be regarded as a code template only. 446 * // It will require modifications to work: 447 * // - It may require correct/in-range values for request initialization. 448 * // - It may require specifying regional endpoints when creating the service client as shown in 449 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 450 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 451 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 452 * String entryGroupId = "entryGroupId1228924712"; 453 * EntryGroup entryGroup = EntryGroup.newBuilder().build(); 454 * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); 455 * } 456 * }</pre> 457 * 458 * @param parent Required. The names of the project and location that the new entry group belongs 459 * to. 460 * <p>Note: The entry group itself and its child resources might not be stored in the location 461 * specified in its name. 462 * @param entryGroupId Required. The ID of the entry group to create. 463 * <p>The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and must 464 * start with a letter or underscore. The maximum size is 64 bytes when encoded in UTF-8. 465 * @param entryGroup The entry group to create. Defaults to empty. 466 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 467 */ createEntryGroup( LocationName parent, String entryGroupId, EntryGroup entryGroup)468 public final EntryGroup createEntryGroup( 469 LocationName parent, String entryGroupId, EntryGroup entryGroup) { 470 CreateEntryGroupRequest request = 471 CreateEntryGroupRequest.newBuilder() 472 .setParent(parent == null ? null : parent.toString()) 473 .setEntryGroupId(entryGroupId) 474 .setEntryGroup(entryGroup) 475 .build(); 476 return createEntryGroup(request); 477 } 478 479 // AUTO-GENERATED DOCUMENTATION AND METHOD. 480 /** 481 * Creates an entry group. 482 * 483 * <p>An entry group contains logically related entries together with [Cloud Identity and Access 484 * Management](/data-catalog/docs/concepts/iam) policies. These policies specify users who can 485 * create, edit, and view entries within entry groups. 486 * 487 * <p>Data Catalog automatically creates entry groups with names that start with the 488 * `{@literal @}` symbol for the following resources: 489 * 490 * <ul> 491 * <li>BigQuery entries (`{@literal @}bigquery`) 492 * <li>Pub/Sub topics (`{@literal @}pubsub`) 493 * <li>Dataproc Metastore services (`{@literal @}dataproc_metastore_{SERVICE_NAME_HASH}`) 494 * </ul> 495 * 496 * <p>You can create your own entry groups for Cloud Storage fileset entries and custom entries 497 * together with the corresponding IAM policies. User-created entry groups can't contain the 498 * `{@literal @}` symbol, it is reserved for automatically created groups. 499 * 500 * <p>Entry groups, like entries, can be searched. 501 * 502 * <p>A maximum of 10,000 entry groups may be created per organization across all locations. 503 * 504 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 505 * For more information, see [Data Catalog resource 506 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 507 * 508 * <p>Sample code: 509 * 510 * <pre>{@code 511 * // This snippet has been automatically generated and should be regarded as a code template only. 512 * // It will require modifications to work: 513 * // - It may require correct/in-range values for request initialization. 514 * // - It may require specifying regional endpoints when creating the service client as shown in 515 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 516 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 517 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 518 * String entryGroupId = "entryGroupId1228924712"; 519 * EntryGroup entryGroup = EntryGroup.newBuilder().build(); 520 * EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup); 521 * } 522 * }</pre> 523 * 524 * @param parent Required. The names of the project and location that the new entry group belongs 525 * to. 526 * <p>Note: The entry group itself and its child resources might not be stored in the location 527 * specified in its name. 528 * @param entryGroupId Required. The ID of the entry group to create. 529 * <p>The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and must 530 * start with a letter or underscore. The maximum size is 64 bytes when encoded in UTF-8. 531 * @param entryGroup The entry group to create. Defaults to empty. 532 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 533 */ createEntryGroup( String parent, String entryGroupId, EntryGroup entryGroup)534 public final EntryGroup createEntryGroup( 535 String parent, String entryGroupId, EntryGroup entryGroup) { 536 CreateEntryGroupRequest request = 537 CreateEntryGroupRequest.newBuilder() 538 .setParent(parent) 539 .setEntryGroupId(entryGroupId) 540 .setEntryGroup(entryGroup) 541 .build(); 542 return createEntryGroup(request); 543 } 544 545 // AUTO-GENERATED DOCUMENTATION AND METHOD. 546 /** 547 * Creates an entry group. 548 * 549 * <p>An entry group contains logically related entries together with [Cloud Identity and Access 550 * Management](/data-catalog/docs/concepts/iam) policies. These policies specify users who can 551 * create, edit, and view entries within entry groups. 552 * 553 * <p>Data Catalog automatically creates entry groups with names that start with the 554 * `{@literal @}` symbol for the following resources: 555 * 556 * <ul> 557 * <li>BigQuery entries (`{@literal @}bigquery`) 558 * <li>Pub/Sub topics (`{@literal @}pubsub`) 559 * <li>Dataproc Metastore services (`{@literal @}dataproc_metastore_{SERVICE_NAME_HASH}`) 560 * </ul> 561 * 562 * <p>You can create your own entry groups for Cloud Storage fileset entries and custom entries 563 * together with the corresponding IAM policies. User-created entry groups can't contain the 564 * `{@literal @}` symbol, it is reserved for automatically created groups. 565 * 566 * <p>Entry groups, like entries, can be searched. 567 * 568 * <p>A maximum of 10,000 entry groups may be created per organization across all locations. 569 * 570 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 571 * For more information, see [Data Catalog resource 572 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 573 * 574 * <p>Sample code: 575 * 576 * <pre>{@code 577 * // This snippet has been automatically generated and should be regarded as a code template only. 578 * // It will require modifications to work: 579 * // - It may require correct/in-range values for request initialization. 580 * // - It may require specifying regional endpoints when creating the service client as shown in 581 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 582 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 583 * CreateEntryGroupRequest request = 584 * CreateEntryGroupRequest.newBuilder() 585 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 586 * .setEntryGroupId("entryGroupId1228924712") 587 * .setEntryGroup(EntryGroup.newBuilder().build()) 588 * .build(); 589 * EntryGroup response = dataCatalogClient.createEntryGroup(request); 590 * } 591 * }</pre> 592 * 593 * @param request The request object containing all of the parameters for the API call. 594 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 595 */ createEntryGroup(CreateEntryGroupRequest request)596 public final EntryGroup createEntryGroup(CreateEntryGroupRequest request) { 597 return createEntryGroupCallable().call(request); 598 } 599 600 // AUTO-GENERATED DOCUMENTATION AND METHOD. 601 /** 602 * Creates an entry group. 603 * 604 * <p>An entry group contains logically related entries together with [Cloud Identity and Access 605 * Management](/data-catalog/docs/concepts/iam) policies. These policies specify users who can 606 * create, edit, and view entries within entry groups. 607 * 608 * <p>Data Catalog automatically creates entry groups with names that start with the 609 * `{@literal @}` symbol for the following resources: 610 * 611 * <ul> 612 * <li>BigQuery entries (`{@literal @}bigquery`) 613 * <li>Pub/Sub topics (`{@literal @}pubsub`) 614 * <li>Dataproc Metastore services (`{@literal @}dataproc_metastore_{SERVICE_NAME_HASH}`) 615 * </ul> 616 * 617 * <p>You can create your own entry groups for Cloud Storage fileset entries and custom entries 618 * together with the corresponding IAM policies. User-created entry groups can't contain the 619 * `{@literal @}` symbol, it is reserved for automatically created groups. 620 * 621 * <p>Entry groups, like entries, can be searched. 622 * 623 * <p>A maximum of 10,000 entry groups may be created per organization across all locations. 624 * 625 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 626 * For more information, see [Data Catalog resource 627 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 628 * 629 * <p>Sample code: 630 * 631 * <pre>{@code 632 * // This snippet has been automatically generated and should be regarded as a code template only. 633 * // It will require modifications to work: 634 * // - It may require correct/in-range values for request initialization. 635 * // - It may require specifying regional endpoints when creating the service client as shown in 636 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 637 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 638 * CreateEntryGroupRequest request = 639 * CreateEntryGroupRequest.newBuilder() 640 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 641 * .setEntryGroupId("entryGroupId1228924712") 642 * .setEntryGroup(EntryGroup.newBuilder().build()) 643 * .build(); 644 * ApiFuture<EntryGroup> future = 645 * dataCatalogClient.createEntryGroupCallable().futureCall(request); 646 * // Do something. 647 * EntryGroup response = future.get(); 648 * } 649 * }</pre> 650 */ createEntryGroupCallable()651 public final UnaryCallable<CreateEntryGroupRequest, EntryGroup> createEntryGroupCallable() { 652 return stub.createEntryGroupCallable(); 653 } 654 655 // AUTO-GENERATED DOCUMENTATION AND METHOD. 656 /** 657 * Gets an entry group. 658 * 659 * <p>Sample code: 660 * 661 * <pre>{@code 662 * // This snippet has been automatically generated and should be regarded as a code template only. 663 * // It will require modifications to work: 664 * // - It may require correct/in-range values for request initialization. 665 * // - It may require specifying regional endpoints when creating the service client as shown in 666 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 667 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 668 * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); 669 * EntryGroup response = dataCatalogClient.getEntryGroup(name); 670 * } 671 * }</pre> 672 * 673 * @param name Required. The name of the entry group to get. 674 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 675 */ getEntryGroup(EntryGroupName name)676 public final EntryGroup getEntryGroup(EntryGroupName name) { 677 GetEntryGroupRequest request = 678 GetEntryGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 679 return getEntryGroup(request); 680 } 681 682 // AUTO-GENERATED DOCUMENTATION AND METHOD. 683 /** 684 * Gets an entry group. 685 * 686 * <p>Sample code: 687 * 688 * <pre>{@code 689 * // This snippet has been automatically generated and should be regarded as a code template only. 690 * // It will require modifications to work: 691 * // - It may require correct/in-range values for request initialization. 692 * // - It may require specifying regional endpoints when creating the service client as shown in 693 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 694 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 695 * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); 696 * EntryGroup response = dataCatalogClient.getEntryGroup(name); 697 * } 698 * }</pre> 699 * 700 * @param name Required. The name of the entry group to get. 701 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 702 */ getEntryGroup(String name)703 public final EntryGroup getEntryGroup(String name) { 704 GetEntryGroupRequest request = GetEntryGroupRequest.newBuilder().setName(name).build(); 705 return getEntryGroup(request); 706 } 707 708 // AUTO-GENERATED DOCUMENTATION AND METHOD. 709 /** 710 * Gets an entry group. 711 * 712 * <p>Sample code: 713 * 714 * <pre>{@code 715 * // This snippet has been automatically generated and should be regarded as a code template only. 716 * // It will require modifications to work: 717 * // - It may require correct/in-range values for request initialization. 718 * // - It may require specifying regional endpoints when creating the service client as shown in 719 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 720 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 721 * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); 722 * FieldMask readMask = FieldMask.newBuilder().build(); 723 * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask); 724 * } 725 * }</pre> 726 * 727 * @param name Required. The name of the entry group to get. 728 * @param readMask The fields to return. If empty or omitted, all fields are returned. 729 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 730 */ getEntryGroup(EntryGroupName name, FieldMask readMask)731 public final EntryGroup getEntryGroup(EntryGroupName name, FieldMask readMask) { 732 GetEntryGroupRequest request = 733 GetEntryGroupRequest.newBuilder() 734 .setName(name == null ? null : name.toString()) 735 .setReadMask(readMask) 736 .build(); 737 return getEntryGroup(request); 738 } 739 740 // AUTO-GENERATED DOCUMENTATION AND METHOD. 741 /** 742 * Gets an entry group. 743 * 744 * <p>Sample code: 745 * 746 * <pre>{@code 747 * // This snippet has been automatically generated and should be regarded as a code template only. 748 * // It will require modifications to work: 749 * // - It may require correct/in-range values for request initialization. 750 * // - It may require specifying regional endpoints when creating the service client as shown in 751 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 752 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 753 * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); 754 * FieldMask readMask = FieldMask.newBuilder().build(); 755 * EntryGroup response = dataCatalogClient.getEntryGroup(name, readMask); 756 * } 757 * }</pre> 758 * 759 * @param name Required. The name of the entry group to get. 760 * @param readMask The fields to return. If empty or omitted, all fields are returned. 761 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 762 */ getEntryGroup(String name, FieldMask readMask)763 public final EntryGroup getEntryGroup(String name, FieldMask readMask) { 764 GetEntryGroupRequest request = 765 GetEntryGroupRequest.newBuilder().setName(name).setReadMask(readMask).build(); 766 return getEntryGroup(request); 767 } 768 769 // AUTO-GENERATED DOCUMENTATION AND METHOD. 770 /** 771 * Gets an entry group. 772 * 773 * <p>Sample code: 774 * 775 * <pre>{@code 776 * // This snippet has been automatically generated and should be regarded as a code template only. 777 * // It will require modifications to work: 778 * // - It may require correct/in-range values for request initialization. 779 * // - It may require specifying regional endpoints when creating the service client as shown in 780 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 781 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 782 * GetEntryGroupRequest request = 783 * GetEntryGroupRequest.newBuilder() 784 * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 785 * .setReadMask(FieldMask.newBuilder().build()) 786 * .build(); 787 * EntryGroup response = dataCatalogClient.getEntryGroup(request); 788 * } 789 * }</pre> 790 * 791 * @param request The request object containing all of the parameters for the API call. 792 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 793 */ getEntryGroup(GetEntryGroupRequest request)794 public final EntryGroup getEntryGroup(GetEntryGroupRequest request) { 795 return getEntryGroupCallable().call(request); 796 } 797 798 // AUTO-GENERATED DOCUMENTATION AND METHOD. 799 /** 800 * Gets an entry group. 801 * 802 * <p>Sample code: 803 * 804 * <pre>{@code 805 * // This snippet has been automatically generated and should be regarded as a code template only. 806 * // It will require modifications to work: 807 * // - It may require correct/in-range values for request initialization. 808 * // - It may require specifying regional endpoints when creating the service client as shown in 809 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 810 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 811 * GetEntryGroupRequest request = 812 * GetEntryGroupRequest.newBuilder() 813 * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 814 * .setReadMask(FieldMask.newBuilder().build()) 815 * .build(); 816 * ApiFuture<EntryGroup> future = dataCatalogClient.getEntryGroupCallable().futureCall(request); 817 * // Do something. 818 * EntryGroup response = future.get(); 819 * } 820 * }</pre> 821 */ getEntryGroupCallable()822 public final UnaryCallable<GetEntryGroupRequest, EntryGroup> getEntryGroupCallable() { 823 return stub.getEntryGroupCallable(); 824 } 825 826 // AUTO-GENERATED DOCUMENTATION AND METHOD. 827 /** 828 * Updates an entry group. 829 * 830 * <p>You must enable the Data Catalog API in the project identified by the `entry_group.name` 831 * parameter. For more information, see [Data Catalog resource 832 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 833 * 834 * <p>Sample code: 835 * 836 * <pre>{@code 837 * // This snippet has been automatically generated and should be regarded as a code template only. 838 * // It will require modifications to work: 839 * // - It may require correct/in-range values for request initialization. 840 * // - It may require specifying regional endpoints when creating the service client as shown in 841 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 842 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 843 * EntryGroup entryGroup = EntryGroup.newBuilder().build(); 844 * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup); 845 * } 846 * }</pre> 847 * 848 * @param entryGroup Required. Updates for the entry group. The `name` field must be set. 849 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 850 */ updateEntryGroup(EntryGroup entryGroup)851 public final EntryGroup updateEntryGroup(EntryGroup entryGroup) { 852 UpdateEntryGroupRequest request = 853 UpdateEntryGroupRequest.newBuilder().setEntryGroup(entryGroup).build(); 854 return updateEntryGroup(request); 855 } 856 857 // AUTO-GENERATED DOCUMENTATION AND METHOD. 858 /** 859 * Updates an entry group. 860 * 861 * <p>You must enable the Data Catalog API in the project identified by the `entry_group.name` 862 * parameter. For more information, see [Data Catalog resource 863 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 864 * 865 * <p>Sample code: 866 * 867 * <pre>{@code 868 * // This snippet has been automatically generated and should be regarded as a code template only. 869 * // It will require modifications to work: 870 * // - It may require correct/in-range values for request initialization. 871 * // - It may require specifying regional endpoints when creating the service client as shown in 872 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 873 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 874 * EntryGroup entryGroup = EntryGroup.newBuilder().build(); 875 * FieldMask updateMask = FieldMask.newBuilder().build(); 876 * EntryGroup response = dataCatalogClient.updateEntryGroup(entryGroup, updateMask); 877 * } 878 * }</pre> 879 * 880 * @param entryGroup Required. Updates for the entry group. The `name` field must be set. 881 * @param updateMask Names of fields whose values to overwrite on an entry group. 882 * <p>If this parameter is absent or empty, all modifiable fields are overwritten. If such 883 * fields are non-required and omitted in the request body, their values are emptied. 884 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 885 */ updateEntryGroup(EntryGroup entryGroup, FieldMask updateMask)886 public final EntryGroup updateEntryGroup(EntryGroup entryGroup, FieldMask updateMask) { 887 UpdateEntryGroupRequest request = 888 UpdateEntryGroupRequest.newBuilder() 889 .setEntryGroup(entryGroup) 890 .setUpdateMask(updateMask) 891 .build(); 892 return updateEntryGroup(request); 893 } 894 895 // AUTO-GENERATED DOCUMENTATION AND METHOD. 896 /** 897 * Updates an entry group. 898 * 899 * <p>You must enable the Data Catalog API in the project identified by the `entry_group.name` 900 * parameter. For more information, see [Data Catalog resource 901 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 902 * 903 * <p>Sample code: 904 * 905 * <pre>{@code 906 * // This snippet has been automatically generated and should be regarded as a code template only. 907 * // It will require modifications to work: 908 * // - It may require correct/in-range values for request initialization. 909 * // - It may require specifying regional endpoints when creating the service client as shown in 910 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 911 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 912 * UpdateEntryGroupRequest request = 913 * UpdateEntryGroupRequest.newBuilder() 914 * .setEntryGroup(EntryGroup.newBuilder().build()) 915 * .setUpdateMask(FieldMask.newBuilder().build()) 916 * .build(); 917 * EntryGroup response = dataCatalogClient.updateEntryGroup(request); 918 * } 919 * }</pre> 920 * 921 * @param request The request object containing all of the parameters for the API call. 922 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 923 */ updateEntryGroup(UpdateEntryGroupRequest request)924 public final EntryGroup updateEntryGroup(UpdateEntryGroupRequest request) { 925 return updateEntryGroupCallable().call(request); 926 } 927 928 // AUTO-GENERATED DOCUMENTATION AND METHOD. 929 /** 930 * Updates an entry group. 931 * 932 * <p>You must enable the Data Catalog API in the project identified by the `entry_group.name` 933 * parameter. For more information, see [Data Catalog resource 934 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 935 * 936 * <p>Sample code: 937 * 938 * <pre>{@code 939 * // This snippet has been automatically generated and should be regarded as a code template only. 940 * // It will require modifications to work: 941 * // - It may require correct/in-range values for request initialization. 942 * // - It may require specifying regional endpoints when creating the service client as shown in 943 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 944 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 945 * UpdateEntryGroupRequest request = 946 * UpdateEntryGroupRequest.newBuilder() 947 * .setEntryGroup(EntryGroup.newBuilder().build()) 948 * .setUpdateMask(FieldMask.newBuilder().build()) 949 * .build(); 950 * ApiFuture<EntryGroup> future = 951 * dataCatalogClient.updateEntryGroupCallable().futureCall(request); 952 * // Do something. 953 * EntryGroup response = future.get(); 954 * } 955 * }</pre> 956 */ updateEntryGroupCallable()957 public final UnaryCallable<UpdateEntryGroupRequest, EntryGroup> updateEntryGroupCallable() { 958 return stub.updateEntryGroupCallable(); 959 } 960 961 // AUTO-GENERATED DOCUMENTATION AND METHOD. 962 /** 963 * Deletes an entry group. 964 * 965 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 966 * more information, see [Data Catalog resource 967 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 968 * 969 * <p>Sample code: 970 * 971 * <pre>{@code 972 * // This snippet has been automatically generated and should be regarded as a code template only. 973 * // It will require modifications to work: 974 * // - It may require correct/in-range values for request initialization. 975 * // - It may require specifying regional endpoints when creating the service client as shown in 976 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 977 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 978 * EntryGroupName name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); 979 * dataCatalogClient.deleteEntryGroup(name); 980 * } 981 * }</pre> 982 * 983 * @param name Required. The name of the entry group to delete. 984 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 985 */ deleteEntryGroup(EntryGroupName name)986 public final void deleteEntryGroup(EntryGroupName name) { 987 DeleteEntryGroupRequest request = 988 DeleteEntryGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 989 deleteEntryGroup(request); 990 } 991 992 // AUTO-GENERATED DOCUMENTATION AND METHOD. 993 /** 994 * Deletes an entry group. 995 * 996 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 997 * more information, see [Data Catalog resource 998 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 999 * 1000 * <p>Sample code: 1001 * 1002 * <pre>{@code 1003 * // This snippet has been automatically generated and should be regarded as a code template only. 1004 * // It will require modifications to work: 1005 * // - It may require correct/in-range values for request initialization. 1006 * // - It may require specifying regional endpoints when creating the service client as shown in 1007 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1008 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1009 * String name = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); 1010 * dataCatalogClient.deleteEntryGroup(name); 1011 * } 1012 * }</pre> 1013 * 1014 * @param name Required. The name of the entry group to delete. 1015 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1016 */ deleteEntryGroup(String name)1017 public final void deleteEntryGroup(String name) { 1018 DeleteEntryGroupRequest request = DeleteEntryGroupRequest.newBuilder().setName(name).build(); 1019 deleteEntryGroup(request); 1020 } 1021 1022 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1023 /** 1024 * Deletes an entry group. 1025 * 1026 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 1027 * more information, see [Data Catalog resource 1028 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1029 * 1030 * <p>Sample code: 1031 * 1032 * <pre>{@code 1033 * // This snippet has been automatically generated and should be regarded as a code template only. 1034 * // It will require modifications to work: 1035 * // - It may require correct/in-range values for request initialization. 1036 * // - It may require specifying regional endpoints when creating the service client as shown in 1037 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1038 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1039 * DeleteEntryGroupRequest request = 1040 * DeleteEntryGroupRequest.newBuilder() 1041 * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 1042 * .setForce(true) 1043 * .build(); 1044 * dataCatalogClient.deleteEntryGroup(request); 1045 * } 1046 * }</pre> 1047 * 1048 * @param request The request object containing all of the parameters for the API call. 1049 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1050 */ deleteEntryGroup(DeleteEntryGroupRequest request)1051 public final void deleteEntryGroup(DeleteEntryGroupRequest request) { 1052 deleteEntryGroupCallable().call(request); 1053 } 1054 1055 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1056 /** 1057 * Deletes an entry group. 1058 * 1059 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 1060 * more information, see [Data Catalog resource 1061 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1062 * 1063 * <p>Sample code: 1064 * 1065 * <pre>{@code 1066 * // This snippet has been automatically generated and should be regarded as a code template only. 1067 * // It will require modifications to work: 1068 * // - It may require correct/in-range values for request initialization. 1069 * // - It may require specifying regional endpoints when creating the service client as shown in 1070 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1071 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1072 * DeleteEntryGroupRequest request = 1073 * DeleteEntryGroupRequest.newBuilder() 1074 * .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 1075 * .setForce(true) 1076 * .build(); 1077 * ApiFuture<Empty> future = dataCatalogClient.deleteEntryGroupCallable().futureCall(request); 1078 * // Do something. 1079 * future.get(); 1080 * } 1081 * }</pre> 1082 */ deleteEntryGroupCallable()1083 public final UnaryCallable<DeleteEntryGroupRequest, Empty> deleteEntryGroupCallable() { 1084 return stub.deleteEntryGroupCallable(); 1085 } 1086 1087 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1088 /** 1089 * Lists entry groups. 1090 * 1091 * <p>Sample code: 1092 * 1093 * <pre>{@code 1094 * // This snippet has been automatically generated and should be regarded as a code template only. 1095 * // It will require modifications to work: 1096 * // - It may require correct/in-range values for request initialization. 1097 * // - It may require specifying regional endpoints when creating the service client as shown in 1098 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1099 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1100 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 1101 * for (EntryGroup element : dataCatalogClient.listEntryGroups(parent).iterateAll()) { 1102 * // doThingsWith(element); 1103 * } 1104 * } 1105 * }</pre> 1106 * 1107 * @param parent Required. The name of the location that contains the entry groups to list. 1108 * <p>Can be provided as a URL. 1109 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1110 */ listEntryGroups(LocationName parent)1111 public final ListEntryGroupsPagedResponse listEntryGroups(LocationName parent) { 1112 ListEntryGroupsRequest request = 1113 ListEntryGroupsRequest.newBuilder() 1114 .setParent(parent == null ? null : parent.toString()) 1115 .build(); 1116 return listEntryGroups(request); 1117 } 1118 1119 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1120 /** 1121 * Lists entry groups. 1122 * 1123 * <p>Sample code: 1124 * 1125 * <pre>{@code 1126 * // This snippet has been automatically generated and should be regarded as a code template only. 1127 * // It will require modifications to work: 1128 * // - It may require correct/in-range values for request initialization. 1129 * // - It may require specifying regional endpoints when creating the service client as shown in 1130 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1131 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1132 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 1133 * for (EntryGroup element : dataCatalogClient.listEntryGroups(parent).iterateAll()) { 1134 * // doThingsWith(element); 1135 * } 1136 * } 1137 * }</pre> 1138 * 1139 * @param parent Required. The name of the location that contains the entry groups to list. 1140 * <p>Can be provided as a URL. 1141 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1142 */ listEntryGroups(String parent)1143 public final ListEntryGroupsPagedResponse listEntryGroups(String parent) { 1144 ListEntryGroupsRequest request = ListEntryGroupsRequest.newBuilder().setParent(parent).build(); 1145 return listEntryGroups(request); 1146 } 1147 1148 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1149 /** 1150 * Lists entry groups. 1151 * 1152 * <p>Sample code: 1153 * 1154 * <pre>{@code 1155 * // This snippet has been automatically generated and should be regarded as a code template only. 1156 * // It will require modifications to work: 1157 * // - It may require correct/in-range values for request initialization. 1158 * // - It may require specifying regional endpoints when creating the service client as shown in 1159 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1160 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1161 * ListEntryGroupsRequest request = 1162 * ListEntryGroupsRequest.newBuilder() 1163 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1164 * .setPageSize(883849137) 1165 * .setPageToken("pageToken873572522") 1166 * .build(); 1167 * for (EntryGroup element : dataCatalogClient.listEntryGroups(request).iterateAll()) { 1168 * // doThingsWith(element); 1169 * } 1170 * } 1171 * }</pre> 1172 * 1173 * @param request The request object containing all of the parameters for the API call. 1174 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1175 */ listEntryGroups(ListEntryGroupsRequest request)1176 public final ListEntryGroupsPagedResponse listEntryGroups(ListEntryGroupsRequest request) { 1177 return listEntryGroupsPagedCallable().call(request); 1178 } 1179 1180 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1181 /** 1182 * Lists entry groups. 1183 * 1184 * <p>Sample code: 1185 * 1186 * <pre>{@code 1187 * // This snippet has been automatically generated and should be regarded as a code template only. 1188 * // It will require modifications to work: 1189 * // - It may require correct/in-range values for request initialization. 1190 * // - It may require specifying regional endpoints when creating the service client as shown in 1191 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1192 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1193 * ListEntryGroupsRequest request = 1194 * ListEntryGroupsRequest.newBuilder() 1195 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1196 * .setPageSize(883849137) 1197 * .setPageToken("pageToken873572522") 1198 * .build(); 1199 * ApiFuture<EntryGroup> future = 1200 * dataCatalogClient.listEntryGroupsPagedCallable().futureCall(request); 1201 * // Do something. 1202 * for (EntryGroup element : future.get().iterateAll()) { 1203 * // doThingsWith(element); 1204 * } 1205 * } 1206 * }</pre> 1207 */ 1208 public final UnaryCallable<ListEntryGroupsRequest, ListEntryGroupsPagedResponse> listEntryGroupsPagedCallable()1209 listEntryGroupsPagedCallable() { 1210 return stub.listEntryGroupsPagedCallable(); 1211 } 1212 1213 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1214 /** 1215 * Lists entry groups. 1216 * 1217 * <p>Sample code: 1218 * 1219 * <pre>{@code 1220 * // This snippet has been automatically generated and should be regarded as a code template only. 1221 * // It will require modifications to work: 1222 * // - It may require correct/in-range values for request initialization. 1223 * // - It may require specifying regional endpoints when creating the service client as shown in 1224 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1225 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1226 * ListEntryGroupsRequest request = 1227 * ListEntryGroupsRequest.newBuilder() 1228 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 1229 * .setPageSize(883849137) 1230 * .setPageToken("pageToken873572522") 1231 * .build(); 1232 * while (true) { 1233 * ListEntryGroupsResponse response = 1234 * dataCatalogClient.listEntryGroupsCallable().call(request); 1235 * for (EntryGroup element : response.getEntryGroupsList()) { 1236 * // doThingsWith(element); 1237 * } 1238 * String nextPageToken = response.getNextPageToken(); 1239 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1240 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1241 * } else { 1242 * break; 1243 * } 1244 * } 1245 * } 1246 * }</pre> 1247 */ 1248 public final UnaryCallable<ListEntryGroupsRequest, ListEntryGroupsResponse> listEntryGroupsCallable()1249 listEntryGroupsCallable() { 1250 return stub.listEntryGroupsCallable(); 1251 } 1252 1253 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1254 /** 1255 * Creates an entry. 1256 * 1257 * <p>You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', or custom types. Data 1258 * Catalog automatically creates entries with other types during metadata ingestion from 1259 * integrated systems. 1260 * 1261 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 1262 * For more information, see [Data Catalog resource 1263 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1264 * 1265 * <p>An entry group can have a maximum of 100,000 entries. 1266 * 1267 * <p>Sample code: 1268 * 1269 * <pre>{@code 1270 * // This snippet has been automatically generated and should be regarded as a code template only. 1271 * // It will require modifications to work: 1272 * // - It may require correct/in-range values for request initialization. 1273 * // - It may require specifying regional endpoints when creating the service client as shown in 1274 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1275 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1276 * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); 1277 * String entryId = "entryId-1591558867"; 1278 * Entry entry = Entry.newBuilder().build(); 1279 * Entry response = dataCatalogClient.createEntry(parent, entryId, entry); 1280 * } 1281 * }</pre> 1282 * 1283 * @param parent Required. The name of the entry group this entry belongs to. 1284 * <p>Note: The entry itself and its child resources might not be stored in the location 1285 * specified in its name. 1286 * @param entryId Required. The ID of the entry to create. 1287 * <p>The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores (_). The 1288 * maximum size is 64 bytes when encoded in UTF-8. 1289 * @param entry Required. The entry to create. 1290 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1291 */ createEntry(EntryGroupName parent, String entryId, Entry entry)1292 public final Entry createEntry(EntryGroupName parent, String entryId, Entry entry) { 1293 CreateEntryRequest request = 1294 CreateEntryRequest.newBuilder() 1295 .setParent(parent == null ? null : parent.toString()) 1296 .setEntryId(entryId) 1297 .setEntry(entry) 1298 .build(); 1299 return createEntry(request); 1300 } 1301 1302 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1303 /** 1304 * Creates an entry. 1305 * 1306 * <p>You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', or custom types. Data 1307 * Catalog automatically creates entries with other types during metadata ingestion from 1308 * integrated systems. 1309 * 1310 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 1311 * For more information, see [Data Catalog resource 1312 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1313 * 1314 * <p>An entry group can have a maximum of 100,000 entries. 1315 * 1316 * <p>Sample code: 1317 * 1318 * <pre>{@code 1319 * // This snippet has been automatically generated and should be regarded as a code template only. 1320 * // It will require modifications to work: 1321 * // - It may require correct/in-range values for request initialization. 1322 * // - It may require specifying regional endpoints when creating the service client as shown in 1323 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1324 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1325 * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); 1326 * String entryId = "entryId-1591558867"; 1327 * Entry entry = Entry.newBuilder().build(); 1328 * Entry response = dataCatalogClient.createEntry(parent, entryId, entry); 1329 * } 1330 * }</pre> 1331 * 1332 * @param parent Required. The name of the entry group this entry belongs to. 1333 * <p>Note: The entry itself and its child resources might not be stored in the location 1334 * specified in its name. 1335 * @param entryId Required. The ID of the entry to create. 1336 * <p>The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores (_). The 1337 * maximum size is 64 bytes when encoded in UTF-8. 1338 * @param entry Required. The entry to create. 1339 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1340 */ createEntry(String parent, String entryId, Entry entry)1341 public final Entry createEntry(String parent, String entryId, Entry entry) { 1342 CreateEntryRequest request = 1343 CreateEntryRequest.newBuilder() 1344 .setParent(parent) 1345 .setEntryId(entryId) 1346 .setEntry(entry) 1347 .build(); 1348 return createEntry(request); 1349 } 1350 1351 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1352 /** 1353 * Creates an entry. 1354 * 1355 * <p>You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', or custom types. Data 1356 * Catalog automatically creates entries with other types during metadata ingestion from 1357 * integrated systems. 1358 * 1359 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 1360 * For more information, see [Data Catalog resource 1361 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1362 * 1363 * <p>An entry group can have a maximum of 100,000 entries. 1364 * 1365 * <p>Sample code: 1366 * 1367 * <pre>{@code 1368 * // This snippet has been automatically generated and should be regarded as a code template only. 1369 * // It will require modifications to work: 1370 * // - It may require correct/in-range values for request initialization. 1371 * // - It may require specifying regional endpoints when creating the service client as shown in 1372 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1373 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1374 * CreateEntryRequest request = 1375 * CreateEntryRequest.newBuilder() 1376 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 1377 * .setEntryId("entryId-1591558867") 1378 * .setEntry(Entry.newBuilder().build()) 1379 * .build(); 1380 * Entry response = dataCatalogClient.createEntry(request); 1381 * } 1382 * }</pre> 1383 * 1384 * @param request The request object containing all of the parameters for the API call. 1385 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1386 */ createEntry(CreateEntryRequest request)1387 public final Entry createEntry(CreateEntryRequest request) { 1388 return createEntryCallable().call(request); 1389 } 1390 1391 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1392 /** 1393 * Creates an entry. 1394 * 1395 * <p>You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', or custom types. Data 1396 * Catalog automatically creates entries with other types during metadata ingestion from 1397 * integrated systems. 1398 * 1399 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 1400 * For more information, see [Data Catalog resource 1401 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1402 * 1403 * <p>An entry group can have a maximum of 100,000 entries. 1404 * 1405 * <p>Sample code: 1406 * 1407 * <pre>{@code 1408 * // This snippet has been automatically generated and should be regarded as a code template only. 1409 * // It will require modifications to work: 1410 * // - It may require correct/in-range values for request initialization. 1411 * // - It may require specifying regional endpoints when creating the service client as shown in 1412 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1413 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1414 * CreateEntryRequest request = 1415 * CreateEntryRequest.newBuilder() 1416 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 1417 * .setEntryId("entryId-1591558867") 1418 * .setEntry(Entry.newBuilder().build()) 1419 * .build(); 1420 * ApiFuture<Entry> future = dataCatalogClient.createEntryCallable().futureCall(request); 1421 * // Do something. 1422 * Entry response = future.get(); 1423 * } 1424 * }</pre> 1425 */ createEntryCallable()1426 public final UnaryCallable<CreateEntryRequest, Entry> createEntryCallable() { 1427 return stub.createEntryCallable(); 1428 } 1429 1430 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1431 /** 1432 * Updates an existing entry. 1433 * 1434 * <p>You must enable the Data Catalog API in the project identified by the `entry.name` 1435 * parameter. For more information, see [Data Catalog resource 1436 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1437 * 1438 * <p>Sample code: 1439 * 1440 * <pre>{@code 1441 * // This snippet has been automatically generated and should be regarded as a code template only. 1442 * // It will require modifications to work: 1443 * // - It may require correct/in-range values for request initialization. 1444 * // - It may require specifying regional endpoints when creating the service client as shown in 1445 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1446 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1447 * Entry entry = Entry.newBuilder().build(); 1448 * Entry response = dataCatalogClient.updateEntry(entry); 1449 * } 1450 * }</pre> 1451 * 1452 * @param entry Required. Updates for the entry. The `name` field must be set. 1453 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1454 */ updateEntry(Entry entry)1455 public final Entry updateEntry(Entry entry) { 1456 UpdateEntryRequest request = UpdateEntryRequest.newBuilder().setEntry(entry).build(); 1457 return updateEntry(request); 1458 } 1459 1460 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1461 /** 1462 * Updates an existing entry. 1463 * 1464 * <p>You must enable the Data Catalog API in the project identified by the `entry.name` 1465 * parameter. For more information, see [Data Catalog resource 1466 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1467 * 1468 * <p>Sample code: 1469 * 1470 * <pre>{@code 1471 * // This snippet has been automatically generated and should be regarded as a code template only. 1472 * // It will require modifications to work: 1473 * // - It may require correct/in-range values for request initialization. 1474 * // - It may require specifying regional endpoints when creating the service client as shown in 1475 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1476 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1477 * Entry entry = Entry.newBuilder().build(); 1478 * FieldMask updateMask = FieldMask.newBuilder().build(); 1479 * Entry response = dataCatalogClient.updateEntry(entry, updateMask); 1480 * } 1481 * }</pre> 1482 * 1483 * @param entry Required. Updates for the entry. The `name` field must be set. 1484 * @param updateMask Names of fields whose values to overwrite on an entry. 1485 * <p>If this parameter is absent or empty, all modifiable fields are overwritten. If such 1486 * fields are non-required and omitted in the request body, their values are emptied. 1487 * <p>You can modify only the fields listed below. 1488 * <p>For entries with type `DATA_STREAM`: 1489 * <ul> 1490 * <li>`schema` 1491 * </ul> 1492 * <p>For entries with type `FILESET`: 1493 * <ul> 1494 * <li>`schema` 1495 * <li>`display_name` 1496 * <li>`description` 1497 * <li>`gcs_fileset_spec` 1498 * <li>`gcs_fileset_spec.file_patterns` 1499 * </ul> 1500 * <p>For entries with `user_specified_type`: 1501 * <ul> 1502 * <li>`schema` 1503 * <li>`display_name` 1504 * <li>`description` 1505 * <li>`user_specified_type` 1506 * <li>`user_specified_system` 1507 * <li>`linked_resource` 1508 * <li>`source_system_timestamps` 1509 * </ul> 1510 * 1511 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1512 */ updateEntry(Entry entry, FieldMask updateMask)1513 public final Entry updateEntry(Entry entry, FieldMask updateMask) { 1514 UpdateEntryRequest request = 1515 UpdateEntryRequest.newBuilder().setEntry(entry).setUpdateMask(updateMask).build(); 1516 return updateEntry(request); 1517 } 1518 1519 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1520 /** 1521 * Updates an existing entry. 1522 * 1523 * <p>You must enable the Data Catalog API in the project identified by the `entry.name` 1524 * parameter. For more information, see [Data Catalog resource 1525 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1526 * 1527 * <p>Sample code: 1528 * 1529 * <pre>{@code 1530 * // This snippet has been automatically generated and should be regarded as a code template only. 1531 * // It will require modifications to work: 1532 * // - It may require correct/in-range values for request initialization. 1533 * // - It may require specifying regional endpoints when creating the service client as shown in 1534 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1535 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1536 * UpdateEntryRequest request = 1537 * UpdateEntryRequest.newBuilder() 1538 * .setEntry(Entry.newBuilder().build()) 1539 * .setUpdateMask(FieldMask.newBuilder().build()) 1540 * .build(); 1541 * Entry response = dataCatalogClient.updateEntry(request); 1542 * } 1543 * }</pre> 1544 * 1545 * @param request The request object containing all of the parameters for the API call. 1546 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1547 */ updateEntry(UpdateEntryRequest request)1548 public final Entry updateEntry(UpdateEntryRequest request) { 1549 return updateEntryCallable().call(request); 1550 } 1551 1552 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1553 /** 1554 * Updates an existing entry. 1555 * 1556 * <p>You must enable the Data Catalog API in the project identified by the `entry.name` 1557 * parameter. For more information, see [Data Catalog resource 1558 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1559 * 1560 * <p>Sample code: 1561 * 1562 * <pre>{@code 1563 * // This snippet has been automatically generated and should be regarded as a code template only. 1564 * // It will require modifications to work: 1565 * // - It may require correct/in-range values for request initialization. 1566 * // - It may require specifying regional endpoints when creating the service client as shown in 1567 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1568 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1569 * UpdateEntryRequest request = 1570 * UpdateEntryRequest.newBuilder() 1571 * .setEntry(Entry.newBuilder().build()) 1572 * .setUpdateMask(FieldMask.newBuilder().build()) 1573 * .build(); 1574 * ApiFuture<Entry> future = dataCatalogClient.updateEntryCallable().futureCall(request); 1575 * // Do something. 1576 * Entry response = future.get(); 1577 * } 1578 * }</pre> 1579 */ updateEntryCallable()1580 public final UnaryCallable<UpdateEntryRequest, Entry> updateEntryCallable() { 1581 return stub.updateEntryCallable(); 1582 } 1583 1584 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1585 /** 1586 * Deletes an existing entry. 1587 * 1588 * <p>You can delete only the entries created by the 1589 * [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] method. 1590 * 1591 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 1592 * more information, see [Data Catalog resource 1593 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1594 * 1595 * <p>Sample code: 1596 * 1597 * <pre>{@code 1598 * // This snippet has been automatically generated and should be regarded as a code template only. 1599 * // It will require modifications to work: 1600 * // - It may require correct/in-range values for request initialization. 1601 * // - It may require specifying regional endpoints when creating the service client as shown in 1602 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1603 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1604 * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 1605 * dataCatalogClient.deleteEntry(name); 1606 * } 1607 * }</pre> 1608 * 1609 * @param name Required. The name of the entry to delete. 1610 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1611 */ deleteEntry(EntryName name)1612 public final void deleteEntry(EntryName name) { 1613 DeleteEntryRequest request = 1614 DeleteEntryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1615 deleteEntry(request); 1616 } 1617 1618 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1619 /** 1620 * Deletes an existing entry. 1621 * 1622 * <p>You can delete only the entries created by the 1623 * [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] method. 1624 * 1625 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 1626 * more information, see [Data Catalog resource 1627 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1628 * 1629 * <p>Sample code: 1630 * 1631 * <pre>{@code 1632 * // This snippet has been automatically generated and should be regarded as a code template only. 1633 * // It will require modifications to work: 1634 * // - It may require correct/in-range values for request initialization. 1635 * // - It may require specifying regional endpoints when creating the service client as shown in 1636 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1637 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1638 * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 1639 * dataCatalogClient.deleteEntry(name); 1640 * } 1641 * }</pre> 1642 * 1643 * @param name Required. The name of the entry to delete. 1644 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1645 */ deleteEntry(String name)1646 public final void deleteEntry(String name) { 1647 DeleteEntryRequest request = DeleteEntryRequest.newBuilder().setName(name).build(); 1648 deleteEntry(request); 1649 } 1650 1651 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1652 /** 1653 * Deletes an existing entry. 1654 * 1655 * <p>You can delete only the entries created by the 1656 * [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] method. 1657 * 1658 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 1659 * more information, see [Data Catalog resource 1660 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1661 * 1662 * <p>Sample code: 1663 * 1664 * <pre>{@code 1665 * // This snippet has been automatically generated and should be regarded as a code template only. 1666 * // It will require modifications to work: 1667 * // - It may require correct/in-range values for request initialization. 1668 * // - It may require specifying regional endpoints when creating the service client as shown in 1669 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1670 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1671 * DeleteEntryRequest request = 1672 * DeleteEntryRequest.newBuilder() 1673 * .setName( 1674 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 1675 * .build(); 1676 * dataCatalogClient.deleteEntry(request); 1677 * } 1678 * }</pre> 1679 * 1680 * @param request The request object containing all of the parameters for the API call. 1681 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1682 */ deleteEntry(DeleteEntryRequest request)1683 public final void deleteEntry(DeleteEntryRequest request) { 1684 deleteEntryCallable().call(request); 1685 } 1686 1687 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1688 /** 1689 * Deletes an existing entry. 1690 * 1691 * <p>You can delete only the entries created by the 1692 * [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] method. 1693 * 1694 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 1695 * more information, see [Data Catalog resource 1696 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 1697 * 1698 * <p>Sample code: 1699 * 1700 * <pre>{@code 1701 * // This snippet has been automatically generated and should be regarded as a code template only. 1702 * // It will require modifications to work: 1703 * // - It may require correct/in-range values for request initialization. 1704 * // - It may require specifying regional endpoints when creating the service client as shown in 1705 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1706 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1707 * DeleteEntryRequest request = 1708 * DeleteEntryRequest.newBuilder() 1709 * .setName( 1710 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 1711 * .build(); 1712 * ApiFuture<Empty> future = dataCatalogClient.deleteEntryCallable().futureCall(request); 1713 * // Do something. 1714 * future.get(); 1715 * } 1716 * }</pre> 1717 */ deleteEntryCallable()1718 public final UnaryCallable<DeleteEntryRequest, Empty> deleteEntryCallable() { 1719 return stub.deleteEntryCallable(); 1720 } 1721 1722 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1723 /** 1724 * Gets an entry. 1725 * 1726 * <p>Sample code: 1727 * 1728 * <pre>{@code 1729 * // This snippet has been automatically generated and should be regarded as a code template only. 1730 * // It will require modifications to work: 1731 * // - It may require correct/in-range values for request initialization. 1732 * // - It may require specifying regional endpoints when creating the service client as shown in 1733 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1734 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1735 * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 1736 * Entry response = dataCatalogClient.getEntry(name); 1737 * } 1738 * }</pre> 1739 * 1740 * @param name Required. The name of the entry to get. 1741 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1742 */ getEntry(EntryName name)1743 public final Entry getEntry(EntryName name) { 1744 GetEntryRequest request = 1745 GetEntryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1746 return getEntry(request); 1747 } 1748 1749 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1750 /** 1751 * Gets an entry. 1752 * 1753 * <p>Sample code: 1754 * 1755 * <pre>{@code 1756 * // This snippet has been automatically generated and should be regarded as a code template only. 1757 * // It will require modifications to work: 1758 * // - It may require correct/in-range values for request initialization. 1759 * // - It may require specifying regional endpoints when creating the service client as shown in 1760 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1761 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1762 * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 1763 * Entry response = dataCatalogClient.getEntry(name); 1764 * } 1765 * }</pre> 1766 * 1767 * @param name Required. The name of the entry to get. 1768 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1769 */ getEntry(String name)1770 public final Entry getEntry(String name) { 1771 GetEntryRequest request = GetEntryRequest.newBuilder().setName(name).build(); 1772 return getEntry(request); 1773 } 1774 1775 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1776 /** 1777 * Gets an entry. 1778 * 1779 * <p>Sample code: 1780 * 1781 * <pre>{@code 1782 * // This snippet has been automatically generated and should be regarded as a code template only. 1783 * // It will require modifications to work: 1784 * // - It may require correct/in-range values for request initialization. 1785 * // - It may require specifying regional endpoints when creating the service client as shown in 1786 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1787 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1788 * GetEntryRequest request = 1789 * GetEntryRequest.newBuilder() 1790 * .setName( 1791 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 1792 * .build(); 1793 * Entry response = dataCatalogClient.getEntry(request); 1794 * } 1795 * }</pre> 1796 * 1797 * @param request The request object containing all of the parameters for the API call. 1798 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1799 */ getEntry(GetEntryRequest request)1800 public final Entry getEntry(GetEntryRequest request) { 1801 return getEntryCallable().call(request); 1802 } 1803 1804 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1805 /** 1806 * Gets an entry. 1807 * 1808 * <p>Sample code: 1809 * 1810 * <pre>{@code 1811 * // This snippet has been automatically generated and should be regarded as a code template only. 1812 * // It will require modifications to work: 1813 * // - It may require correct/in-range values for request initialization. 1814 * // - It may require specifying regional endpoints when creating the service client as shown in 1815 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1816 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1817 * GetEntryRequest request = 1818 * GetEntryRequest.newBuilder() 1819 * .setName( 1820 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 1821 * .build(); 1822 * ApiFuture<Entry> future = dataCatalogClient.getEntryCallable().futureCall(request); 1823 * // Do something. 1824 * Entry response = future.get(); 1825 * } 1826 * }</pre> 1827 */ getEntryCallable()1828 public final UnaryCallable<GetEntryRequest, Entry> getEntryCallable() { 1829 return stub.getEntryCallable(); 1830 } 1831 1832 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1833 /** 1834 * Gets an entry by its target resource name. 1835 * 1836 * <p>The resource name comes from the source Google Cloud Platform service. 1837 * 1838 * <p>Sample code: 1839 * 1840 * <pre>{@code 1841 * // This snippet has been automatically generated and should be regarded as a code template only. 1842 * // It will require modifications to work: 1843 * // - It may require correct/in-range values for request initialization. 1844 * // - It may require specifying regional endpoints when creating the service client as shown in 1845 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1846 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1847 * LookupEntryRequest request = LookupEntryRequest.newBuilder().build(); 1848 * Entry response = dataCatalogClient.lookupEntry(request); 1849 * } 1850 * }</pre> 1851 * 1852 * @param request The request object containing all of the parameters for the API call. 1853 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1854 */ lookupEntry(LookupEntryRequest request)1855 public final Entry lookupEntry(LookupEntryRequest request) { 1856 return lookupEntryCallable().call(request); 1857 } 1858 1859 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1860 /** 1861 * Gets an entry by its target resource name. 1862 * 1863 * <p>The resource name comes from the source Google Cloud Platform service. 1864 * 1865 * <p>Sample code: 1866 * 1867 * <pre>{@code 1868 * // This snippet has been automatically generated and should be regarded as a code template only. 1869 * // It will require modifications to work: 1870 * // - It may require correct/in-range values for request initialization. 1871 * // - It may require specifying regional endpoints when creating the service client as shown in 1872 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1873 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1874 * LookupEntryRequest request = LookupEntryRequest.newBuilder().build(); 1875 * ApiFuture<Entry> future = dataCatalogClient.lookupEntryCallable().futureCall(request); 1876 * // Do something. 1877 * Entry response = future.get(); 1878 * } 1879 * }</pre> 1880 */ lookupEntryCallable()1881 public final UnaryCallable<LookupEntryRequest, Entry> lookupEntryCallable() { 1882 return stub.lookupEntryCallable(); 1883 } 1884 1885 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1886 /** 1887 * Lists entries. 1888 * 1889 * <p>Note: Currently, this method can list only custom entries. To get a list of both custom and 1890 * automatically created entries, use 1891 * [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. 1892 * 1893 * <p>Sample code: 1894 * 1895 * <pre>{@code 1896 * // This snippet has been automatically generated and should be regarded as a code template only. 1897 * // It will require modifications to work: 1898 * // - It may require correct/in-range values for request initialization. 1899 * // - It may require specifying regional endpoints when creating the service client as shown in 1900 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1901 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1902 * EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); 1903 * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) { 1904 * // doThingsWith(element); 1905 * } 1906 * } 1907 * }</pre> 1908 * 1909 * @param parent Required. The name of the entry group that contains the entries to list. 1910 * <p>Can be provided in URL format. 1911 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1912 */ listEntries(EntryGroupName parent)1913 public final ListEntriesPagedResponse listEntries(EntryGroupName parent) { 1914 ListEntriesRequest request = 1915 ListEntriesRequest.newBuilder() 1916 .setParent(parent == null ? null : parent.toString()) 1917 .build(); 1918 return listEntries(request); 1919 } 1920 1921 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1922 /** 1923 * Lists entries. 1924 * 1925 * <p>Note: Currently, this method can list only custom entries. To get a list of both custom and 1926 * automatically created entries, use 1927 * [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. 1928 * 1929 * <p>Sample code: 1930 * 1931 * <pre>{@code 1932 * // This snippet has been automatically generated and should be regarded as a code template only. 1933 * // It will require modifications to work: 1934 * // - It may require correct/in-range values for request initialization. 1935 * // - It may require specifying regional endpoints when creating the service client as shown in 1936 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1937 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1938 * String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString(); 1939 * for (Entry element : dataCatalogClient.listEntries(parent).iterateAll()) { 1940 * // doThingsWith(element); 1941 * } 1942 * } 1943 * }</pre> 1944 * 1945 * @param parent Required. The name of the entry group that contains the entries to list. 1946 * <p>Can be provided in URL format. 1947 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1948 */ listEntries(String parent)1949 public final ListEntriesPagedResponse listEntries(String parent) { 1950 ListEntriesRequest request = ListEntriesRequest.newBuilder().setParent(parent).build(); 1951 return listEntries(request); 1952 } 1953 1954 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1955 /** 1956 * Lists entries. 1957 * 1958 * <p>Note: Currently, this method can list only custom entries. To get a list of both custom and 1959 * automatically created entries, use 1960 * [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. 1961 * 1962 * <p>Sample code: 1963 * 1964 * <pre>{@code 1965 * // This snippet has been automatically generated and should be regarded as a code template only. 1966 * // It will require modifications to work: 1967 * // - It may require correct/in-range values for request initialization. 1968 * // - It may require specifying regional endpoints when creating the service client as shown in 1969 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1970 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 1971 * ListEntriesRequest request = 1972 * ListEntriesRequest.newBuilder() 1973 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 1974 * .setPageSize(883849137) 1975 * .setPageToken("pageToken873572522") 1976 * .setReadMask(FieldMask.newBuilder().build()) 1977 * .build(); 1978 * for (Entry element : dataCatalogClient.listEntries(request).iterateAll()) { 1979 * // doThingsWith(element); 1980 * } 1981 * } 1982 * }</pre> 1983 * 1984 * @param request The request object containing all of the parameters for the API call. 1985 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1986 */ listEntries(ListEntriesRequest request)1987 public final ListEntriesPagedResponse listEntries(ListEntriesRequest request) { 1988 return listEntriesPagedCallable().call(request); 1989 } 1990 1991 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1992 /** 1993 * Lists entries. 1994 * 1995 * <p>Note: Currently, this method can list only custom entries. To get a list of both custom and 1996 * automatically created entries, use 1997 * [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. 1998 * 1999 * <p>Sample code: 2000 * 2001 * <pre>{@code 2002 * // This snippet has been automatically generated and should be regarded as a code template only. 2003 * // It will require modifications to work: 2004 * // - It may require correct/in-range values for request initialization. 2005 * // - It may require specifying regional endpoints when creating the service client as shown in 2006 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2007 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2008 * ListEntriesRequest request = 2009 * ListEntriesRequest.newBuilder() 2010 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 2011 * .setPageSize(883849137) 2012 * .setPageToken("pageToken873572522") 2013 * .setReadMask(FieldMask.newBuilder().build()) 2014 * .build(); 2015 * ApiFuture<Entry> future = dataCatalogClient.listEntriesPagedCallable().futureCall(request); 2016 * // Do something. 2017 * for (Entry element : future.get().iterateAll()) { 2018 * // doThingsWith(element); 2019 * } 2020 * } 2021 * }</pre> 2022 */ 2023 public final UnaryCallable<ListEntriesRequest, ListEntriesPagedResponse> listEntriesPagedCallable()2024 listEntriesPagedCallable() { 2025 return stub.listEntriesPagedCallable(); 2026 } 2027 2028 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2029 /** 2030 * Lists entries. 2031 * 2032 * <p>Note: Currently, this method can list only custom entries. To get a list of both custom and 2033 * automatically created entries, use 2034 * [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. 2035 * 2036 * <p>Sample code: 2037 * 2038 * <pre>{@code 2039 * // This snippet has been automatically generated and should be regarded as a code template only. 2040 * // It will require modifications to work: 2041 * // - It may require correct/in-range values for request initialization. 2042 * // - It may require specifying regional endpoints when creating the service client as shown in 2043 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2044 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2045 * ListEntriesRequest request = 2046 * ListEntriesRequest.newBuilder() 2047 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 2048 * .setPageSize(883849137) 2049 * .setPageToken("pageToken873572522") 2050 * .setReadMask(FieldMask.newBuilder().build()) 2051 * .build(); 2052 * while (true) { 2053 * ListEntriesResponse response = dataCatalogClient.listEntriesCallable().call(request); 2054 * for (Entry element : response.getEntriesList()) { 2055 * // doThingsWith(element); 2056 * } 2057 * String nextPageToken = response.getNextPageToken(); 2058 * if (!Strings.isNullOrEmpty(nextPageToken)) { 2059 * request = request.toBuilder().setPageToken(nextPageToken).build(); 2060 * } else { 2061 * break; 2062 * } 2063 * } 2064 * } 2065 * }</pre> 2066 */ listEntriesCallable()2067 public final UnaryCallable<ListEntriesRequest, ListEntriesResponse> listEntriesCallable() { 2068 return stub.listEntriesCallable(); 2069 } 2070 2071 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2072 /** 2073 * Modifies entry overview, part of the business context of an 2074 * [Entry][google.cloud.datacatalog.v1.Entry]. 2075 * 2076 * <p>To call this method, you must have the `datacatalog.entries.updateOverview` IAM permission 2077 * on the corresponding project. 2078 * 2079 * <p>Sample code: 2080 * 2081 * <pre>{@code 2082 * // This snippet has been automatically generated and should be regarded as a code template only. 2083 * // It will require modifications to work: 2084 * // - It may require correct/in-range values for request initialization. 2085 * // - It may require specifying regional endpoints when creating the service client as shown in 2086 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2087 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2088 * ModifyEntryOverviewRequest request = 2089 * ModifyEntryOverviewRequest.newBuilder() 2090 * .setName( 2091 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 2092 * .setEntryOverview(EntryOverview.newBuilder().build()) 2093 * .build(); 2094 * EntryOverview response = dataCatalogClient.modifyEntryOverview(request); 2095 * } 2096 * }</pre> 2097 * 2098 * @param request The request object containing all of the parameters for the API call. 2099 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2100 */ modifyEntryOverview(ModifyEntryOverviewRequest request)2101 public final EntryOverview modifyEntryOverview(ModifyEntryOverviewRequest request) { 2102 return modifyEntryOverviewCallable().call(request); 2103 } 2104 2105 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2106 /** 2107 * Modifies entry overview, part of the business context of an 2108 * [Entry][google.cloud.datacatalog.v1.Entry]. 2109 * 2110 * <p>To call this method, you must have the `datacatalog.entries.updateOverview` IAM permission 2111 * on the corresponding project. 2112 * 2113 * <p>Sample code: 2114 * 2115 * <pre>{@code 2116 * // This snippet has been automatically generated and should be regarded as a code template only. 2117 * // It will require modifications to work: 2118 * // - It may require correct/in-range values for request initialization. 2119 * // - It may require specifying regional endpoints when creating the service client as shown in 2120 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2121 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2122 * ModifyEntryOverviewRequest request = 2123 * ModifyEntryOverviewRequest.newBuilder() 2124 * .setName( 2125 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 2126 * .setEntryOverview(EntryOverview.newBuilder().build()) 2127 * .build(); 2128 * ApiFuture<EntryOverview> future = 2129 * dataCatalogClient.modifyEntryOverviewCallable().futureCall(request); 2130 * // Do something. 2131 * EntryOverview response = future.get(); 2132 * } 2133 * }</pre> 2134 */ 2135 public final UnaryCallable<ModifyEntryOverviewRequest, EntryOverview> modifyEntryOverviewCallable()2136 modifyEntryOverviewCallable() { 2137 return stub.modifyEntryOverviewCallable(); 2138 } 2139 2140 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2141 /** 2142 * Modifies contacts, part of the business context of an 2143 * [Entry][google.cloud.datacatalog.v1.Entry]. 2144 * 2145 * <p>To call this method, you must have the `datacatalog.entries.updateContacts` IAM permission 2146 * on the corresponding project. 2147 * 2148 * <p>Sample code: 2149 * 2150 * <pre>{@code 2151 * // This snippet has been automatically generated and should be regarded as a code template only. 2152 * // It will require modifications to work: 2153 * // - It may require correct/in-range values for request initialization. 2154 * // - It may require specifying regional endpoints when creating the service client as shown in 2155 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2156 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2157 * ModifyEntryContactsRequest request = 2158 * ModifyEntryContactsRequest.newBuilder() 2159 * .setName( 2160 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 2161 * .setContacts(Contacts.newBuilder().build()) 2162 * .build(); 2163 * Contacts response = dataCatalogClient.modifyEntryContacts(request); 2164 * } 2165 * }</pre> 2166 * 2167 * @param request The request object containing all of the parameters for the API call. 2168 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2169 */ modifyEntryContacts(ModifyEntryContactsRequest request)2170 public final Contacts modifyEntryContacts(ModifyEntryContactsRequest request) { 2171 return modifyEntryContactsCallable().call(request); 2172 } 2173 2174 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2175 /** 2176 * Modifies contacts, part of the business context of an 2177 * [Entry][google.cloud.datacatalog.v1.Entry]. 2178 * 2179 * <p>To call this method, you must have the `datacatalog.entries.updateContacts` IAM permission 2180 * on the corresponding project. 2181 * 2182 * <p>Sample code: 2183 * 2184 * <pre>{@code 2185 * // This snippet has been automatically generated and should be regarded as a code template only. 2186 * // It will require modifications to work: 2187 * // - It may require correct/in-range values for request initialization. 2188 * // - It may require specifying regional endpoints when creating the service client as shown in 2189 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2190 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2191 * ModifyEntryContactsRequest request = 2192 * ModifyEntryContactsRequest.newBuilder() 2193 * .setName( 2194 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 2195 * .setContacts(Contacts.newBuilder().build()) 2196 * .build(); 2197 * ApiFuture<Contacts> future = 2198 * dataCatalogClient.modifyEntryContactsCallable().futureCall(request); 2199 * // Do something. 2200 * Contacts response = future.get(); 2201 * } 2202 * }</pre> 2203 */ modifyEntryContactsCallable()2204 public final UnaryCallable<ModifyEntryContactsRequest, Contacts> modifyEntryContactsCallable() { 2205 return stub.modifyEntryContactsCallable(); 2206 } 2207 2208 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2209 /** 2210 * Creates a tag template. 2211 * 2212 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2213 * For more information, see [Data Catalog resource project] 2214 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2215 * 2216 * <p>Sample code: 2217 * 2218 * <pre>{@code 2219 * // This snippet has been automatically generated and should be regarded as a code template only. 2220 * // It will require modifications to work: 2221 * // - It may require correct/in-range values for request initialization. 2222 * // - It may require specifying regional endpoints when creating the service client as shown in 2223 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2224 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2225 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 2226 * String tagTemplateId = "tagTemplateId-1438776721"; 2227 * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); 2228 * TagTemplate response = 2229 * dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); 2230 * } 2231 * }</pre> 2232 * 2233 * @param parent Required. The name of the project and the template location 2234 * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). 2235 * @param tagTemplateId Required. The ID of the tag template to create. 2236 * <p>The ID must contain only lowercase letters (a-z), numbers (0-9), or underscores (_), and 2237 * must start with a letter or underscore. The maximum size is 64 bytes when encoded in UTF-8. 2238 * @param tagTemplate Required. The tag template to create. 2239 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2240 */ createTagTemplate( LocationName parent, String tagTemplateId, TagTemplate tagTemplate)2241 public final TagTemplate createTagTemplate( 2242 LocationName parent, String tagTemplateId, TagTemplate tagTemplate) { 2243 CreateTagTemplateRequest request = 2244 CreateTagTemplateRequest.newBuilder() 2245 .setParent(parent == null ? null : parent.toString()) 2246 .setTagTemplateId(tagTemplateId) 2247 .setTagTemplate(tagTemplate) 2248 .build(); 2249 return createTagTemplate(request); 2250 } 2251 2252 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2253 /** 2254 * Creates a tag template. 2255 * 2256 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2257 * For more information, see [Data Catalog resource project] 2258 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2259 * 2260 * <p>Sample code: 2261 * 2262 * <pre>{@code 2263 * // This snippet has been automatically generated and should be regarded as a code template only. 2264 * // It will require modifications to work: 2265 * // - It may require correct/in-range values for request initialization. 2266 * // - It may require specifying regional endpoints when creating the service client as shown in 2267 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2268 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2269 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 2270 * String tagTemplateId = "tagTemplateId-1438776721"; 2271 * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); 2272 * TagTemplate response = 2273 * dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); 2274 * } 2275 * }</pre> 2276 * 2277 * @param parent Required. The name of the project and the template location 2278 * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). 2279 * @param tagTemplateId Required. The ID of the tag template to create. 2280 * <p>The ID must contain only lowercase letters (a-z), numbers (0-9), or underscores (_), and 2281 * must start with a letter or underscore. The maximum size is 64 bytes when encoded in UTF-8. 2282 * @param tagTemplate Required. The tag template to create. 2283 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2284 */ createTagTemplate( String parent, String tagTemplateId, TagTemplate tagTemplate)2285 public final TagTemplate createTagTemplate( 2286 String parent, String tagTemplateId, TagTemplate tagTemplate) { 2287 CreateTagTemplateRequest request = 2288 CreateTagTemplateRequest.newBuilder() 2289 .setParent(parent) 2290 .setTagTemplateId(tagTemplateId) 2291 .setTagTemplate(tagTemplate) 2292 .build(); 2293 return createTagTemplate(request); 2294 } 2295 2296 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2297 /** 2298 * Creates a tag template. 2299 * 2300 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2301 * For more information, see [Data Catalog resource project] 2302 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2303 * 2304 * <p>Sample code: 2305 * 2306 * <pre>{@code 2307 * // This snippet has been automatically generated and should be regarded as a code template only. 2308 * // It will require modifications to work: 2309 * // - It may require correct/in-range values for request initialization. 2310 * // - It may require specifying regional endpoints when creating the service client as shown in 2311 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2312 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2313 * CreateTagTemplateRequest request = 2314 * CreateTagTemplateRequest.newBuilder() 2315 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2316 * .setTagTemplateId("tagTemplateId-1438776721") 2317 * .setTagTemplate(TagTemplate.newBuilder().build()) 2318 * .build(); 2319 * TagTemplate response = dataCatalogClient.createTagTemplate(request); 2320 * } 2321 * }</pre> 2322 * 2323 * @param request The request object containing all of the parameters for the API call. 2324 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2325 */ createTagTemplate(CreateTagTemplateRequest request)2326 public final TagTemplate createTagTemplate(CreateTagTemplateRequest request) { 2327 return createTagTemplateCallable().call(request); 2328 } 2329 2330 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2331 /** 2332 * Creates a tag template. 2333 * 2334 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2335 * For more information, see [Data Catalog resource project] 2336 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2337 * 2338 * <p>Sample code: 2339 * 2340 * <pre>{@code 2341 * // This snippet has been automatically generated and should be regarded as a code template only. 2342 * // It will require modifications to work: 2343 * // - It may require correct/in-range values for request initialization. 2344 * // - It may require specifying regional endpoints when creating the service client as shown in 2345 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2346 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2347 * CreateTagTemplateRequest request = 2348 * CreateTagTemplateRequest.newBuilder() 2349 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2350 * .setTagTemplateId("tagTemplateId-1438776721") 2351 * .setTagTemplate(TagTemplate.newBuilder().build()) 2352 * .build(); 2353 * ApiFuture<TagTemplate> future = 2354 * dataCatalogClient.createTagTemplateCallable().futureCall(request); 2355 * // Do something. 2356 * TagTemplate response = future.get(); 2357 * } 2358 * }</pre> 2359 */ createTagTemplateCallable()2360 public final UnaryCallable<CreateTagTemplateRequest, TagTemplate> createTagTemplateCallable() { 2361 return stub.createTagTemplateCallable(); 2362 } 2363 2364 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2365 /** 2366 * Gets a tag template. 2367 * 2368 * <p>Sample code: 2369 * 2370 * <pre>{@code 2371 * // This snippet has been automatically generated and should be regarded as a code template only. 2372 * // It will require modifications to work: 2373 * // - It may require correct/in-range values for request initialization. 2374 * // - It may require specifying regional endpoints when creating the service client as shown in 2375 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2376 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2377 * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); 2378 * TagTemplate response = dataCatalogClient.getTagTemplate(name); 2379 * } 2380 * }</pre> 2381 * 2382 * @param name Required. The name of the tag template to get. 2383 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2384 */ getTagTemplate(TagTemplateName name)2385 public final TagTemplate getTagTemplate(TagTemplateName name) { 2386 GetTagTemplateRequest request = 2387 GetTagTemplateRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2388 return getTagTemplate(request); 2389 } 2390 2391 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2392 /** 2393 * Gets a tag template. 2394 * 2395 * <p>Sample code: 2396 * 2397 * <pre>{@code 2398 * // This snippet has been automatically generated and should be regarded as a code template only. 2399 * // It will require modifications to work: 2400 * // - It may require correct/in-range values for request initialization. 2401 * // - It may require specifying regional endpoints when creating the service client as shown in 2402 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2403 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2404 * String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); 2405 * TagTemplate response = dataCatalogClient.getTagTemplate(name); 2406 * } 2407 * }</pre> 2408 * 2409 * @param name Required. The name of the tag template to get. 2410 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2411 */ getTagTemplate(String name)2412 public final TagTemplate getTagTemplate(String name) { 2413 GetTagTemplateRequest request = GetTagTemplateRequest.newBuilder().setName(name).build(); 2414 return getTagTemplate(request); 2415 } 2416 2417 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2418 /** 2419 * Gets a tag template. 2420 * 2421 * <p>Sample code: 2422 * 2423 * <pre>{@code 2424 * // This snippet has been automatically generated and should be regarded as a code template only. 2425 * // It will require modifications to work: 2426 * // - It may require correct/in-range values for request initialization. 2427 * // - It may require specifying regional endpoints when creating the service client as shown in 2428 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2429 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2430 * GetTagTemplateRequest request = 2431 * GetTagTemplateRequest.newBuilder() 2432 * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 2433 * .build(); 2434 * TagTemplate response = dataCatalogClient.getTagTemplate(request); 2435 * } 2436 * }</pre> 2437 * 2438 * @param request The request object containing all of the parameters for the API call. 2439 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2440 */ getTagTemplate(GetTagTemplateRequest request)2441 public final TagTemplate getTagTemplate(GetTagTemplateRequest request) { 2442 return getTagTemplateCallable().call(request); 2443 } 2444 2445 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2446 /** 2447 * Gets a tag template. 2448 * 2449 * <p>Sample code: 2450 * 2451 * <pre>{@code 2452 * // This snippet has been automatically generated and should be regarded as a code template only. 2453 * // It will require modifications to work: 2454 * // - It may require correct/in-range values for request initialization. 2455 * // - It may require specifying regional endpoints when creating the service client as shown in 2456 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2457 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2458 * GetTagTemplateRequest request = 2459 * GetTagTemplateRequest.newBuilder() 2460 * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 2461 * .build(); 2462 * ApiFuture<TagTemplate> future = 2463 * dataCatalogClient.getTagTemplateCallable().futureCall(request); 2464 * // Do something. 2465 * TagTemplate response = future.get(); 2466 * } 2467 * }</pre> 2468 */ getTagTemplateCallable()2469 public final UnaryCallable<GetTagTemplateRequest, TagTemplate> getTagTemplateCallable() { 2470 return stub.getTagTemplateCallable(); 2471 } 2472 2473 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2474 /** 2475 * Updates a tag template. 2476 * 2477 * <p>You can't update template fields with this method. These fields are separate resources with 2478 * their own create, update, and delete methods. 2479 * 2480 * <p>You must enable the Data Catalog API in the project identified by the `tag_template.name` 2481 * parameter. For more information, see [Data Catalog resource 2482 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2483 * 2484 * <p>Sample code: 2485 * 2486 * <pre>{@code 2487 * // This snippet has been automatically generated and should be regarded as a code template only. 2488 * // It will require modifications to work: 2489 * // - It may require correct/in-range values for request initialization. 2490 * // - It may require specifying regional endpoints when creating the service client as shown in 2491 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2492 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2493 * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); 2494 * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate); 2495 * } 2496 * }</pre> 2497 * 2498 * @param tagTemplate Required. The template to update. The `name` field must be set. 2499 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2500 */ updateTagTemplate(TagTemplate tagTemplate)2501 public final TagTemplate updateTagTemplate(TagTemplate tagTemplate) { 2502 UpdateTagTemplateRequest request = 2503 UpdateTagTemplateRequest.newBuilder().setTagTemplate(tagTemplate).build(); 2504 return updateTagTemplate(request); 2505 } 2506 2507 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2508 /** 2509 * Updates a tag template. 2510 * 2511 * <p>You can't update template fields with this method. These fields are separate resources with 2512 * their own create, update, and delete methods. 2513 * 2514 * <p>You must enable the Data Catalog API in the project identified by the `tag_template.name` 2515 * parameter. For more information, see [Data Catalog resource 2516 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2517 * 2518 * <p>Sample code: 2519 * 2520 * <pre>{@code 2521 * // This snippet has been automatically generated and should be regarded as a code template only. 2522 * // It will require modifications to work: 2523 * // - It may require correct/in-range values for request initialization. 2524 * // - It may require specifying regional endpoints when creating the service client as shown in 2525 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2526 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2527 * TagTemplate tagTemplate = TagTemplate.newBuilder().build(); 2528 * FieldMask updateMask = FieldMask.newBuilder().build(); 2529 * TagTemplate response = dataCatalogClient.updateTagTemplate(tagTemplate, updateMask); 2530 * } 2531 * }</pre> 2532 * 2533 * @param tagTemplate Required. The template to update. The `name` field must be set. 2534 * @param updateMask Names of fields whose values to overwrite on a tag template. Currently, only 2535 * `display_name` and `is_publicly_readable` can be overwritten. 2536 * <p>If this parameter is absent or empty, all modifiable fields are overwritten. If such 2537 * fields are non-required and omitted in the request body, their values are emptied. 2538 * <p>Note: Updating the `is_publicly_readable` field may require up to 12 hours to take 2539 * effect in search results. 2540 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2541 */ updateTagTemplate(TagTemplate tagTemplate, FieldMask updateMask)2542 public final TagTemplate updateTagTemplate(TagTemplate tagTemplate, FieldMask updateMask) { 2543 UpdateTagTemplateRequest request = 2544 UpdateTagTemplateRequest.newBuilder() 2545 .setTagTemplate(tagTemplate) 2546 .setUpdateMask(updateMask) 2547 .build(); 2548 return updateTagTemplate(request); 2549 } 2550 2551 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2552 /** 2553 * Updates a tag template. 2554 * 2555 * <p>You can't update template fields with this method. These fields are separate resources with 2556 * their own create, update, and delete methods. 2557 * 2558 * <p>You must enable the Data Catalog API in the project identified by the `tag_template.name` 2559 * parameter. For more information, see [Data Catalog resource 2560 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2561 * 2562 * <p>Sample code: 2563 * 2564 * <pre>{@code 2565 * // This snippet has been automatically generated and should be regarded as a code template only. 2566 * // It will require modifications to work: 2567 * // - It may require correct/in-range values for request initialization. 2568 * // - It may require specifying regional endpoints when creating the service client as shown in 2569 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2570 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2571 * UpdateTagTemplateRequest request = 2572 * UpdateTagTemplateRequest.newBuilder() 2573 * .setTagTemplate(TagTemplate.newBuilder().build()) 2574 * .setUpdateMask(FieldMask.newBuilder().build()) 2575 * .build(); 2576 * TagTemplate response = dataCatalogClient.updateTagTemplate(request); 2577 * } 2578 * }</pre> 2579 * 2580 * @param request The request object containing all of the parameters for the API call. 2581 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2582 */ updateTagTemplate(UpdateTagTemplateRequest request)2583 public final TagTemplate updateTagTemplate(UpdateTagTemplateRequest request) { 2584 return updateTagTemplateCallable().call(request); 2585 } 2586 2587 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2588 /** 2589 * Updates a tag template. 2590 * 2591 * <p>You can't update template fields with this method. These fields are separate resources with 2592 * their own create, update, and delete methods. 2593 * 2594 * <p>You must enable the Data Catalog API in the project identified by the `tag_template.name` 2595 * parameter. For more information, see [Data Catalog resource 2596 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2597 * 2598 * <p>Sample code: 2599 * 2600 * <pre>{@code 2601 * // This snippet has been automatically generated and should be regarded as a code template only. 2602 * // It will require modifications to work: 2603 * // - It may require correct/in-range values for request initialization. 2604 * // - It may require specifying regional endpoints when creating the service client as shown in 2605 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2606 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2607 * UpdateTagTemplateRequest request = 2608 * UpdateTagTemplateRequest.newBuilder() 2609 * .setTagTemplate(TagTemplate.newBuilder().build()) 2610 * .setUpdateMask(FieldMask.newBuilder().build()) 2611 * .build(); 2612 * ApiFuture<TagTemplate> future = 2613 * dataCatalogClient.updateTagTemplateCallable().futureCall(request); 2614 * // Do something. 2615 * TagTemplate response = future.get(); 2616 * } 2617 * }</pre> 2618 */ updateTagTemplateCallable()2619 public final UnaryCallable<UpdateTagTemplateRequest, TagTemplate> updateTagTemplateCallable() { 2620 return stub.updateTagTemplateCallable(); 2621 } 2622 2623 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2624 /** 2625 * Deletes a tag template and all tags that use it. 2626 * 2627 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 2628 * more information, see [Data Catalog resource 2629 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2630 * 2631 * <p>Sample code: 2632 * 2633 * <pre>{@code 2634 * // This snippet has been automatically generated and should be regarded as a code template only. 2635 * // It will require modifications to work: 2636 * // - It may require correct/in-range values for request initialization. 2637 * // - It may require specifying regional endpoints when creating the service client as shown in 2638 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2639 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2640 * TagTemplateName name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); 2641 * boolean force = true; 2642 * dataCatalogClient.deleteTagTemplate(name, force); 2643 * } 2644 * }</pre> 2645 * 2646 * @param name Required. The name of the tag template to delete. 2647 * @param force Required. If true, deletes all tags that use this template. 2648 * <p>Currently, `true` is the only supported value. 2649 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2650 */ deleteTagTemplate(TagTemplateName name, boolean force)2651 public final void deleteTagTemplate(TagTemplateName name, boolean force) { 2652 DeleteTagTemplateRequest request = 2653 DeleteTagTemplateRequest.newBuilder() 2654 .setName(name == null ? null : name.toString()) 2655 .setForce(force) 2656 .build(); 2657 deleteTagTemplate(request); 2658 } 2659 2660 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2661 /** 2662 * Deletes a tag template and all tags that use it. 2663 * 2664 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 2665 * more information, see [Data Catalog resource 2666 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2667 * 2668 * <p>Sample code: 2669 * 2670 * <pre>{@code 2671 * // This snippet has been automatically generated and should be regarded as a code template only. 2672 * // It will require modifications to work: 2673 * // - It may require correct/in-range values for request initialization. 2674 * // - It may require specifying regional endpoints when creating the service client as shown in 2675 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2676 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2677 * String name = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); 2678 * boolean force = true; 2679 * dataCatalogClient.deleteTagTemplate(name, force); 2680 * } 2681 * }</pre> 2682 * 2683 * @param name Required. The name of the tag template to delete. 2684 * @param force Required. If true, deletes all tags that use this template. 2685 * <p>Currently, `true` is the only supported value. 2686 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2687 */ deleteTagTemplate(String name, boolean force)2688 public final void deleteTagTemplate(String name, boolean force) { 2689 DeleteTagTemplateRequest request = 2690 DeleteTagTemplateRequest.newBuilder().setName(name).setForce(force).build(); 2691 deleteTagTemplate(request); 2692 } 2693 2694 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2695 /** 2696 * Deletes a tag template and all tags that use it. 2697 * 2698 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 2699 * more information, see [Data Catalog resource 2700 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2701 * 2702 * <p>Sample code: 2703 * 2704 * <pre>{@code 2705 * // This snippet has been automatically generated and should be regarded as a code template only. 2706 * // It will require modifications to work: 2707 * // - It may require correct/in-range values for request initialization. 2708 * // - It may require specifying regional endpoints when creating the service client as shown in 2709 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2710 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2711 * DeleteTagTemplateRequest request = 2712 * DeleteTagTemplateRequest.newBuilder() 2713 * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 2714 * .setForce(true) 2715 * .build(); 2716 * dataCatalogClient.deleteTagTemplate(request); 2717 * } 2718 * }</pre> 2719 * 2720 * @param request The request object containing all of the parameters for the API call. 2721 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2722 */ deleteTagTemplate(DeleteTagTemplateRequest request)2723 public final void deleteTagTemplate(DeleteTagTemplateRequest request) { 2724 deleteTagTemplateCallable().call(request); 2725 } 2726 2727 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2728 /** 2729 * Deletes a tag template and all tags that use it. 2730 * 2731 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 2732 * more information, see [Data Catalog resource 2733 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2734 * 2735 * <p>Sample code: 2736 * 2737 * <pre>{@code 2738 * // This snippet has been automatically generated and should be regarded as a code template only. 2739 * // It will require modifications to work: 2740 * // - It may require correct/in-range values for request initialization. 2741 * // - It may require specifying regional endpoints when creating the service client as shown in 2742 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2743 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2744 * DeleteTagTemplateRequest request = 2745 * DeleteTagTemplateRequest.newBuilder() 2746 * .setName(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 2747 * .setForce(true) 2748 * .build(); 2749 * ApiFuture<Empty> future = dataCatalogClient.deleteTagTemplateCallable().futureCall(request); 2750 * // Do something. 2751 * future.get(); 2752 * } 2753 * }</pre> 2754 */ deleteTagTemplateCallable()2755 public final UnaryCallable<DeleteTagTemplateRequest, Empty> deleteTagTemplateCallable() { 2756 return stub.deleteTagTemplateCallable(); 2757 } 2758 2759 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2760 /** 2761 * Creates a field in a tag template. 2762 * 2763 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2764 * For more information, see [Data Catalog resource 2765 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2766 * 2767 * <p>Sample code: 2768 * 2769 * <pre>{@code 2770 * // This snippet has been automatically generated and should be regarded as a code template only. 2771 * // It will require modifications to work: 2772 * // - It may require correct/in-range values for request initialization. 2773 * // - It may require specifying regional endpoints when creating the service client as shown in 2774 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2775 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2776 * TagTemplateName parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]"); 2777 * String tagTemplateFieldId = "tagTemplateFieldId-1556835615"; 2778 * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); 2779 * TagTemplateField response = 2780 * dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField); 2781 * } 2782 * }</pre> 2783 * 2784 * @param parent Required. The name of the project and the template location 2785 * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). 2786 * @param tagTemplateFieldId Required. The ID of the tag template field to create. 2787 * <p>Note: Adding a required field to an existing template is *not* allowed. 2788 * <p>Field IDs can contain letters (both uppercase and lowercase), numbers (0-9), underscores 2789 * (_) and dashes (-). Field IDs must be at least 1 character long and at most 128 characters 2790 * long. Field IDs must also be unique within their template. 2791 * @param tagTemplateField Required. The tag template field to create. 2792 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2793 */ createTagTemplateField( TagTemplateName parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)2794 public final TagTemplateField createTagTemplateField( 2795 TagTemplateName parent, String tagTemplateFieldId, TagTemplateField tagTemplateField) { 2796 CreateTagTemplateFieldRequest request = 2797 CreateTagTemplateFieldRequest.newBuilder() 2798 .setParent(parent == null ? null : parent.toString()) 2799 .setTagTemplateFieldId(tagTemplateFieldId) 2800 .setTagTemplateField(tagTemplateField) 2801 .build(); 2802 return createTagTemplateField(request); 2803 } 2804 2805 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2806 /** 2807 * Creates a field in a tag template. 2808 * 2809 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2810 * For more information, see [Data Catalog resource 2811 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2812 * 2813 * <p>Sample code: 2814 * 2815 * <pre>{@code 2816 * // This snippet has been automatically generated and should be regarded as a code template only. 2817 * // It will require modifications to work: 2818 * // - It may require correct/in-range values for request initialization. 2819 * // - It may require specifying regional endpoints when creating the service client as shown in 2820 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2821 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2822 * String parent = TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString(); 2823 * String tagTemplateFieldId = "tagTemplateFieldId-1556835615"; 2824 * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); 2825 * TagTemplateField response = 2826 * dataCatalogClient.createTagTemplateField(parent, tagTemplateFieldId, tagTemplateField); 2827 * } 2828 * }</pre> 2829 * 2830 * @param parent Required. The name of the project and the template location 2831 * [region](https://cloud.google.com/data-catalog/docs/concepts/regions). 2832 * @param tagTemplateFieldId Required. The ID of the tag template field to create. 2833 * <p>Note: Adding a required field to an existing template is *not* allowed. 2834 * <p>Field IDs can contain letters (both uppercase and lowercase), numbers (0-9), underscores 2835 * (_) and dashes (-). Field IDs must be at least 1 character long and at most 128 characters 2836 * long. Field IDs must also be unique within their template. 2837 * @param tagTemplateField Required. The tag template field to create. 2838 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2839 */ createTagTemplateField( String parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)2840 public final TagTemplateField createTagTemplateField( 2841 String parent, String tagTemplateFieldId, TagTemplateField tagTemplateField) { 2842 CreateTagTemplateFieldRequest request = 2843 CreateTagTemplateFieldRequest.newBuilder() 2844 .setParent(parent) 2845 .setTagTemplateFieldId(tagTemplateFieldId) 2846 .setTagTemplateField(tagTemplateField) 2847 .build(); 2848 return createTagTemplateField(request); 2849 } 2850 2851 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2852 /** 2853 * Creates a field in a tag template. 2854 * 2855 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2856 * For more information, see [Data Catalog resource 2857 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2858 * 2859 * <p>Sample code: 2860 * 2861 * <pre>{@code 2862 * // This snippet has been automatically generated and should be regarded as a code template only. 2863 * // It will require modifications to work: 2864 * // - It may require correct/in-range values for request initialization. 2865 * // - It may require specifying regional endpoints when creating the service client as shown in 2866 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2867 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2868 * CreateTagTemplateFieldRequest request = 2869 * CreateTagTemplateFieldRequest.newBuilder() 2870 * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 2871 * .setTagTemplateFieldId("tagTemplateFieldId-1556835615") 2872 * .setTagTemplateField(TagTemplateField.newBuilder().build()) 2873 * .build(); 2874 * TagTemplateField response = dataCatalogClient.createTagTemplateField(request); 2875 * } 2876 * }</pre> 2877 * 2878 * @param request The request object containing all of the parameters for the API call. 2879 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2880 */ createTagTemplateField(CreateTagTemplateFieldRequest request)2881 public final TagTemplateField createTagTemplateField(CreateTagTemplateFieldRequest request) { 2882 return createTagTemplateFieldCallable().call(request); 2883 } 2884 2885 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2886 /** 2887 * Creates a field in a tag template. 2888 * 2889 * <p>You must enable the Data Catalog API in the project identified by the `parent` parameter. 2890 * For more information, see [Data Catalog resource 2891 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2892 * 2893 * <p>Sample code: 2894 * 2895 * <pre>{@code 2896 * // This snippet has been automatically generated and should be regarded as a code template only. 2897 * // It will require modifications to work: 2898 * // - It may require correct/in-range values for request initialization. 2899 * // - It may require specifying regional endpoints when creating the service client as shown in 2900 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2901 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2902 * CreateTagTemplateFieldRequest request = 2903 * CreateTagTemplateFieldRequest.newBuilder() 2904 * .setParent(TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 2905 * .setTagTemplateFieldId("tagTemplateFieldId-1556835615") 2906 * .setTagTemplateField(TagTemplateField.newBuilder().build()) 2907 * .build(); 2908 * ApiFuture<TagTemplateField> future = 2909 * dataCatalogClient.createTagTemplateFieldCallable().futureCall(request); 2910 * // Do something. 2911 * TagTemplateField response = future.get(); 2912 * } 2913 * }</pre> 2914 */ 2915 public final UnaryCallable<CreateTagTemplateFieldRequest, TagTemplateField> createTagTemplateFieldCallable()2916 createTagTemplateFieldCallable() { 2917 return stub.createTagTemplateFieldCallable(); 2918 } 2919 2920 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2921 /** 2922 * Updates a field in a tag template. 2923 * 2924 * <p>You can't update the field type with this method. 2925 * 2926 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 2927 * more information, see [Data Catalog resource 2928 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2929 * 2930 * <p>Sample code: 2931 * 2932 * <pre>{@code 2933 * // This snippet has been automatically generated and should be regarded as a code template only. 2934 * // It will require modifications to work: 2935 * // - It may require correct/in-range values for request initialization. 2936 * // - It may require specifying regional endpoints when creating the service client as shown in 2937 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2938 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2939 * TagTemplateFieldName name = 2940 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); 2941 * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); 2942 * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name, tagTemplateField); 2943 * } 2944 * }</pre> 2945 * 2946 * @param name Required. The name of the tag template field. 2947 * @param tagTemplateField Required. The template to update. 2948 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2949 */ updateTagTemplateField( TagTemplateFieldName name, TagTemplateField tagTemplateField)2950 public final TagTemplateField updateTagTemplateField( 2951 TagTemplateFieldName name, TagTemplateField tagTemplateField) { 2952 UpdateTagTemplateFieldRequest request = 2953 UpdateTagTemplateFieldRequest.newBuilder() 2954 .setName(name == null ? null : name.toString()) 2955 .setTagTemplateField(tagTemplateField) 2956 .build(); 2957 return updateTagTemplateField(request); 2958 } 2959 2960 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2961 /** 2962 * Updates a field in a tag template. 2963 * 2964 * <p>You can't update the field type with this method. 2965 * 2966 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 2967 * more information, see [Data Catalog resource 2968 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 2969 * 2970 * <p>Sample code: 2971 * 2972 * <pre>{@code 2973 * // This snippet has been automatically generated and should be regarded as a code template only. 2974 * // It will require modifications to work: 2975 * // - It may require correct/in-range values for request initialization. 2976 * // - It may require specifying regional endpoints when creating the service client as shown in 2977 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2978 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 2979 * String name = 2980 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 2981 * .toString(); 2982 * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); 2983 * TagTemplateField response = dataCatalogClient.updateTagTemplateField(name, tagTemplateField); 2984 * } 2985 * }</pre> 2986 * 2987 * @param name Required. The name of the tag template field. 2988 * @param tagTemplateField Required. The template to update. 2989 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2990 */ updateTagTemplateField( String name, TagTemplateField tagTemplateField)2991 public final TagTemplateField updateTagTemplateField( 2992 String name, TagTemplateField tagTemplateField) { 2993 UpdateTagTemplateFieldRequest request = 2994 UpdateTagTemplateFieldRequest.newBuilder() 2995 .setName(name) 2996 .setTagTemplateField(tagTemplateField) 2997 .build(); 2998 return updateTagTemplateField(request); 2999 } 3000 3001 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3002 /** 3003 * Updates a field in a tag template. 3004 * 3005 * <p>You can't update the field type with this method. 3006 * 3007 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3008 * more information, see [Data Catalog resource 3009 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3010 * 3011 * <p>Sample code: 3012 * 3013 * <pre>{@code 3014 * // This snippet has been automatically generated and should be regarded as a code template only. 3015 * // It will require modifications to work: 3016 * // - It may require correct/in-range values for request initialization. 3017 * // - It may require specifying regional endpoints when creating the service client as shown in 3018 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3019 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3020 * TagTemplateFieldName name = 3021 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); 3022 * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); 3023 * FieldMask updateMask = FieldMask.newBuilder().build(); 3024 * TagTemplateField response = 3025 * dataCatalogClient.updateTagTemplateField(name, tagTemplateField, updateMask); 3026 * } 3027 * }</pre> 3028 * 3029 * @param name Required. The name of the tag template field. 3030 * @param tagTemplateField Required. The template to update. 3031 * @param updateMask Optional. Names of fields whose values to overwrite on an individual field of 3032 * a tag template. The following fields are modifiable: 3033 * <ul> 3034 * <li>`display_name` 3035 * <li>`type.enum_type` 3036 * <li>`is_required` 3037 * </ul> 3038 * <p>If this parameter is absent or empty, all modifiable fields are overwritten. If such 3039 * fields are non-required and omitted in the request body, their values are emptied with one 3040 * exception: when updating an enum type, the provided values are merged with the existing 3041 * values. Therefore, enum values can only be added, existing enum values cannot be deleted or 3042 * renamed. 3043 * <p>Additionally, updating a template field from optional to required is 3044 * <ul> 3045 * <li>not* allowed. 3046 * </ul> 3047 * 3048 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3049 */ updateTagTemplateField( TagTemplateFieldName name, TagTemplateField tagTemplateField, FieldMask updateMask)3050 public final TagTemplateField updateTagTemplateField( 3051 TagTemplateFieldName name, TagTemplateField tagTemplateField, FieldMask updateMask) { 3052 UpdateTagTemplateFieldRequest request = 3053 UpdateTagTemplateFieldRequest.newBuilder() 3054 .setName(name == null ? null : name.toString()) 3055 .setTagTemplateField(tagTemplateField) 3056 .setUpdateMask(updateMask) 3057 .build(); 3058 return updateTagTemplateField(request); 3059 } 3060 3061 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3062 /** 3063 * Updates a field in a tag template. 3064 * 3065 * <p>You can't update the field type with this method. 3066 * 3067 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3068 * more information, see [Data Catalog resource 3069 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3070 * 3071 * <p>Sample code: 3072 * 3073 * <pre>{@code 3074 * // This snippet has been automatically generated and should be regarded as a code template only. 3075 * // It will require modifications to work: 3076 * // - It may require correct/in-range values for request initialization. 3077 * // - It may require specifying regional endpoints when creating the service client as shown in 3078 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3079 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3080 * String name = 3081 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3082 * .toString(); 3083 * TagTemplateField tagTemplateField = TagTemplateField.newBuilder().build(); 3084 * FieldMask updateMask = FieldMask.newBuilder().build(); 3085 * TagTemplateField response = 3086 * dataCatalogClient.updateTagTemplateField(name, tagTemplateField, updateMask); 3087 * } 3088 * }</pre> 3089 * 3090 * @param name Required. The name of the tag template field. 3091 * @param tagTemplateField Required. The template to update. 3092 * @param updateMask Optional. Names of fields whose values to overwrite on an individual field of 3093 * a tag template. The following fields are modifiable: 3094 * <ul> 3095 * <li>`display_name` 3096 * <li>`type.enum_type` 3097 * <li>`is_required` 3098 * </ul> 3099 * <p>If this parameter is absent or empty, all modifiable fields are overwritten. If such 3100 * fields are non-required and omitted in the request body, their values are emptied with one 3101 * exception: when updating an enum type, the provided values are merged with the existing 3102 * values. Therefore, enum values can only be added, existing enum values cannot be deleted or 3103 * renamed. 3104 * <p>Additionally, updating a template field from optional to required is 3105 * <ul> 3106 * <li>not* allowed. 3107 * </ul> 3108 * 3109 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3110 */ updateTagTemplateField( String name, TagTemplateField tagTemplateField, FieldMask updateMask)3111 public final TagTemplateField updateTagTemplateField( 3112 String name, TagTemplateField tagTemplateField, FieldMask updateMask) { 3113 UpdateTagTemplateFieldRequest request = 3114 UpdateTagTemplateFieldRequest.newBuilder() 3115 .setName(name) 3116 .setTagTemplateField(tagTemplateField) 3117 .setUpdateMask(updateMask) 3118 .build(); 3119 return updateTagTemplateField(request); 3120 } 3121 3122 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3123 /** 3124 * Updates a field in a tag template. 3125 * 3126 * <p>You can't update the field type with this method. 3127 * 3128 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3129 * more information, see [Data Catalog resource 3130 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3131 * 3132 * <p>Sample code: 3133 * 3134 * <pre>{@code 3135 * // This snippet has been automatically generated and should be regarded as a code template only. 3136 * // It will require modifications to work: 3137 * // - It may require correct/in-range values for request initialization. 3138 * // - It may require specifying regional endpoints when creating the service client as shown in 3139 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3140 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3141 * UpdateTagTemplateFieldRequest request = 3142 * UpdateTagTemplateFieldRequest.newBuilder() 3143 * .setName( 3144 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3145 * .toString()) 3146 * .setTagTemplateField(TagTemplateField.newBuilder().build()) 3147 * .setUpdateMask(FieldMask.newBuilder().build()) 3148 * .build(); 3149 * TagTemplateField response = dataCatalogClient.updateTagTemplateField(request); 3150 * } 3151 * }</pre> 3152 * 3153 * @param request The request object containing all of the parameters for the API call. 3154 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3155 */ updateTagTemplateField(UpdateTagTemplateFieldRequest request)3156 public final TagTemplateField updateTagTemplateField(UpdateTagTemplateFieldRequest request) { 3157 return updateTagTemplateFieldCallable().call(request); 3158 } 3159 3160 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3161 /** 3162 * Updates a field in a tag template. 3163 * 3164 * <p>You can't update the field type with this method. 3165 * 3166 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3167 * more information, see [Data Catalog resource 3168 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3169 * 3170 * <p>Sample code: 3171 * 3172 * <pre>{@code 3173 * // This snippet has been automatically generated and should be regarded as a code template only. 3174 * // It will require modifications to work: 3175 * // - It may require correct/in-range values for request initialization. 3176 * // - It may require specifying regional endpoints when creating the service client as shown in 3177 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3178 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3179 * UpdateTagTemplateFieldRequest request = 3180 * UpdateTagTemplateFieldRequest.newBuilder() 3181 * .setName( 3182 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3183 * .toString()) 3184 * .setTagTemplateField(TagTemplateField.newBuilder().build()) 3185 * .setUpdateMask(FieldMask.newBuilder().build()) 3186 * .build(); 3187 * ApiFuture<TagTemplateField> future = 3188 * dataCatalogClient.updateTagTemplateFieldCallable().futureCall(request); 3189 * // Do something. 3190 * TagTemplateField response = future.get(); 3191 * } 3192 * }</pre> 3193 */ 3194 public final UnaryCallable<UpdateTagTemplateFieldRequest, TagTemplateField> updateTagTemplateFieldCallable()3195 updateTagTemplateFieldCallable() { 3196 return stub.updateTagTemplateFieldCallable(); 3197 } 3198 3199 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3200 /** 3201 * Renames a field in a tag template. 3202 * 3203 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3204 * more information, see [Data Catalog resource project] 3205 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3206 * 3207 * <p>Sample code: 3208 * 3209 * <pre>{@code 3210 * // This snippet has been automatically generated and should be regarded as a code template only. 3211 * // It will require modifications to work: 3212 * // - It may require correct/in-range values for request initialization. 3213 * // - It may require specifying regional endpoints when creating the service client as shown in 3214 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3215 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3216 * TagTemplateFieldName name = 3217 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); 3218 * String newTagTemplateFieldId = "newTagTemplateFieldId2008993953"; 3219 * TagTemplateField response = 3220 * dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId); 3221 * } 3222 * }</pre> 3223 * 3224 * @param name Required. The name of the tag template field. 3225 * @param newTagTemplateFieldId Required. The new ID of this tag template field. For example, 3226 * `my_new_field`. 3227 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3228 */ renameTagTemplateField( TagTemplateFieldName name, String newTagTemplateFieldId)3229 public final TagTemplateField renameTagTemplateField( 3230 TagTemplateFieldName name, String newTagTemplateFieldId) { 3231 RenameTagTemplateFieldRequest request = 3232 RenameTagTemplateFieldRequest.newBuilder() 3233 .setName(name == null ? null : name.toString()) 3234 .setNewTagTemplateFieldId(newTagTemplateFieldId) 3235 .build(); 3236 return renameTagTemplateField(request); 3237 } 3238 3239 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3240 /** 3241 * Renames a field in a tag template. 3242 * 3243 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3244 * more information, see [Data Catalog resource project] 3245 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3246 * 3247 * <p>Sample code: 3248 * 3249 * <pre>{@code 3250 * // This snippet has been automatically generated and should be regarded as a code template only. 3251 * // It will require modifications to work: 3252 * // - It may require correct/in-range values for request initialization. 3253 * // - It may require specifying regional endpoints when creating the service client as shown in 3254 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3255 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3256 * String name = 3257 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3258 * .toString(); 3259 * String newTagTemplateFieldId = "newTagTemplateFieldId2008993953"; 3260 * TagTemplateField response = 3261 * dataCatalogClient.renameTagTemplateField(name, newTagTemplateFieldId); 3262 * } 3263 * }</pre> 3264 * 3265 * @param name Required. The name of the tag template field. 3266 * @param newTagTemplateFieldId Required. The new ID of this tag template field. For example, 3267 * `my_new_field`. 3268 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3269 */ renameTagTemplateField(String name, String newTagTemplateFieldId)3270 public final TagTemplateField renameTagTemplateField(String name, String newTagTemplateFieldId) { 3271 RenameTagTemplateFieldRequest request = 3272 RenameTagTemplateFieldRequest.newBuilder() 3273 .setName(name) 3274 .setNewTagTemplateFieldId(newTagTemplateFieldId) 3275 .build(); 3276 return renameTagTemplateField(request); 3277 } 3278 3279 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3280 /** 3281 * Renames a field in a tag template. 3282 * 3283 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3284 * more information, see [Data Catalog resource project] 3285 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3286 * 3287 * <p>Sample code: 3288 * 3289 * <pre>{@code 3290 * // This snippet has been automatically generated and should be regarded as a code template only. 3291 * // It will require modifications to work: 3292 * // - It may require correct/in-range values for request initialization. 3293 * // - It may require specifying regional endpoints when creating the service client as shown in 3294 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3295 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3296 * RenameTagTemplateFieldRequest request = 3297 * RenameTagTemplateFieldRequest.newBuilder() 3298 * .setName( 3299 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3300 * .toString()) 3301 * .setNewTagTemplateFieldId("newTagTemplateFieldId2008993953") 3302 * .build(); 3303 * TagTemplateField response = dataCatalogClient.renameTagTemplateField(request); 3304 * } 3305 * }</pre> 3306 * 3307 * @param request The request object containing all of the parameters for the API call. 3308 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3309 */ renameTagTemplateField(RenameTagTemplateFieldRequest request)3310 public final TagTemplateField renameTagTemplateField(RenameTagTemplateFieldRequest request) { 3311 return renameTagTemplateFieldCallable().call(request); 3312 } 3313 3314 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3315 /** 3316 * Renames a field in a tag template. 3317 * 3318 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3319 * more information, see [Data Catalog resource project] 3320 * (https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3321 * 3322 * <p>Sample code: 3323 * 3324 * <pre>{@code 3325 * // This snippet has been automatically generated and should be regarded as a code template only. 3326 * // It will require modifications to work: 3327 * // - It may require correct/in-range values for request initialization. 3328 * // - It may require specifying regional endpoints when creating the service client as shown in 3329 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3330 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3331 * RenameTagTemplateFieldRequest request = 3332 * RenameTagTemplateFieldRequest.newBuilder() 3333 * .setName( 3334 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3335 * .toString()) 3336 * .setNewTagTemplateFieldId("newTagTemplateFieldId2008993953") 3337 * .build(); 3338 * ApiFuture<TagTemplateField> future = 3339 * dataCatalogClient.renameTagTemplateFieldCallable().futureCall(request); 3340 * // Do something. 3341 * TagTemplateField response = future.get(); 3342 * } 3343 * }</pre> 3344 */ 3345 public final UnaryCallable<RenameTagTemplateFieldRequest, TagTemplateField> renameTagTemplateFieldCallable()3346 renameTagTemplateFieldCallable() { 3347 return stub.renameTagTemplateFieldCallable(); 3348 } 3349 3350 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3351 /** 3352 * Renames an enum value in a tag template. 3353 * 3354 * <p>Within a single enum field, enum values must be unique. 3355 * 3356 * <p>Sample code: 3357 * 3358 * <pre>{@code 3359 * // This snippet has been automatically generated and should be regarded as a code template only. 3360 * // It will require modifications to work: 3361 * // - It may require correct/in-range values for request initialization. 3362 * // - It may require specifying regional endpoints when creating the service client as shown in 3363 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3364 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3365 * TagTemplateFieldEnumValueName name = 3366 * TagTemplateFieldEnumValueName.of( 3367 * "[PROJECT]", 3368 * "[LOCATION]", 3369 * "[TAG_TEMPLATE]", 3370 * "[TAG_TEMPLATE_FIELD_ID]", 3371 * "[ENUM_VALUE_DISPLAY_NAME]"); 3372 * String newEnumValueDisplayName = "newEnumValueDisplayName-1119629027"; 3373 * TagTemplateField response = 3374 * dataCatalogClient.renameTagTemplateFieldEnumValue(name, newEnumValueDisplayName); 3375 * } 3376 * }</pre> 3377 * 3378 * @param name Required. The name of the enum field value. 3379 * @param newEnumValueDisplayName Required. The new display name of the enum value. For example, 3380 * `my_new_enum_value`. 3381 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3382 */ renameTagTemplateFieldEnumValue( TagTemplateFieldEnumValueName name, String newEnumValueDisplayName)3383 public final TagTemplateField renameTagTemplateFieldEnumValue( 3384 TagTemplateFieldEnumValueName name, String newEnumValueDisplayName) { 3385 RenameTagTemplateFieldEnumValueRequest request = 3386 RenameTagTemplateFieldEnumValueRequest.newBuilder() 3387 .setName(name == null ? null : name.toString()) 3388 .setNewEnumValueDisplayName(newEnumValueDisplayName) 3389 .build(); 3390 return renameTagTemplateFieldEnumValue(request); 3391 } 3392 3393 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3394 /** 3395 * Renames an enum value in a tag template. 3396 * 3397 * <p>Within a single enum field, enum values must be unique. 3398 * 3399 * <p>Sample code: 3400 * 3401 * <pre>{@code 3402 * // This snippet has been automatically generated and should be regarded as a code template only. 3403 * // It will require modifications to work: 3404 * // - It may require correct/in-range values for request initialization. 3405 * // - It may require specifying regional endpoints when creating the service client as shown in 3406 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3407 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3408 * String name = 3409 * TagTemplateFieldEnumValueName.of( 3410 * "[PROJECT]", 3411 * "[LOCATION]", 3412 * "[TAG_TEMPLATE]", 3413 * "[TAG_TEMPLATE_FIELD_ID]", 3414 * "[ENUM_VALUE_DISPLAY_NAME]") 3415 * .toString(); 3416 * String newEnumValueDisplayName = "newEnumValueDisplayName-1119629027"; 3417 * TagTemplateField response = 3418 * dataCatalogClient.renameTagTemplateFieldEnumValue(name, newEnumValueDisplayName); 3419 * } 3420 * }</pre> 3421 * 3422 * @param name Required. The name of the enum field value. 3423 * @param newEnumValueDisplayName Required. The new display name of the enum value. For example, 3424 * `my_new_enum_value`. 3425 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3426 */ renameTagTemplateFieldEnumValue( String name, String newEnumValueDisplayName)3427 public final TagTemplateField renameTagTemplateFieldEnumValue( 3428 String name, String newEnumValueDisplayName) { 3429 RenameTagTemplateFieldEnumValueRequest request = 3430 RenameTagTemplateFieldEnumValueRequest.newBuilder() 3431 .setName(name) 3432 .setNewEnumValueDisplayName(newEnumValueDisplayName) 3433 .build(); 3434 return renameTagTemplateFieldEnumValue(request); 3435 } 3436 3437 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3438 /** 3439 * Renames an enum value in a tag template. 3440 * 3441 * <p>Within a single enum field, enum values must be unique. 3442 * 3443 * <p>Sample code: 3444 * 3445 * <pre>{@code 3446 * // This snippet has been automatically generated and should be regarded as a code template only. 3447 * // It will require modifications to work: 3448 * // - It may require correct/in-range values for request initialization. 3449 * // - It may require specifying regional endpoints when creating the service client as shown in 3450 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3451 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3452 * RenameTagTemplateFieldEnumValueRequest request = 3453 * RenameTagTemplateFieldEnumValueRequest.newBuilder() 3454 * .setName( 3455 * TagTemplateFieldEnumValueName.of( 3456 * "[PROJECT]", 3457 * "[LOCATION]", 3458 * "[TAG_TEMPLATE]", 3459 * "[TAG_TEMPLATE_FIELD_ID]", 3460 * "[ENUM_VALUE_DISPLAY_NAME]") 3461 * .toString()) 3462 * .setNewEnumValueDisplayName("newEnumValueDisplayName-1119629027") 3463 * .build(); 3464 * TagTemplateField response = dataCatalogClient.renameTagTemplateFieldEnumValue(request); 3465 * } 3466 * }</pre> 3467 * 3468 * @param request The request object containing all of the parameters for the API call. 3469 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3470 */ renameTagTemplateFieldEnumValue( RenameTagTemplateFieldEnumValueRequest request)3471 public final TagTemplateField renameTagTemplateFieldEnumValue( 3472 RenameTagTemplateFieldEnumValueRequest request) { 3473 return renameTagTemplateFieldEnumValueCallable().call(request); 3474 } 3475 3476 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3477 /** 3478 * Renames an enum value in a tag template. 3479 * 3480 * <p>Within a single enum field, enum values must be unique. 3481 * 3482 * <p>Sample code: 3483 * 3484 * <pre>{@code 3485 * // This snippet has been automatically generated and should be regarded as a code template only. 3486 * // It will require modifications to work: 3487 * // - It may require correct/in-range values for request initialization. 3488 * // - It may require specifying regional endpoints when creating the service client as shown in 3489 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3490 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3491 * RenameTagTemplateFieldEnumValueRequest request = 3492 * RenameTagTemplateFieldEnumValueRequest.newBuilder() 3493 * .setName( 3494 * TagTemplateFieldEnumValueName.of( 3495 * "[PROJECT]", 3496 * "[LOCATION]", 3497 * "[TAG_TEMPLATE]", 3498 * "[TAG_TEMPLATE_FIELD_ID]", 3499 * "[ENUM_VALUE_DISPLAY_NAME]") 3500 * .toString()) 3501 * .setNewEnumValueDisplayName("newEnumValueDisplayName-1119629027") 3502 * .build(); 3503 * ApiFuture<TagTemplateField> future = 3504 * dataCatalogClient.renameTagTemplateFieldEnumValueCallable().futureCall(request); 3505 * // Do something. 3506 * TagTemplateField response = future.get(); 3507 * } 3508 * }</pre> 3509 */ 3510 public final UnaryCallable<RenameTagTemplateFieldEnumValueRequest, TagTemplateField> renameTagTemplateFieldEnumValueCallable()3511 renameTagTemplateFieldEnumValueCallable() { 3512 return stub.renameTagTemplateFieldEnumValueCallable(); 3513 } 3514 3515 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3516 /** 3517 * Deletes a field in a tag template and all uses of this field from the tags based on this 3518 * template. 3519 * 3520 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3521 * more information, see [Data Catalog resource 3522 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3523 * 3524 * <p>Sample code: 3525 * 3526 * <pre>{@code 3527 * // This snippet has been automatically generated and should be regarded as a code template only. 3528 * // It will require modifications to work: 3529 * // - It may require correct/in-range values for request initialization. 3530 * // - It may require specifying regional endpoints when creating the service client as shown in 3531 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3532 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3533 * TagTemplateFieldName name = 3534 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]"); 3535 * boolean force = true; 3536 * dataCatalogClient.deleteTagTemplateField(name, force); 3537 * } 3538 * }</pre> 3539 * 3540 * @param name Required. The name of the tag template field to delete. 3541 * @param force Required. If true, deletes this field from any tags that use it. 3542 * <p>Currently, `true` is the only supported value. 3543 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3544 */ deleteTagTemplateField(TagTemplateFieldName name, boolean force)3545 public final void deleteTagTemplateField(TagTemplateFieldName name, boolean force) { 3546 DeleteTagTemplateFieldRequest request = 3547 DeleteTagTemplateFieldRequest.newBuilder() 3548 .setName(name == null ? null : name.toString()) 3549 .setForce(force) 3550 .build(); 3551 deleteTagTemplateField(request); 3552 } 3553 3554 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3555 /** 3556 * Deletes a field in a tag template and all uses of this field from the tags based on this 3557 * template. 3558 * 3559 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3560 * more information, see [Data Catalog resource 3561 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3562 * 3563 * <p>Sample code: 3564 * 3565 * <pre>{@code 3566 * // This snippet has been automatically generated and should be regarded as a code template only. 3567 * // It will require modifications to work: 3568 * // - It may require correct/in-range values for request initialization. 3569 * // - It may require specifying regional endpoints when creating the service client as shown in 3570 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3571 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3572 * String name = 3573 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3574 * .toString(); 3575 * boolean force = true; 3576 * dataCatalogClient.deleteTagTemplateField(name, force); 3577 * } 3578 * }</pre> 3579 * 3580 * @param name Required. The name of the tag template field to delete. 3581 * @param force Required. If true, deletes this field from any tags that use it. 3582 * <p>Currently, `true` is the only supported value. 3583 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3584 */ deleteTagTemplateField(String name, boolean force)3585 public final void deleteTagTemplateField(String name, boolean force) { 3586 DeleteTagTemplateFieldRequest request = 3587 DeleteTagTemplateFieldRequest.newBuilder().setName(name).setForce(force).build(); 3588 deleteTagTemplateField(request); 3589 } 3590 3591 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3592 /** 3593 * Deletes a field in a tag template and all uses of this field from the tags based on this 3594 * template. 3595 * 3596 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3597 * more information, see [Data Catalog resource 3598 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3599 * 3600 * <p>Sample code: 3601 * 3602 * <pre>{@code 3603 * // This snippet has been automatically generated and should be regarded as a code template only. 3604 * // It will require modifications to work: 3605 * // - It may require correct/in-range values for request initialization. 3606 * // - It may require specifying regional endpoints when creating the service client as shown in 3607 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3608 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3609 * DeleteTagTemplateFieldRequest request = 3610 * DeleteTagTemplateFieldRequest.newBuilder() 3611 * .setName( 3612 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3613 * .toString()) 3614 * .setForce(true) 3615 * .build(); 3616 * dataCatalogClient.deleteTagTemplateField(request); 3617 * } 3618 * }</pre> 3619 * 3620 * @param request The request object containing all of the parameters for the API call. 3621 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3622 */ deleteTagTemplateField(DeleteTagTemplateFieldRequest request)3623 public final void deleteTagTemplateField(DeleteTagTemplateFieldRequest request) { 3624 deleteTagTemplateFieldCallable().call(request); 3625 } 3626 3627 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3628 /** 3629 * Deletes a field in a tag template and all uses of this field from the tags based on this 3630 * template. 3631 * 3632 * <p>You must enable the Data Catalog API in the project identified by the `name` parameter. For 3633 * more information, see [Data Catalog resource 3634 * project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). 3635 * 3636 * <p>Sample code: 3637 * 3638 * <pre>{@code 3639 * // This snippet has been automatically generated and should be regarded as a code template only. 3640 * // It will require modifications to work: 3641 * // - It may require correct/in-range values for request initialization. 3642 * // - It may require specifying regional endpoints when creating the service client as shown in 3643 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3644 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3645 * DeleteTagTemplateFieldRequest request = 3646 * DeleteTagTemplateFieldRequest.newBuilder() 3647 * .setName( 3648 * TagTemplateFieldName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") 3649 * .toString()) 3650 * .setForce(true) 3651 * .build(); 3652 * ApiFuture<Empty> future = 3653 * dataCatalogClient.deleteTagTemplateFieldCallable().futureCall(request); 3654 * // Do something. 3655 * future.get(); 3656 * } 3657 * }</pre> 3658 */ 3659 public final UnaryCallable<DeleteTagTemplateFieldRequest, Empty> deleteTagTemplateFieldCallable()3660 deleteTagTemplateFieldCallable() { 3661 return stub.deleteTagTemplateFieldCallable(); 3662 } 3663 3664 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3665 /** 3666 * Creates a tag and assigns it to: 3667 * 3668 * <ul> 3669 * <li>An [Entry][google.cloud.datacatalog.v1.Entry] if the method name is 3670 * `projects.locations.entryGroups.entries.tags.create`. 3671 * <li>Or [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]if the method name is 3672 * `projects.locations.entryGroups.tags.create`. 3673 * </ul> 3674 * 3675 * <p>Note: The project identified by the `parent` parameter for the [tag] 3676 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) 3677 * and the [tag template] 3678 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) 3679 * used to create the tag must be in the same organization. 3680 * 3681 * <p>Sample code: 3682 * 3683 * <pre>{@code 3684 * // This snippet has been automatically generated and should be regarded as a code template only. 3685 * // It will require modifications to work: 3686 * // - It may require correct/in-range values for request initialization. 3687 * // - It may require specifying regional endpoints when creating the service client as shown in 3688 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3689 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3690 * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 3691 * Tag tag = Tag.newBuilder().build(); 3692 * Tag response = dataCatalogClient.createTag(parent, tag); 3693 * } 3694 * }</pre> 3695 * 3696 * @param parent Required. The name of the resource to attach this tag to. 3697 * <p>Tags can be attached to entries or entry groups. An entry can have up to 1000 attached 3698 * tags. 3699 * <p>Note: The tag and its child resources might not be stored in the location specified in 3700 * its name. 3701 * @param tag Required. The tag to create. 3702 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3703 */ createTag(EntryName parent, Tag tag)3704 public final Tag createTag(EntryName parent, Tag tag) { 3705 CreateTagRequest request = 3706 CreateTagRequest.newBuilder() 3707 .setParent(parent == null ? null : parent.toString()) 3708 .setTag(tag) 3709 .build(); 3710 return createTag(request); 3711 } 3712 3713 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3714 /** 3715 * Creates a tag and assigns it to: 3716 * 3717 * <ul> 3718 * <li>An [Entry][google.cloud.datacatalog.v1.Entry] if the method name is 3719 * `projects.locations.entryGroups.entries.tags.create`. 3720 * <li>Or [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]if the method name is 3721 * `projects.locations.entryGroups.tags.create`. 3722 * </ul> 3723 * 3724 * <p>Note: The project identified by the `parent` parameter for the [tag] 3725 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) 3726 * and the [tag template] 3727 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) 3728 * used to create the tag must be in the same organization. 3729 * 3730 * <p>Sample code: 3731 * 3732 * <pre>{@code 3733 * // This snippet has been automatically generated and should be regarded as a code template only. 3734 * // It will require modifications to work: 3735 * // - It may require correct/in-range values for request initialization. 3736 * // - It may require specifying regional endpoints when creating the service client as shown in 3737 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3738 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3739 * String parent = 3740 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 3741 * Tag tag = Tag.newBuilder().build(); 3742 * Tag response = dataCatalogClient.createTag(parent, tag); 3743 * } 3744 * }</pre> 3745 * 3746 * @param parent Required. The name of the resource to attach this tag to. 3747 * <p>Tags can be attached to entries or entry groups. An entry can have up to 1000 attached 3748 * tags. 3749 * <p>Note: The tag and its child resources might not be stored in the location specified in 3750 * its name. 3751 * @param tag Required. The tag to create. 3752 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3753 */ createTag(String parent, Tag tag)3754 public final Tag createTag(String parent, Tag tag) { 3755 CreateTagRequest request = CreateTagRequest.newBuilder().setParent(parent).setTag(tag).build(); 3756 return createTag(request); 3757 } 3758 3759 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3760 /** 3761 * Creates a tag and assigns it to: 3762 * 3763 * <ul> 3764 * <li>An [Entry][google.cloud.datacatalog.v1.Entry] if the method name is 3765 * `projects.locations.entryGroups.entries.tags.create`. 3766 * <li>Or [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]if the method name is 3767 * `projects.locations.entryGroups.tags.create`. 3768 * </ul> 3769 * 3770 * <p>Note: The project identified by the `parent` parameter for the [tag] 3771 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) 3772 * and the [tag template] 3773 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) 3774 * used to create the tag must be in the same organization. 3775 * 3776 * <p>Sample code: 3777 * 3778 * <pre>{@code 3779 * // This snippet has been automatically generated and should be regarded as a code template only. 3780 * // It will require modifications to work: 3781 * // - It may require correct/in-range values for request initialization. 3782 * // - It may require specifying regional endpoints when creating the service client as shown in 3783 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3784 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3785 * CreateTagRequest request = 3786 * CreateTagRequest.newBuilder() 3787 * .setParent( 3788 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 3789 * .setTag(Tag.newBuilder().build()) 3790 * .build(); 3791 * Tag response = dataCatalogClient.createTag(request); 3792 * } 3793 * }</pre> 3794 * 3795 * @param request The request object containing all of the parameters for the API call. 3796 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3797 */ createTag(CreateTagRequest request)3798 public final Tag createTag(CreateTagRequest request) { 3799 return createTagCallable().call(request); 3800 } 3801 3802 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3803 /** 3804 * Creates a tag and assigns it to: 3805 * 3806 * <ul> 3807 * <li>An [Entry][google.cloud.datacatalog.v1.Entry] if the method name is 3808 * `projects.locations.entryGroups.entries.tags.create`. 3809 * <li>Or [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]if the method name is 3810 * `projects.locations.entryGroups.tags.create`. 3811 * </ul> 3812 * 3813 * <p>Note: The project identified by the `parent` parameter for the [tag] 3814 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) 3815 * and the [tag template] 3816 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) 3817 * used to create the tag must be in the same organization. 3818 * 3819 * <p>Sample code: 3820 * 3821 * <pre>{@code 3822 * // This snippet has been automatically generated and should be regarded as a code template only. 3823 * // It will require modifications to work: 3824 * // - It may require correct/in-range values for request initialization. 3825 * // - It may require specifying regional endpoints when creating the service client as shown in 3826 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3827 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3828 * CreateTagRequest request = 3829 * CreateTagRequest.newBuilder() 3830 * .setParent( 3831 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 3832 * .setTag(Tag.newBuilder().build()) 3833 * .build(); 3834 * ApiFuture<Tag> future = dataCatalogClient.createTagCallable().futureCall(request); 3835 * // Do something. 3836 * Tag response = future.get(); 3837 * } 3838 * }</pre> 3839 */ createTagCallable()3840 public final UnaryCallable<CreateTagRequest, Tag> createTagCallable() { 3841 return stub.createTagCallable(); 3842 } 3843 3844 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3845 /** 3846 * Updates an existing tag. 3847 * 3848 * <p>Sample code: 3849 * 3850 * <pre>{@code 3851 * // This snippet has been automatically generated and should be regarded as a code template only. 3852 * // It will require modifications to work: 3853 * // - It may require correct/in-range values for request initialization. 3854 * // - It may require specifying regional endpoints when creating the service client as shown in 3855 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3856 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3857 * Tag tag = Tag.newBuilder().build(); 3858 * Tag response = dataCatalogClient.updateTag(tag); 3859 * } 3860 * }</pre> 3861 * 3862 * @param tag Required. The updated tag. The "name" field must be set. 3863 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3864 */ updateTag(Tag tag)3865 public final Tag updateTag(Tag tag) { 3866 UpdateTagRequest request = UpdateTagRequest.newBuilder().setTag(tag).build(); 3867 return updateTag(request); 3868 } 3869 3870 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3871 /** 3872 * Updates an existing tag. 3873 * 3874 * <p>Sample code: 3875 * 3876 * <pre>{@code 3877 * // This snippet has been automatically generated and should be regarded as a code template only. 3878 * // It will require modifications to work: 3879 * // - It may require correct/in-range values for request initialization. 3880 * // - It may require specifying regional endpoints when creating the service client as shown in 3881 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3882 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3883 * Tag tag = Tag.newBuilder().build(); 3884 * FieldMask updateMask = FieldMask.newBuilder().build(); 3885 * Tag response = dataCatalogClient.updateTag(tag, updateMask); 3886 * } 3887 * }</pre> 3888 * 3889 * @param tag Required. The updated tag. The "name" field must be set. 3890 * @param updateMask Names of fields whose values to overwrite on a tag. Currently, a tag has the 3891 * only modifiable field with the name `fields`. 3892 * <p>In general, if this parameter is absent or empty, all modifiable fields are overwritten. 3893 * If such fields are non-required and omitted in the request body, their values are emptied. 3894 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3895 */ updateTag(Tag tag, FieldMask updateMask)3896 public final Tag updateTag(Tag tag, FieldMask updateMask) { 3897 UpdateTagRequest request = 3898 UpdateTagRequest.newBuilder().setTag(tag).setUpdateMask(updateMask).build(); 3899 return updateTag(request); 3900 } 3901 3902 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3903 /** 3904 * Updates an existing tag. 3905 * 3906 * <p>Sample code: 3907 * 3908 * <pre>{@code 3909 * // This snippet has been automatically generated and should be regarded as a code template only. 3910 * // It will require modifications to work: 3911 * // - It may require correct/in-range values for request initialization. 3912 * // - It may require specifying regional endpoints when creating the service client as shown in 3913 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3914 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3915 * UpdateTagRequest request = 3916 * UpdateTagRequest.newBuilder() 3917 * .setTag(Tag.newBuilder().build()) 3918 * .setUpdateMask(FieldMask.newBuilder().build()) 3919 * .build(); 3920 * Tag response = dataCatalogClient.updateTag(request); 3921 * } 3922 * }</pre> 3923 * 3924 * @param request The request object containing all of the parameters for the API call. 3925 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3926 */ updateTag(UpdateTagRequest request)3927 public final Tag updateTag(UpdateTagRequest request) { 3928 return updateTagCallable().call(request); 3929 } 3930 3931 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3932 /** 3933 * Updates an existing tag. 3934 * 3935 * <p>Sample code: 3936 * 3937 * <pre>{@code 3938 * // This snippet has been automatically generated and should be regarded as a code template only. 3939 * // It will require modifications to work: 3940 * // - It may require correct/in-range values for request initialization. 3941 * // - It may require specifying regional endpoints when creating the service client as shown in 3942 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3943 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3944 * UpdateTagRequest request = 3945 * UpdateTagRequest.newBuilder() 3946 * .setTag(Tag.newBuilder().build()) 3947 * .setUpdateMask(FieldMask.newBuilder().build()) 3948 * .build(); 3949 * ApiFuture<Tag> future = dataCatalogClient.updateTagCallable().futureCall(request); 3950 * // Do something. 3951 * Tag response = future.get(); 3952 * } 3953 * }</pre> 3954 */ updateTagCallable()3955 public final UnaryCallable<UpdateTagRequest, Tag> updateTagCallable() { 3956 return stub.updateTagCallable(); 3957 } 3958 3959 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3960 /** 3961 * Deletes a tag. 3962 * 3963 * <p>Sample code: 3964 * 3965 * <pre>{@code 3966 * // This snippet has been automatically generated and should be regarded as a code template only. 3967 * // It will require modifications to work: 3968 * // - It may require correct/in-range values for request initialization. 3969 * // - It may require specifying regional endpoints when creating the service client as shown in 3970 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3971 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3972 * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 3973 * dataCatalogClient.deleteTag(name); 3974 * } 3975 * }</pre> 3976 * 3977 * @param name Required. The name of the tag to delete. 3978 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3979 */ deleteTag(EntryName name)3980 public final void deleteTag(EntryName name) { 3981 DeleteTagRequest request = 3982 DeleteTagRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 3983 deleteTag(request); 3984 } 3985 3986 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3987 /** 3988 * Deletes a tag. 3989 * 3990 * <p>Sample code: 3991 * 3992 * <pre>{@code 3993 * // This snippet has been automatically generated and should be regarded as a code template only. 3994 * // It will require modifications to work: 3995 * // - It may require correct/in-range values for request initialization. 3996 * // - It may require specifying regional endpoints when creating the service client as shown in 3997 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3998 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 3999 * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 4000 * dataCatalogClient.deleteTag(name); 4001 * } 4002 * }</pre> 4003 * 4004 * @param name Required. The name of the tag to delete. 4005 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4006 */ deleteTag(String name)4007 public final void deleteTag(String name) { 4008 DeleteTagRequest request = DeleteTagRequest.newBuilder().setName(name).build(); 4009 deleteTag(request); 4010 } 4011 4012 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4013 /** 4014 * Deletes a tag. 4015 * 4016 * <p>Sample code: 4017 * 4018 * <pre>{@code 4019 * // This snippet has been automatically generated and should be regarded as a code template only. 4020 * // It will require modifications to work: 4021 * // - It may require correct/in-range values for request initialization. 4022 * // - It may require specifying regional endpoints when creating the service client as shown in 4023 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4024 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4025 * DeleteTagRequest request = 4026 * DeleteTagRequest.newBuilder() 4027 * .setName( 4028 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4029 * .build(); 4030 * dataCatalogClient.deleteTag(request); 4031 * } 4032 * }</pre> 4033 * 4034 * @param request The request object containing all of the parameters for the API call. 4035 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4036 */ deleteTag(DeleteTagRequest request)4037 public final void deleteTag(DeleteTagRequest request) { 4038 deleteTagCallable().call(request); 4039 } 4040 4041 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4042 /** 4043 * Deletes a tag. 4044 * 4045 * <p>Sample code: 4046 * 4047 * <pre>{@code 4048 * // This snippet has been automatically generated and should be regarded as a code template only. 4049 * // It will require modifications to work: 4050 * // - It may require correct/in-range values for request initialization. 4051 * // - It may require specifying regional endpoints when creating the service client as shown in 4052 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4053 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4054 * DeleteTagRequest request = 4055 * DeleteTagRequest.newBuilder() 4056 * .setName( 4057 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4058 * .build(); 4059 * ApiFuture<Empty> future = dataCatalogClient.deleteTagCallable().futureCall(request); 4060 * // Do something. 4061 * future.get(); 4062 * } 4063 * }</pre> 4064 */ deleteTagCallable()4065 public final UnaryCallable<DeleteTagRequest, Empty> deleteTagCallable() { 4066 return stub.deleteTagCallable(); 4067 } 4068 4069 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4070 /** 4071 * Lists tags assigned to an [Entry][google.cloud.datacatalog.v1.Entry]. The 4072 * [columns][google.cloud.datacatalog.v1.Tag.column] in the response are lowercased. 4073 * 4074 * <p>Sample code: 4075 * 4076 * <pre>{@code 4077 * // This snippet has been automatically generated and should be regarded as a code template only. 4078 * // It will require modifications to work: 4079 * // - It may require correct/in-range values for request initialization. 4080 * // - It may require specifying regional endpoints when creating the service client as shown in 4081 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4082 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4083 * EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 4084 * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) { 4085 * // doThingsWith(element); 4086 * } 4087 * } 4088 * }</pre> 4089 * 4090 * @param parent Required. The name of the Data Catalog resource to list the tags of. 4091 * <p>The resource can be an [Entry][google.cloud.datacatalog.v1.Entry] or an 4092 * [EntryGroup][google.cloud.datacatalog.v1.EntryGroup] (without `/entries/{entries}` at the 4093 * end). 4094 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4095 */ listTags(EntryName parent)4096 public final ListTagsPagedResponse listTags(EntryName parent) { 4097 ListTagsRequest request = 4098 ListTagsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); 4099 return listTags(request); 4100 } 4101 4102 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4103 /** 4104 * Lists tags assigned to an [Entry][google.cloud.datacatalog.v1.Entry]. The 4105 * [columns][google.cloud.datacatalog.v1.Tag.column] in the response are lowercased. 4106 * 4107 * <p>Sample code: 4108 * 4109 * <pre>{@code 4110 * // This snippet has been automatically generated and should be regarded as a code template only. 4111 * // It will require modifications to work: 4112 * // - It may require correct/in-range values for request initialization. 4113 * // - It may require specifying regional endpoints when creating the service client as shown in 4114 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4115 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4116 * String parent = 4117 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 4118 * for (Tag element : dataCatalogClient.listTags(parent).iterateAll()) { 4119 * // doThingsWith(element); 4120 * } 4121 * } 4122 * }</pre> 4123 * 4124 * @param parent Required. The name of the Data Catalog resource to list the tags of. 4125 * <p>The resource can be an [Entry][google.cloud.datacatalog.v1.Entry] or an 4126 * [EntryGroup][google.cloud.datacatalog.v1.EntryGroup] (without `/entries/{entries}` at the 4127 * end). 4128 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4129 */ listTags(String parent)4130 public final ListTagsPagedResponse listTags(String parent) { 4131 ListTagsRequest request = ListTagsRequest.newBuilder().setParent(parent).build(); 4132 return listTags(request); 4133 } 4134 4135 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4136 /** 4137 * Lists tags assigned to an [Entry][google.cloud.datacatalog.v1.Entry]. The 4138 * [columns][google.cloud.datacatalog.v1.Tag.column] in the response are lowercased. 4139 * 4140 * <p>Sample code: 4141 * 4142 * <pre>{@code 4143 * // This snippet has been automatically generated and should be regarded as a code template only. 4144 * // It will require modifications to work: 4145 * // - It may require correct/in-range values for request initialization. 4146 * // - It may require specifying regional endpoints when creating the service client as shown in 4147 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4148 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4149 * ListTagsRequest request = 4150 * ListTagsRequest.newBuilder() 4151 * .setParent( 4152 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4153 * .setPageSize(883849137) 4154 * .setPageToken("pageToken873572522") 4155 * .build(); 4156 * for (Tag element : dataCatalogClient.listTags(request).iterateAll()) { 4157 * // doThingsWith(element); 4158 * } 4159 * } 4160 * }</pre> 4161 * 4162 * @param request The request object containing all of the parameters for the API call. 4163 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4164 */ listTags(ListTagsRequest request)4165 public final ListTagsPagedResponse listTags(ListTagsRequest request) { 4166 return listTagsPagedCallable().call(request); 4167 } 4168 4169 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4170 /** 4171 * Lists tags assigned to an [Entry][google.cloud.datacatalog.v1.Entry]. The 4172 * [columns][google.cloud.datacatalog.v1.Tag.column] in the response are lowercased. 4173 * 4174 * <p>Sample code: 4175 * 4176 * <pre>{@code 4177 * // This snippet has been automatically generated and should be regarded as a code template only. 4178 * // It will require modifications to work: 4179 * // - It may require correct/in-range values for request initialization. 4180 * // - It may require specifying regional endpoints when creating the service client as shown in 4181 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4182 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4183 * ListTagsRequest request = 4184 * ListTagsRequest.newBuilder() 4185 * .setParent( 4186 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4187 * .setPageSize(883849137) 4188 * .setPageToken("pageToken873572522") 4189 * .build(); 4190 * ApiFuture<Tag> future = dataCatalogClient.listTagsPagedCallable().futureCall(request); 4191 * // Do something. 4192 * for (Tag element : future.get().iterateAll()) { 4193 * // doThingsWith(element); 4194 * } 4195 * } 4196 * }</pre> 4197 */ listTagsPagedCallable()4198 public final UnaryCallable<ListTagsRequest, ListTagsPagedResponse> listTagsPagedCallable() { 4199 return stub.listTagsPagedCallable(); 4200 } 4201 4202 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4203 /** 4204 * Lists tags assigned to an [Entry][google.cloud.datacatalog.v1.Entry]. The 4205 * [columns][google.cloud.datacatalog.v1.Tag.column] in the response are lowercased. 4206 * 4207 * <p>Sample code: 4208 * 4209 * <pre>{@code 4210 * // This snippet has been automatically generated and should be regarded as a code template only. 4211 * // It will require modifications to work: 4212 * // - It may require correct/in-range values for request initialization. 4213 * // - It may require specifying regional endpoints when creating the service client as shown in 4214 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4215 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4216 * ListTagsRequest request = 4217 * ListTagsRequest.newBuilder() 4218 * .setParent( 4219 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4220 * .setPageSize(883849137) 4221 * .setPageToken("pageToken873572522") 4222 * .build(); 4223 * while (true) { 4224 * ListTagsResponse response = dataCatalogClient.listTagsCallable().call(request); 4225 * for (Tag element : response.getTagsList()) { 4226 * // doThingsWith(element); 4227 * } 4228 * String nextPageToken = response.getNextPageToken(); 4229 * if (!Strings.isNullOrEmpty(nextPageToken)) { 4230 * request = request.toBuilder().setPageToken(nextPageToken).build(); 4231 * } else { 4232 * break; 4233 * } 4234 * } 4235 * } 4236 * }</pre> 4237 */ listTagsCallable()4238 public final UnaryCallable<ListTagsRequest, ListTagsResponse> listTagsCallable() { 4239 return stub.listTagsCallable(); 4240 } 4241 4242 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4243 /** 4244 * `ReconcileTags` creates or updates a list of tags on the entry. If the 4245 * [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] 4246 * parameter is set, the operation deletes tags not included in the input tag list. 4247 * 4248 * <p>`ReconcileTags` returns a [long-running operation] [google.longrunning.Operation] resource 4249 * that can be queried with [Operations.GetOperation][google.longrunning.Operations.GetOperation] 4250 * to return [ReconcileTagsMetadata] [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and a 4251 * [ReconcileTagsResponse] [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. 4252 * 4253 * <p>Sample code: 4254 * 4255 * <pre>{@code 4256 * // This snippet has been automatically generated and should be regarded as a code template only. 4257 * // It will require modifications to work: 4258 * // - It may require correct/in-range values for request initialization. 4259 * // - It may require specifying regional endpoints when creating the service client as shown in 4260 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4261 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4262 * ReconcileTagsRequest request = 4263 * ReconcileTagsRequest.newBuilder() 4264 * .setParent( 4265 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4266 * .setTagTemplate( 4267 * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 4268 * .setForceDeleteMissing(true) 4269 * .addAllTags(new ArrayList<Tag>()) 4270 * .build(); 4271 * ReconcileTagsResponse response = dataCatalogClient.reconcileTagsAsync(request).get(); 4272 * } 4273 * }</pre> 4274 * 4275 * @param request The request object containing all of the parameters for the API call. 4276 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4277 */ reconcileTagsAsync( ReconcileTagsRequest request)4278 public final OperationFuture<ReconcileTagsResponse, ReconcileTagsMetadata> reconcileTagsAsync( 4279 ReconcileTagsRequest request) { 4280 return reconcileTagsOperationCallable().futureCall(request); 4281 } 4282 4283 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4284 /** 4285 * `ReconcileTags` creates or updates a list of tags on the entry. If the 4286 * [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] 4287 * parameter is set, the operation deletes tags not included in the input tag list. 4288 * 4289 * <p>`ReconcileTags` returns a [long-running operation] [google.longrunning.Operation] resource 4290 * that can be queried with [Operations.GetOperation][google.longrunning.Operations.GetOperation] 4291 * to return [ReconcileTagsMetadata] [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and a 4292 * [ReconcileTagsResponse] [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. 4293 * 4294 * <p>Sample code: 4295 * 4296 * <pre>{@code 4297 * // This snippet has been automatically generated and should be regarded as a code template only. 4298 * // It will require modifications to work: 4299 * // - It may require correct/in-range values for request initialization. 4300 * // - It may require specifying regional endpoints when creating the service client as shown in 4301 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4302 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4303 * ReconcileTagsRequest request = 4304 * ReconcileTagsRequest.newBuilder() 4305 * .setParent( 4306 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4307 * .setTagTemplate( 4308 * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 4309 * .setForceDeleteMissing(true) 4310 * .addAllTags(new ArrayList<Tag>()) 4311 * .build(); 4312 * OperationFuture<ReconcileTagsResponse, ReconcileTagsMetadata> future = 4313 * dataCatalogClient.reconcileTagsOperationCallable().futureCall(request); 4314 * // Do something. 4315 * ReconcileTagsResponse response = future.get(); 4316 * } 4317 * }</pre> 4318 */ 4319 public final OperationCallable<ReconcileTagsRequest, ReconcileTagsResponse, ReconcileTagsMetadata> reconcileTagsOperationCallable()4320 reconcileTagsOperationCallable() { 4321 return stub.reconcileTagsOperationCallable(); 4322 } 4323 4324 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4325 /** 4326 * `ReconcileTags` creates or updates a list of tags on the entry. If the 4327 * [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] 4328 * parameter is set, the operation deletes tags not included in the input tag list. 4329 * 4330 * <p>`ReconcileTags` returns a [long-running operation] [google.longrunning.Operation] resource 4331 * that can be queried with [Operations.GetOperation][google.longrunning.Operations.GetOperation] 4332 * to return [ReconcileTagsMetadata] [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and a 4333 * [ReconcileTagsResponse] [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. 4334 * 4335 * <p>Sample code: 4336 * 4337 * <pre>{@code 4338 * // This snippet has been automatically generated and should be regarded as a code template only. 4339 * // It will require modifications to work: 4340 * // - It may require correct/in-range values for request initialization. 4341 * // - It may require specifying regional endpoints when creating the service client as shown in 4342 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4343 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4344 * ReconcileTagsRequest request = 4345 * ReconcileTagsRequest.newBuilder() 4346 * .setParent( 4347 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4348 * .setTagTemplate( 4349 * TagTemplateName.of("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]").toString()) 4350 * .setForceDeleteMissing(true) 4351 * .addAllTags(new ArrayList<Tag>()) 4352 * .build(); 4353 * ApiFuture<Operation> future = dataCatalogClient.reconcileTagsCallable().futureCall(request); 4354 * // Do something. 4355 * Operation response = future.get(); 4356 * } 4357 * }</pre> 4358 */ reconcileTagsCallable()4359 public final UnaryCallable<ReconcileTagsRequest, Operation> reconcileTagsCallable() { 4360 return stub.reconcileTagsCallable(); 4361 } 4362 4363 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4364 /** 4365 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred by the current user. Starring 4366 * information is private to each user. 4367 * 4368 * <p>Sample code: 4369 * 4370 * <pre>{@code 4371 * // This snippet has been automatically generated and should be regarded as a code template only. 4372 * // It will require modifications to work: 4373 * // - It may require correct/in-range values for request initialization. 4374 * // - It may require specifying regional endpoints when creating the service client as shown in 4375 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4376 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4377 * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 4378 * StarEntryResponse response = dataCatalogClient.starEntry(name); 4379 * } 4380 * }</pre> 4381 * 4382 * @param name Required. The name of the entry to mark as starred. 4383 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4384 */ starEntry(EntryName name)4385 public final StarEntryResponse starEntry(EntryName name) { 4386 StarEntryRequest request = 4387 StarEntryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 4388 return starEntry(request); 4389 } 4390 4391 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4392 /** 4393 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred by the current user. Starring 4394 * information is private to each user. 4395 * 4396 * <p>Sample code: 4397 * 4398 * <pre>{@code 4399 * // This snippet has been automatically generated and should be regarded as a code template only. 4400 * // It will require modifications to work: 4401 * // - It may require correct/in-range values for request initialization. 4402 * // - It may require specifying regional endpoints when creating the service client as shown in 4403 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4404 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4405 * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 4406 * StarEntryResponse response = dataCatalogClient.starEntry(name); 4407 * } 4408 * }</pre> 4409 * 4410 * @param name Required. The name of the entry to mark as starred. 4411 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4412 */ starEntry(String name)4413 public final StarEntryResponse starEntry(String name) { 4414 StarEntryRequest request = StarEntryRequest.newBuilder().setName(name).build(); 4415 return starEntry(request); 4416 } 4417 4418 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4419 /** 4420 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred by the current user. Starring 4421 * information is private to each user. 4422 * 4423 * <p>Sample code: 4424 * 4425 * <pre>{@code 4426 * // This snippet has been automatically generated and should be regarded as a code template only. 4427 * // It will require modifications to work: 4428 * // - It may require correct/in-range values for request initialization. 4429 * // - It may require specifying regional endpoints when creating the service client as shown in 4430 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4431 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4432 * StarEntryRequest request = 4433 * StarEntryRequest.newBuilder() 4434 * .setName( 4435 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4436 * .build(); 4437 * StarEntryResponse response = dataCatalogClient.starEntry(request); 4438 * } 4439 * }</pre> 4440 * 4441 * @param request The request object containing all of the parameters for the API call. 4442 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4443 */ starEntry(StarEntryRequest request)4444 public final StarEntryResponse starEntry(StarEntryRequest request) { 4445 return starEntryCallable().call(request); 4446 } 4447 4448 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4449 /** 4450 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred by the current user. Starring 4451 * information is private to each user. 4452 * 4453 * <p>Sample code: 4454 * 4455 * <pre>{@code 4456 * // This snippet has been automatically generated and should be regarded as a code template only. 4457 * // It will require modifications to work: 4458 * // - It may require correct/in-range values for request initialization. 4459 * // - It may require specifying regional endpoints when creating the service client as shown in 4460 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4461 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4462 * StarEntryRequest request = 4463 * StarEntryRequest.newBuilder() 4464 * .setName( 4465 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4466 * .build(); 4467 * ApiFuture<StarEntryResponse> future = 4468 * dataCatalogClient.starEntryCallable().futureCall(request); 4469 * // Do something. 4470 * StarEntryResponse response = future.get(); 4471 * } 4472 * }</pre> 4473 */ starEntryCallable()4474 public final UnaryCallable<StarEntryRequest, StarEntryResponse> starEntryCallable() { 4475 return stub.starEntryCallable(); 4476 } 4477 4478 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4479 /** 4480 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT starred by the current user. 4481 * Starring information is private to each user. 4482 * 4483 * <p>Sample code: 4484 * 4485 * <pre>{@code 4486 * // This snippet has been automatically generated and should be regarded as a code template only. 4487 * // It will require modifications to work: 4488 * // - It may require correct/in-range values for request initialization. 4489 * // - It may require specifying regional endpoints when creating the service client as shown in 4490 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4491 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4492 * EntryName name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 4493 * UnstarEntryResponse response = dataCatalogClient.unstarEntry(name); 4494 * } 4495 * }</pre> 4496 * 4497 * @param name Required. The name of the entry to mark as **not** starred. 4498 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4499 */ unstarEntry(EntryName name)4500 public final UnstarEntryResponse unstarEntry(EntryName name) { 4501 UnstarEntryRequest request = 4502 UnstarEntryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 4503 return unstarEntry(request); 4504 } 4505 4506 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4507 /** 4508 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT starred by the current user. 4509 * Starring information is private to each user. 4510 * 4511 * <p>Sample code: 4512 * 4513 * <pre>{@code 4514 * // This snippet has been automatically generated and should be regarded as a code template only. 4515 * // It will require modifications to work: 4516 * // - It may require correct/in-range values for request initialization. 4517 * // - It may require specifying regional endpoints when creating the service client as shown in 4518 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4519 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4520 * String name = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 4521 * UnstarEntryResponse response = dataCatalogClient.unstarEntry(name); 4522 * } 4523 * }</pre> 4524 * 4525 * @param name Required. The name of the entry to mark as **not** starred. 4526 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4527 */ unstarEntry(String name)4528 public final UnstarEntryResponse unstarEntry(String name) { 4529 UnstarEntryRequest request = UnstarEntryRequest.newBuilder().setName(name).build(); 4530 return unstarEntry(request); 4531 } 4532 4533 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4534 /** 4535 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT starred by the current user. 4536 * Starring information is private to each user. 4537 * 4538 * <p>Sample code: 4539 * 4540 * <pre>{@code 4541 * // This snippet has been automatically generated and should be regarded as a code template only. 4542 * // It will require modifications to work: 4543 * // - It may require correct/in-range values for request initialization. 4544 * // - It may require specifying regional endpoints when creating the service client as shown in 4545 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4546 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4547 * UnstarEntryRequest request = 4548 * UnstarEntryRequest.newBuilder() 4549 * .setName( 4550 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4551 * .build(); 4552 * UnstarEntryResponse response = dataCatalogClient.unstarEntry(request); 4553 * } 4554 * }</pre> 4555 * 4556 * @param request The request object containing all of the parameters for the API call. 4557 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4558 */ unstarEntry(UnstarEntryRequest request)4559 public final UnstarEntryResponse unstarEntry(UnstarEntryRequest request) { 4560 return unstarEntryCallable().call(request); 4561 } 4562 4563 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4564 /** 4565 * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT starred by the current user. 4566 * Starring information is private to each user. 4567 * 4568 * <p>Sample code: 4569 * 4570 * <pre>{@code 4571 * // This snippet has been automatically generated and should be regarded as a code template only. 4572 * // It will require modifications to work: 4573 * // - It may require correct/in-range values for request initialization. 4574 * // - It may require specifying regional endpoints when creating the service client as shown in 4575 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4576 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4577 * UnstarEntryRequest request = 4578 * UnstarEntryRequest.newBuilder() 4579 * .setName( 4580 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4581 * .build(); 4582 * ApiFuture<UnstarEntryResponse> future = 4583 * dataCatalogClient.unstarEntryCallable().futureCall(request); 4584 * // Do something. 4585 * UnstarEntryResponse response = future.get(); 4586 * } 4587 * }</pre> 4588 */ unstarEntryCallable()4589 public final UnaryCallable<UnstarEntryRequest, UnstarEntryResponse> unstarEntryCallable() { 4590 return stub.unstarEntryCallable(); 4591 } 4592 4593 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4594 /** 4595 * Sets an access control policy for a resource. Replaces any existing policy. 4596 * 4597 * <p>Supported resources are: 4598 * 4599 * <p>- Tag templates - Entry groups 4600 * 4601 * <p>Note: This method sets policies only within Data Catalog and can't be used to manage 4602 * policies in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform 4603 * resources synced with the Data Catalog. 4604 * 4605 * <p>To call this method, you must have the following Google IAM permissions: 4606 * 4607 * <p>- `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - 4608 * `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. 4609 * 4610 * <p>Sample code: 4611 * 4612 * <pre>{@code 4613 * // This snippet has been automatically generated and should be regarded as a code template only. 4614 * // It will require modifications to work: 4615 * // - It may require correct/in-range values for request initialization. 4616 * // - It may require specifying regional endpoints when creating the service client as shown in 4617 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4618 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4619 * ResourceName resource = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"); 4620 * Policy policy = Policy.newBuilder().build(); 4621 * Policy response = dataCatalogClient.setIamPolicy(resource, policy); 4622 * } 4623 * }</pre> 4624 * 4625 * @param resource REQUIRED: The resource for which the policy is being specified. See the 4626 * operation documentation for the appropriate value for this field. 4627 * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the 4628 * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud 4629 * Platform services (such as Projects) might reject them. 4630 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4631 */ setIamPolicy(ResourceName resource, Policy policy)4632 public final Policy setIamPolicy(ResourceName resource, Policy policy) { 4633 SetIamPolicyRequest request = 4634 SetIamPolicyRequest.newBuilder() 4635 .setResource(resource == null ? null : resource.toString()) 4636 .setPolicy(policy) 4637 .build(); 4638 return setIamPolicy(request); 4639 } 4640 4641 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4642 /** 4643 * Sets an access control policy for a resource. Replaces any existing policy. 4644 * 4645 * <p>Supported resources are: 4646 * 4647 * <p>- Tag templates - Entry groups 4648 * 4649 * <p>Note: This method sets policies only within Data Catalog and can't be used to manage 4650 * policies in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform 4651 * resources synced with the Data Catalog. 4652 * 4653 * <p>To call this method, you must have the following Google IAM permissions: 4654 * 4655 * <p>- `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - 4656 * `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. 4657 * 4658 * <p>Sample code: 4659 * 4660 * <pre>{@code 4661 * // This snippet has been automatically generated and should be regarded as a code template only. 4662 * // It will require modifications to work: 4663 * // - It may require correct/in-range values for request initialization. 4664 * // - It may require specifying regional endpoints when creating the service client as shown in 4665 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4666 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4667 * String resource = 4668 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 4669 * Policy policy = Policy.newBuilder().build(); 4670 * Policy response = dataCatalogClient.setIamPolicy(resource, policy); 4671 * } 4672 * }</pre> 4673 * 4674 * @param resource REQUIRED: The resource for which the policy is being specified. See the 4675 * operation documentation for the appropriate value for this field. 4676 * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the 4677 * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud 4678 * Platform services (such as Projects) might reject them. 4679 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4680 */ setIamPolicy(String resource, Policy policy)4681 public final Policy setIamPolicy(String resource, Policy policy) { 4682 SetIamPolicyRequest request = 4683 SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); 4684 return setIamPolicy(request); 4685 } 4686 4687 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4688 /** 4689 * Sets an access control policy for a resource. Replaces any existing policy. 4690 * 4691 * <p>Supported resources are: 4692 * 4693 * <p>- Tag templates - Entry groups 4694 * 4695 * <p>Note: This method sets policies only within Data Catalog and can't be used to manage 4696 * policies in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform 4697 * resources synced with the Data Catalog. 4698 * 4699 * <p>To call this method, you must have the following Google IAM permissions: 4700 * 4701 * <p>- `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - 4702 * `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. 4703 * 4704 * <p>Sample code: 4705 * 4706 * <pre>{@code 4707 * // This snippet has been automatically generated and should be regarded as a code template only. 4708 * // It will require modifications to work: 4709 * // - It may require correct/in-range values for request initialization. 4710 * // - It may require specifying regional endpoints when creating the service client as shown in 4711 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4712 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4713 * SetIamPolicyRequest request = 4714 * SetIamPolicyRequest.newBuilder() 4715 * .setResource(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 4716 * .setPolicy(Policy.newBuilder().build()) 4717 * .setUpdateMask(FieldMask.newBuilder().build()) 4718 * .build(); 4719 * Policy response = dataCatalogClient.setIamPolicy(request); 4720 * } 4721 * }</pre> 4722 * 4723 * @param request The request object containing all of the parameters for the API call. 4724 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4725 */ setIamPolicy(SetIamPolicyRequest request)4726 public final Policy setIamPolicy(SetIamPolicyRequest request) { 4727 return setIamPolicyCallable().call(request); 4728 } 4729 4730 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4731 /** 4732 * Sets an access control policy for a resource. Replaces any existing policy. 4733 * 4734 * <p>Supported resources are: 4735 * 4736 * <p>- Tag templates - Entry groups 4737 * 4738 * <p>Note: This method sets policies only within Data Catalog and can't be used to manage 4739 * policies in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform 4740 * resources synced with the Data Catalog. 4741 * 4742 * <p>To call this method, you must have the following Google IAM permissions: 4743 * 4744 * <p>- `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - 4745 * `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. 4746 * 4747 * <p>Sample code: 4748 * 4749 * <pre>{@code 4750 * // This snippet has been automatically generated and should be regarded as a code template only. 4751 * // It will require modifications to work: 4752 * // - It may require correct/in-range values for request initialization. 4753 * // - It may require specifying regional endpoints when creating the service client as shown in 4754 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4755 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4756 * SetIamPolicyRequest request = 4757 * SetIamPolicyRequest.newBuilder() 4758 * .setResource(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 4759 * .setPolicy(Policy.newBuilder().build()) 4760 * .setUpdateMask(FieldMask.newBuilder().build()) 4761 * .build(); 4762 * ApiFuture<Policy> future = dataCatalogClient.setIamPolicyCallable().futureCall(request); 4763 * // Do something. 4764 * Policy response = future.get(); 4765 * } 4766 * }</pre> 4767 */ setIamPolicyCallable()4768 public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { 4769 return stub.setIamPolicyCallable(); 4770 } 4771 4772 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4773 /** 4774 * Gets the access control policy for a resource. 4775 * 4776 * <p>May return: 4777 * 4778 * <ul> 4779 * <li>A`NOT_FOUND` error if the resource doesn't exist or you don't have the permission to view 4780 * it. 4781 * <li>An empty policy if the resource exists but doesn't have a set policy. 4782 * </ul> 4783 * 4784 * <p>Supported resources are: 4785 * 4786 * <p>- Tag templates - Entry groups 4787 * 4788 * <p>Note: This method doesn't get policies from Google Cloud Platform resources ingested into 4789 * Data Catalog. 4790 * 4791 * <p>To call this method, you must have the following Google IAM permissions: 4792 * 4793 * <p>- `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - 4794 * `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. 4795 * 4796 * <p>Sample code: 4797 * 4798 * <pre>{@code 4799 * // This snippet has been automatically generated and should be regarded as a code template only. 4800 * // It will require modifications to work: 4801 * // - It may require correct/in-range values for request initialization. 4802 * // - It may require specifying regional endpoints when creating the service client as shown in 4803 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4804 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4805 * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); 4806 * Policy response = dataCatalogClient.getIamPolicy(resource); 4807 * } 4808 * }</pre> 4809 * 4810 * @param resource REQUIRED: The resource for which the policy is being requested. See the 4811 * operation documentation for the appropriate value for this field. 4812 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4813 */ getIamPolicy(ResourceName resource)4814 public final Policy getIamPolicy(ResourceName resource) { 4815 GetIamPolicyRequest request = 4816 GetIamPolicyRequest.newBuilder() 4817 .setResource(resource == null ? null : resource.toString()) 4818 .build(); 4819 return getIamPolicy(request); 4820 } 4821 4822 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4823 /** 4824 * Gets the access control policy for a resource. 4825 * 4826 * <p>May return: 4827 * 4828 * <ul> 4829 * <li>A`NOT_FOUND` error if the resource doesn't exist or you don't have the permission to view 4830 * it. 4831 * <li>An empty policy if the resource exists but doesn't have a set policy. 4832 * </ul> 4833 * 4834 * <p>Supported resources are: 4835 * 4836 * <p>- Tag templates - Entry groups 4837 * 4838 * <p>Note: This method doesn't get policies from Google Cloud Platform resources ingested into 4839 * Data Catalog. 4840 * 4841 * <p>To call this method, you must have the following Google IAM permissions: 4842 * 4843 * <p>- `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - 4844 * `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. 4845 * 4846 * <p>Sample code: 4847 * 4848 * <pre>{@code 4849 * // This snippet has been automatically generated and should be regarded as a code template only. 4850 * // It will require modifications to work: 4851 * // - It may require correct/in-range values for request initialization. 4852 * // - It may require specifying regional endpoints when creating the service client as shown in 4853 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4854 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4855 * String resource = 4856 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString(); 4857 * Policy response = dataCatalogClient.getIamPolicy(resource); 4858 * } 4859 * }</pre> 4860 * 4861 * @param resource REQUIRED: The resource for which the policy is being requested. See the 4862 * operation documentation for the appropriate value for this field. 4863 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4864 */ getIamPolicy(String resource)4865 public final Policy getIamPolicy(String resource) { 4866 GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); 4867 return getIamPolicy(request); 4868 } 4869 4870 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4871 /** 4872 * Gets the access control policy for a resource. 4873 * 4874 * <p>May return: 4875 * 4876 * <ul> 4877 * <li>A`NOT_FOUND` error if the resource doesn't exist or you don't have the permission to view 4878 * it. 4879 * <li>An empty policy if the resource exists but doesn't have a set policy. 4880 * </ul> 4881 * 4882 * <p>Supported resources are: 4883 * 4884 * <p>- Tag templates - Entry groups 4885 * 4886 * <p>Note: This method doesn't get policies from Google Cloud Platform resources ingested into 4887 * Data Catalog. 4888 * 4889 * <p>To call this method, you must have the following Google IAM permissions: 4890 * 4891 * <p>- `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - 4892 * `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. 4893 * 4894 * <p>Sample code: 4895 * 4896 * <pre>{@code 4897 * // This snippet has been automatically generated and should be regarded as a code template only. 4898 * // It will require modifications to work: 4899 * // - It may require correct/in-range values for request initialization. 4900 * // - It may require specifying regional endpoints when creating the service client as shown in 4901 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4902 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4903 * GetIamPolicyRequest request = 4904 * GetIamPolicyRequest.newBuilder() 4905 * .setResource( 4906 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4907 * .setOptions(GetPolicyOptions.newBuilder().build()) 4908 * .build(); 4909 * Policy response = dataCatalogClient.getIamPolicy(request); 4910 * } 4911 * }</pre> 4912 * 4913 * @param request The request object containing all of the parameters for the API call. 4914 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4915 */ getIamPolicy(GetIamPolicyRequest request)4916 public final Policy getIamPolicy(GetIamPolicyRequest request) { 4917 return getIamPolicyCallable().call(request); 4918 } 4919 4920 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4921 /** 4922 * Gets the access control policy for a resource. 4923 * 4924 * <p>May return: 4925 * 4926 * <ul> 4927 * <li>A`NOT_FOUND` error if the resource doesn't exist or you don't have the permission to view 4928 * it. 4929 * <li>An empty policy if the resource exists but doesn't have a set policy. 4930 * </ul> 4931 * 4932 * <p>Supported resources are: 4933 * 4934 * <p>- Tag templates - Entry groups 4935 * 4936 * <p>Note: This method doesn't get policies from Google Cloud Platform resources ingested into 4937 * Data Catalog. 4938 * 4939 * <p>To call this method, you must have the following Google IAM permissions: 4940 * 4941 * <p>- `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - 4942 * `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. 4943 * 4944 * <p>Sample code: 4945 * 4946 * <pre>{@code 4947 * // This snippet has been automatically generated and should be regarded as a code template only. 4948 * // It will require modifications to work: 4949 * // - It may require correct/in-range values for request initialization. 4950 * // - It may require specifying regional endpoints when creating the service client as shown in 4951 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4952 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4953 * GetIamPolicyRequest request = 4954 * GetIamPolicyRequest.newBuilder() 4955 * .setResource( 4956 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4957 * .setOptions(GetPolicyOptions.newBuilder().build()) 4958 * .build(); 4959 * ApiFuture<Policy> future = dataCatalogClient.getIamPolicyCallable().futureCall(request); 4960 * // Do something. 4961 * Policy response = future.get(); 4962 * } 4963 * }</pre> 4964 */ getIamPolicyCallable()4965 public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { 4966 return stub.getIamPolicyCallable(); 4967 } 4968 4969 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4970 /** 4971 * Gets your permissions on a resource. 4972 * 4973 * <p>Returns an empty set of permissions if the resource doesn't exist. 4974 * 4975 * <p>Supported resources are: 4976 * 4977 * <p>- Tag templates - Entry groups 4978 * 4979 * <p>Note: This method gets policies only within Data Catalog and can't be used to get policies 4980 * from BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform resources 4981 * ingested into Data Catalog. 4982 * 4983 * <p>No Google IAM permissions are required to call this method. 4984 * 4985 * <p>Sample code: 4986 * 4987 * <pre>{@code 4988 * // This snippet has been automatically generated and should be regarded as a code template only. 4989 * // It will require modifications to work: 4990 * // - It may require correct/in-range values for request initialization. 4991 * // - It may require specifying regional endpoints when creating the service client as shown in 4992 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4993 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 4994 * TestIamPermissionsRequest request = 4995 * TestIamPermissionsRequest.newBuilder() 4996 * .setResource( 4997 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 4998 * .addAllPermissions(new ArrayList<String>()) 4999 * .build(); 5000 * TestIamPermissionsResponse response = dataCatalogClient.testIamPermissions(request); 5001 * } 5002 * }</pre> 5003 * 5004 * @param request The request object containing all of the parameters for the API call. 5005 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5006 */ testIamPermissions(TestIamPermissionsRequest request)5007 public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { 5008 return testIamPermissionsCallable().call(request); 5009 } 5010 5011 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5012 /** 5013 * Gets your permissions on a resource. 5014 * 5015 * <p>Returns an empty set of permissions if the resource doesn't exist. 5016 * 5017 * <p>Supported resources are: 5018 * 5019 * <p>- Tag templates - Entry groups 5020 * 5021 * <p>Note: This method gets policies only within Data Catalog and can't be used to get policies 5022 * from BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud Platform resources 5023 * ingested into Data Catalog. 5024 * 5025 * <p>No Google IAM permissions are required to call this method. 5026 * 5027 * <p>Sample code: 5028 * 5029 * <pre>{@code 5030 * // This snippet has been automatically generated and should be regarded as a code template only. 5031 * // It will require modifications to work: 5032 * // - It may require correct/in-range values for request initialization. 5033 * // - It may require specifying regional endpoints when creating the service client as shown in 5034 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5035 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 5036 * TestIamPermissionsRequest request = 5037 * TestIamPermissionsRequest.newBuilder() 5038 * .setResource( 5039 * EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString()) 5040 * .addAllPermissions(new ArrayList<String>()) 5041 * .build(); 5042 * ApiFuture<TestIamPermissionsResponse> future = 5043 * dataCatalogClient.testIamPermissionsCallable().futureCall(request); 5044 * // Do something. 5045 * TestIamPermissionsResponse response = future.get(); 5046 * } 5047 * }</pre> 5048 */ 5049 public final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsCallable()5050 testIamPermissionsCallable() { 5051 return stub.testIamPermissionsCallable(); 5052 } 5053 5054 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5055 /** 5056 * Imports entries from a source, such as data previously dumped into a Cloud Storage bucket, into 5057 * Data Catalog. Import of entries is a sync operation that reconciles the state of the 5058 * third-party system with the Data Catalog. 5059 * 5060 * <p>`ImportEntries` accepts source data snapshots of a third-party system. Snapshot should be 5061 * delivered as a .wire or base65-encoded .txt file containing a sequence of Protocol Buffer 5062 * messages of [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. 5063 * 5064 * <p>`ImportEntries` returns a [long-running operation] [google.longrunning.Operation] resource 5065 * that can be queried with [Operations.GetOperation][google.longrunning.Operations.GetOperation] 5066 * to return [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] and an 5067 * [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] message. 5068 * 5069 * <p>Sample code: 5070 * 5071 * <pre>{@code 5072 * // This snippet has been automatically generated and should be regarded as a code template only. 5073 * // It will require modifications to work: 5074 * // - It may require correct/in-range values for request initialization. 5075 * // - It may require specifying regional endpoints when creating the service client as shown in 5076 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5077 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 5078 * ImportEntriesRequest request = 5079 * ImportEntriesRequest.newBuilder() 5080 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 5081 * .build(); 5082 * ImportEntriesResponse response = dataCatalogClient.importEntriesAsync(request).get(); 5083 * } 5084 * }</pre> 5085 * 5086 * @param request The request object containing all of the parameters for the API call. 5087 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 5088 */ importEntriesAsync( ImportEntriesRequest request)5089 public final OperationFuture<ImportEntriesResponse, ImportEntriesMetadata> importEntriesAsync( 5090 ImportEntriesRequest request) { 5091 return importEntriesOperationCallable().futureCall(request); 5092 } 5093 5094 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5095 /** 5096 * Imports entries from a source, such as data previously dumped into a Cloud Storage bucket, into 5097 * Data Catalog. Import of entries is a sync operation that reconciles the state of the 5098 * third-party system with the Data Catalog. 5099 * 5100 * <p>`ImportEntries` accepts source data snapshots of a third-party system. Snapshot should be 5101 * delivered as a .wire or base65-encoded .txt file containing a sequence of Protocol Buffer 5102 * messages of [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. 5103 * 5104 * <p>`ImportEntries` returns a [long-running operation] [google.longrunning.Operation] resource 5105 * that can be queried with [Operations.GetOperation][google.longrunning.Operations.GetOperation] 5106 * to return [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] and an 5107 * [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] message. 5108 * 5109 * <p>Sample code: 5110 * 5111 * <pre>{@code 5112 * // This snippet has been automatically generated and should be regarded as a code template only. 5113 * // It will require modifications to work: 5114 * // - It may require correct/in-range values for request initialization. 5115 * // - It may require specifying regional endpoints when creating the service client as shown in 5116 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5117 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 5118 * ImportEntriesRequest request = 5119 * ImportEntriesRequest.newBuilder() 5120 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 5121 * .build(); 5122 * OperationFuture<ImportEntriesResponse, ImportEntriesMetadata> future = 5123 * dataCatalogClient.importEntriesOperationCallable().futureCall(request); 5124 * // Do something. 5125 * ImportEntriesResponse response = future.get(); 5126 * } 5127 * }</pre> 5128 */ 5129 public final OperationCallable<ImportEntriesRequest, ImportEntriesResponse, ImportEntriesMetadata> importEntriesOperationCallable()5130 importEntriesOperationCallable() { 5131 return stub.importEntriesOperationCallable(); 5132 } 5133 5134 // AUTO-GENERATED DOCUMENTATION AND METHOD. 5135 /** 5136 * Imports entries from a source, such as data previously dumped into a Cloud Storage bucket, into 5137 * Data Catalog. Import of entries is a sync operation that reconciles the state of the 5138 * third-party system with the Data Catalog. 5139 * 5140 * <p>`ImportEntries` accepts source data snapshots of a third-party system. Snapshot should be 5141 * delivered as a .wire or base65-encoded .txt file containing a sequence of Protocol Buffer 5142 * messages of [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. 5143 * 5144 * <p>`ImportEntries` returns a [long-running operation] [google.longrunning.Operation] resource 5145 * that can be queried with [Operations.GetOperation][google.longrunning.Operations.GetOperation] 5146 * to return [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] and an 5147 * [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] message. 5148 * 5149 * <p>Sample code: 5150 * 5151 * <pre>{@code 5152 * // This snippet has been automatically generated and should be regarded as a code template only. 5153 * // It will require modifications to work: 5154 * // - It may require correct/in-range values for request initialization. 5155 * // - It may require specifying regional endpoints when creating the service client as shown in 5156 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 5157 * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { 5158 * ImportEntriesRequest request = 5159 * ImportEntriesRequest.newBuilder() 5160 * .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString()) 5161 * .build(); 5162 * ApiFuture<Operation> future = dataCatalogClient.importEntriesCallable().futureCall(request); 5163 * // Do something. 5164 * Operation response = future.get(); 5165 * } 5166 * }</pre> 5167 */ importEntriesCallable()5168 public final UnaryCallable<ImportEntriesRequest, Operation> importEntriesCallable() { 5169 return stub.importEntriesCallable(); 5170 } 5171 5172 @Override close()5173 public final void close() { 5174 stub.close(); 5175 } 5176 5177 @Override shutdown()5178 public void shutdown() { 5179 stub.shutdown(); 5180 } 5181 5182 @Override isShutdown()5183 public boolean isShutdown() { 5184 return stub.isShutdown(); 5185 } 5186 5187 @Override isTerminated()5188 public boolean isTerminated() { 5189 return stub.isTerminated(); 5190 } 5191 5192 @Override shutdownNow()5193 public void shutdownNow() { 5194 stub.shutdownNow(); 5195 } 5196 5197 @Override awaitTermination(long duration, TimeUnit unit)5198 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 5199 return stub.awaitTermination(duration, unit); 5200 } 5201 5202 public static class SearchCatalogPagedResponse 5203 extends AbstractPagedListResponse< 5204 SearchCatalogRequest, 5205 SearchCatalogResponse, 5206 SearchCatalogResult, 5207 SearchCatalogPage, 5208 SearchCatalogFixedSizeCollection> { 5209 createAsync( PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, ApiFuture<SearchCatalogResponse> futureResponse)5210 public static ApiFuture<SearchCatalogPagedResponse> createAsync( 5211 PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, 5212 ApiFuture<SearchCatalogResponse> futureResponse) { 5213 ApiFuture<SearchCatalogPage> futurePage = 5214 SearchCatalogPage.createEmptyPage().createPageAsync(context, futureResponse); 5215 return ApiFutures.transform( 5216 futurePage, 5217 input -> new SearchCatalogPagedResponse(input), 5218 MoreExecutors.directExecutor()); 5219 } 5220 SearchCatalogPagedResponse(SearchCatalogPage page)5221 private SearchCatalogPagedResponse(SearchCatalogPage page) { 5222 super(page, SearchCatalogFixedSizeCollection.createEmptyCollection()); 5223 } 5224 } 5225 5226 public static class SearchCatalogPage 5227 extends AbstractPage< 5228 SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult, SearchCatalogPage> { 5229 SearchCatalogPage( PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, SearchCatalogResponse response)5230 private SearchCatalogPage( 5231 PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, 5232 SearchCatalogResponse response) { 5233 super(context, response); 5234 } 5235 createEmptyPage()5236 private static SearchCatalogPage createEmptyPage() { 5237 return new SearchCatalogPage(null, null); 5238 } 5239 5240 @Override createPage( PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, SearchCatalogResponse response)5241 protected SearchCatalogPage createPage( 5242 PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, 5243 SearchCatalogResponse response) { 5244 return new SearchCatalogPage(context, response); 5245 } 5246 5247 @Override createPageAsync( PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, ApiFuture<SearchCatalogResponse> futureResponse)5248 public ApiFuture<SearchCatalogPage> createPageAsync( 5249 PageContext<SearchCatalogRequest, SearchCatalogResponse, SearchCatalogResult> context, 5250 ApiFuture<SearchCatalogResponse> futureResponse) { 5251 return super.createPageAsync(context, futureResponse); 5252 } 5253 } 5254 5255 public static class SearchCatalogFixedSizeCollection 5256 extends AbstractFixedSizeCollection< 5257 SearchCatalogRequest, 5258 SearchCatalogResponse, 5259 SearchCatalogResult, 5260 SearchCatalogPage, 5261 SearchCatalogFixedSizeCollection> { 5262 SearchCatalogFixedSizeCollection(List<SearchCatalogPage> pages, int collectionSize)5263 private SearchCatalogFixedSizeCollection(List<SearchCatalogPage> pages, int collectionSize) { 5264 super(pages, collectionSize); 5265 } 5266 createEmptyCollection()5267 private static SearchCatalogFixedSizeCollection createEmptyCollection() { 5268 return new SearchCatalogFixedSizeCollection(null, 0); 5269 } 5270 5271 @Override createCollection( List<SearchCatalogPage> pages, int collectionSize)5272 protected SearchCatalogFixedSizeCollection createCollection( 5273 List<SearchCatalogPage> pages, int collectionSize) { 5274 return new SearchCatalogFixedSizeCollection(pages, collectionSize); 5275 } 5276 } 5277 5278 public static class ListEntryGroupsPagedResponse 5279 extends AbstractPagedListResponse< 5280 ListEntryGroupsRequest, 5281 ListEntryGroupsResponse, 5282 EntryGroup, 5283 ListEntryGroupsPage, 5284 ListEntryGroupsFixedSizeCollection> { 5285 createAsync( PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, ApiFuture<ListEntryGroupsResponse> futureResponse)5286 public static ApiFuture<ListEntryGroupsPagedResponse> createAsync( 5287 PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, 5288 ApiFuture<ListEntryGroupsResponse> futureResponse) { 5289 ApiFuture<ListEntryGroupsPage> futurePage = 5290 ListEntryGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); 5291 return ApiFutures.transform( 5292 futurePage, 5293 input -> new ListEntryGroupsPagedResponse(input), 5294 MoreExecutors.directExecutor()); 5295 } 5296 ListEntryGroupsPagedResponse(ListEntryGroupsPage page)5297 private ListEntryGroupsPagedResponse(ListEntryGroupsPage page) { 5298 super(page, ListEntryGroupsFixedSizeCollection.createEmptyCollection()); 5299 } 5300 } 5301 5302 public static class ListEntryGroupsPage 5303 extends AbstractPage< 5304 ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup, ListEntryGroupsPage> { 5305 ListEntryGroupsPage( PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, ListEntryGroupsResponse response)5306 private ListEntryGroupsPage( 5307 PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, 5308 ListEntryGroupsResponse response) { 5309 super(context, response); 5310 } 5311 createEmptyPage()5312 private static ListEntryGroupsPage createEmptyPage() { 5313 return new ListEntryGroupsPage(null, null); 5314 } 5315 5316 @Override createPage( PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, ListEntryGroupsResponse response)5317 protected ListEntryGroupsPage createPage( 5318 PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, 5319 ListEntryGroupsResponse response) { 5320 return new ListEntryGroupsPage(context, response); 5321 } 5322 5323 @Override createPageAsync( PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, ApiFuture<ListEntryGroupsResponse> futureResponse)5324 public ApiFuture<ListEntryGroupsPage> createPageAsync( 5325 PageContext<ListEntryGroupsRequest, ListEntryGroupsResponse, EntryGroup> context, 5326 ApiFuture<ListEntryGroupsResponse> futureResponse) { 5327 return super.createPageAsync(context, futureResponse); 5328 } 5329 } 5330 5331 public static class ListEntryGroupsFixedSizeCollection 5332 extends AbstractFixedSizeCollection< 5333 ListEntryGroupsRequest, 5334 ListEntryGroupsResponse, 5335 EntryGroup, 5336 ListEntryGroupsPage, 5337 ListEntryGroupsFixedSizeCollection> { 5338 ListEntryGroupsFixedSizeCollection( List<ListEntryGroupsPage> pages, int collectionSize)5339 private ListEntryGroupsFixedSizeCollection( 5340 List<ListEntryGroupsPage> pages, int collectionSize) { 5341 super(pages, collectionSize); 5342 } 5343 createEmptyCollection()5344 private static ListEntryGroupsFixedSizeCollection createEmptyCollection() { 5345 return new ListEntryGroupsFixedSizeCollection(null, 0); 5346 } 5347 5348 @Override createCollection( List<ListEntryGroupsPage> pages, int collectionSize)5349 protected ListEntryGroupsFixedSizeCollection createCollection( 5350 List<ListEntryGroupsPage> pages, int collectionSize) { 5351 return new ListEntryGroupsFixedSizeCollection(pages, collectionSize); 5352 } 5353 } 5354 5355 public static class ListEntriesPagedResponse 5356 extends AbstractPagedListResponse< 5357 ListEntriesRequest, 5358 ListEntriesResponse, 5359 Entry, 5360 ListEntriesPage, 5361 ListEntriesFixedSizeCollection> { 5362 createAsync( PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, ApiFuture<ListEntriesResponse> futureResponse)5363 public static ApiFuture<ListEntriesPagedResponse> createAsync( 5364 PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, 5365 ApiFuture<ListEntriesResponse> futureResponse) { 5366 ApiFuture<ListEntriesPage> futurePage = 5367 ListEntriesPage.createEmptyPage().createPageAsync(context, futureResponse); 5368 return ApiFutures.transform( 5369 futurePage, input -> new ListEntriesPagedResponse(input), MoreExecutors.directExecutor()); 5370 } 5371 ListEntriesPagedResponse(ListEntriesPage page)5372 private ListEntriesPagedResponse(ListEntriesPage page) { 5373 super(page, ListEntriesFixedSizeCollection.createEmptyCollection()); 5374 } 5375 } 5376 5377 public static class ListEntriesPage 5378 extends AbstractPage<ListEntriesRequest, ListEntriesResponse, Entry, ListEntriesPage> { 5379 ListEntriesPage( PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, ListEntriesResponse response)5380 private ListEntriesPage( 5381 PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, 5382 ListEntriesResponse response) { 5383 super(context, response); 5384 } 5385 createEmptyPage()5386 private static ListEntriesPage createEmptyPage() { 5387 return new ListEntriesPage(null, null); 5388 } 5389 5390 @Override createPage( PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, ListEntriesResponse response)5391 protected ListEntriesPage createPage( 5392 PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, 5393 ListEntriesResponse response) { 5394 return new ListEntriesPage(context, response); 5395 } 5396 5397 @Override createPageAsync( PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, ApiFuture<ListEntriesResponse> futureResponse)5398 public ApiFuture<ListEntriesPage> createPageAsync( 5399 PageContext<ListEntriesRequest, ListEntriesResponse, Entry> context, 5400 ApiFuture<ListEntriesResponse> futureResponse) { 5401 return super.createPageAsync(context, futureResponse); 5402 } 5403 } 5404 5405 public static class ListEntriesFixedSizeCollection 5406 extends AbstractFixedSizeCollection< 5407 ListEntriesRequest, 5408 ListEntriesResponse, 5409 Entry, 5410 ListEntriesPage, 5411 ListEntriesFixedSizeCollection> { 5412 ListEntriesFixedSizeCollection(List<ListEntriesPage> pages, int collectionSize)5413 private ListEntriesFixedSizeCollection(List<ListEntriesPage> pages, int collectionSize) { 5414 super(pages, collectionSize); 5415 } 5416 createEmptyCollection()5417 private static ListEntriesFixedSizeCollection createEmptyCollection() { 5418 return new ListEntriesFixedSizeCollection(null, 0); 5419 } 5420 5421 @Override createCollection( List<ListEntriesPage> pages, int collectionSize)5422 protected ListEntriesFixedSizeCollection createCollection( 5423 List<ListEntriesPage> pages, int collectionSize) { 5424 return new ListEntriesFixedSizeCollection(pages, collectionSize); 5425 } 5426 } 5427 5428 public static class ListTagsPagedResponse 5429 extends AbstractPagedListResponse< 5430 ListTagsRequest, ListTagsResponse, Tag, ListTagsPage, ListTagsFixedSizeCollection> { 5431 createAsync( PageContext<ListTagsRequest, ListTagsResponse, Tag> context, ApiFuture<ListTagsResponse> futureResponse)5432 public static ApiFuture<ListTagsPagedResponse> createAsync( 5433 PageContext<ListTagsRequest, ListTagsResponse, Tag> context, 5434 ApiFuture<ListTagsResponse> futureResponse) { 5435 ApiFuture<ListTagsPage> futurePage = 5436 ListTagsPage.createEmptyPage().createPageAsync(context, futureResponse); 5437 return ApiFutures.transform( 5438 futurePage, input -> new ListTagsPagedResponse(input), MoreExecutors.directExecutor()); 5439 } 5440 ListTagsPagedResponse(ListTagsPage page)5441 private ListTagsPagedResponse(ListTagsPage page) { 5442 super(page, ListTagsFixedSizeCollection.createEmptyCollection()); 5443 } 5444 } 5445 5446 public static class ListTagsPage 5447 extends AbstractPage<ListTagsRequest, ListTagsResponse, Tag, ListTagsPage> { 5448 ListTagsPage( PageContext<ListTagsRequest, ListTagsResponse, Tag> context, ListTagsResponse response)5449 private ListTagsPage( 5450 PageContext<ListTagsRequest, ListTagsResponse, Tag> context, ListTagsResponse response) { 5451 super(context, response); 5452 } 5453 createEmptyPage()5454 private static ListTagsPage createEmptyPage() { 5455 return new ListTagsPage(null, null); 5456 } 5457 5458 @Override createPage( PageContext<ListTagsRequest, ListTagsResponse, Tag> context, ListTagsResponse response)5459 protected ListTagsPage createPage( 5460 PageContext<ListTagsRequest, ListTagsResponse, Tag> context, ListTagsResponse response) { 5461 return new ListTagsPage(context, response); 5462 } 5463 5464 @Override createPageAsync( PageContext<ListTagsRequest, ListTagsResponse, Tag> context, ApiFuture<ListTagsResponse> futureResponse)5465 public ApiFuture<ListTagsPage> createPageAsync( 5466 PageContext<ListTagsRequest, ListTagsResponse, Tag> context, 5467 ApiFuture<ListTagsResponse> futureResponse) { 5468 return super.createPageAsync(context, futureResponse); 5469 } 5470 } 5471 5472 public static class ListTagsFixedSizeCollection 5473 extends AbstractFixedSizeCollection< 5474 ListTagsRequest, ListTagsResponse, Tag, ListTagsPage, ListTagsFixedSizeCollection> { 5475 ListTagsFixedSizeCollection(List<ListTagsPage> pages, int collectionSize)5476 private ListTagsFixedSizeCollection(List<ListTagsPage> pages, int collectionSize) { 5477 super(pages, collectionSize); 5478 } 5479 createEmptyCollection()5480 private static ListTagsFixedSizeCollection createEmptyCollection() { 5481 return new ListTagsFixedSizeCollection(null, 0); 5482 } 5483 5484 @Override createCollection( List<ListTagsPage> pages, int collectionSize)5485 protected ListTagsFixedSizeCollection createCollection( 5486 List<ListTagsPage> pages, int collectionSize) { 5487 return new ListTagsFixedSizeCollection(pages, collectionSize); 5488 } 5489 } 5490 } 5491