Class CatalogServiceClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @BetaApi
    @Generated("by gapic-generator-java")
    public class CatalogServiceClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: Service for ingesting catalog information of the customer's website.

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

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
       CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
       CatalogItem catalogItem = CatalogItem.newBuilder().build();
       CatalogItem response = catalogServiceClient.createCatalogItem(parent, catalogItem);
     }
     

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

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

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

    See the individual methods for example code.

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

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

    To customize credentials:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     CatalogServiceSettings catalogServiceSettings =
         CatalogServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
     

    To customize the endpoint:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     CatalogServiceSettings catalogServiceSettings =
         CatalogServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
     

    To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     CatalogServiceSettings catalogServiceSettings =
         CatalogServiceSettings.newHttpJsonBuilder().build();
     CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
     

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

    • Constructor Detail

      • CatalogServiceClient

        protected CatalogServiceClient​(CatalogServiceSettings settings)
                                throws IOException
        Constructs an instance of CatalogServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
        Throws:
        IOException
    • Method Detail

      • create

        public static final CatalogServiceClient create​(CatalogServiceStub stub)
        Constructs an instance of CatalogServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CatalogServiceSettings).
      • getOperationsClient

        public final com.google.longrunning.OperationsClient getOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • getHttpJsonOperationsClient

        @BetaApi
        public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • createCatalogItem

        public final CatalogItem createCatalogItem​(CatalogName parent,
                                                   CatalogItem catalogItem)
        Creates a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
           CatalogItem catalogItem = CatalogItem.newBuilder().build();
           CatalogItem response = catalogServiceClient.createCatalogItem(parent, catalogItem);
         }
         
        Parameters:
        parent - Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.
        catalogItem - Required. The catalog item to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCatalogItem

        public final CatalogItem createCatalogItem​(String parent,
                                                   CatalogItem catalogItem)
        Creates a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
           CatalogItem catalogItem = CatalogItem.newBuilder().build();
           CatalogItem response = catalogServiceClient.createCatalogItem(parent, catalogItem);
         }
         
        Parameters:
        parent - Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.
        catalogItem - Required. The catalog item to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCatalogItem

        public final CatalogItem createCatalogItem​(CreateCatalogItemRequest request)
        Creates a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CreateCatalogItemRequest request =
               CreateCatalogItemRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setCatalogItem(CatalogItem.newBuilder().build())
                   .build();
           CatalogItem response = catalogServiceClient.createCatalogItem(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCatalogItemCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateCatalogItemRequest,​CatalogItem> createCatalogItemCallable()
        Creates a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CreateCatalogItemRequest request =
               CreateCatalogItemRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setCatalogItem(CatalogItem.newBuilder().build())
                   .build();
           ApiFuture<CatalogItem> future =
               catalogServiceClient.createCatalogItemCallable().futureCall(request);
           // Do something.
           CatalogItem response = future.get();
         }
         
      • getCatalogItem

        public final CatalogItem getCatalogItem​(CatalogItemPathName name)
        Gets a specific catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CatalogItemPathName name =
               CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
           CatalogItem response = catalogServiceClient.getCatalogItem(name);
         }
         
        Parameters:
        name - Required. Full resource name of catalog item, such as `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCatalogItem

        public final CatalogItem getCatalogItem​(String name)
        Gets a specific catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           String name =
               CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                   .toString();
           CatalogItem response = catalogServiceClient.getCatalogItem(name);
         }
         
        Parameters:
        name - Required. Full resource name of catalog item, such as `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCatalogItem

        public final CatalogItem getCatalogItem​(GetCatalogItemRequest request)
        Gets a specific catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           GetCatalogItemRequest request =
               GetCatalogItemRequest.newBuilder()
                   .setName(
                       CatalogItemPathName.of(
                               "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                           .toString())
                   .build();
           CatalogItem response = catalogServiceClient.getCatalogItem(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCatalogItemCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetCatalogItemRequest,​CatalogItem> getCatalogItemCallable()
        Gets a specific catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           GetCatalogItemRequest request =
               GetCatalogItemRequest.newBuilder()
                   .setName(
                       CatalogItemPathName.of(
                               "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                           .toString())
                   .build();
           ApiFuture<CatalogItem> future =
               catalogServiceClient.getCatalogItemCallable().futureCall(request);
           // Do something.
           CatalogItem response = future.get();
         }
         
      • listCatalogItems

        public final CatalogServiceClient.ListCatalogItemsPagedResponse listCatalogItems​(CatalogName parent,
                                                                                         String filter)
        Gets a list of catalog items.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
           String filter = "filter-1274492040";
           for (CatalogItem element :
               catalogServiceClient.listCatalogItems(parent, filter).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.
        filter - Optional. A filter to apply on the list results.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCatalogItems

        public final CatalogServiceClient.ListCatalogItemsPagedResponse listCatalogItems​(String parent,
                                                                                         String filter)
        Gets a list of catalog items.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
           String filter = "filter-1274492040";
           for (CatalogItem element :
               catalogServiceClient.listCatalogItems(parent, filter).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.
        filter - Optional. A filter to apply on the list results.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCatalogItems

        public final CatalogServiceClient.ListCatalogItemsPagedResponse listCatalogItems​(ListCatalogItemsRequest request)
        Gets a list of catalog items.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           ListCatalogItemsRequest request =
               ListCatalogItemsRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setFilter("filter-1274492040")
                   .build();
           for (CatalogItem element : catalogServiceClient.listCatalogItems(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCatalogItemsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListCatalogItemsRequest,​CatalogServiceClient.ListCatalogItemsPagedResponse> listCatalogItemsPagedCallable()
        Gets a list of catalog items.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           ListCatalogItemsRequest request =
               ListCatalogItemsRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setFilter("filter-1274492040")
                   .build();
           ApiFuture<CatalogItem> future =
               catalogServiceClient.listCatalogItemsPagedCallable().futureCall(request);
           // Do something.
           for (CatalogItem element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listCatalogItemsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListCatalogItemsRequest,​ListCatalogItemsResponse> listCatalogItemsCallable()
        Gets a list of catalog items.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           ListCatalogItemsRequest request =
               ListCatalogItemsRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .setFilter("filter-1274492040")
                   .build();
           while (true) {
             ListCatalogItemsResponse response =
                 catalogServiceClient.listCatalogItemsCallable().call(request);
             for (CatalogItem element : response.getCatalogItemsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • updateCatalogItem

        public final CatalogItem updateCatalogItem​(CatalogItemPathName name,
                                                   CatalogItem catalogItem,
                                                   com.google.protobuf.FieldMask updateMask)
        Updates a catalog item. Partial updating is supported. Non-existing items will be created.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CatalogItemPathName name =
               CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
           CatalogItem catalogItem = CatalogItem.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           CatalogItem response = catalogServiceClient.updateCatalogItem(name, catalogItem, updateMask);
         }
         
        Parameters:
        name - Required. Full resource name of catalog item, such as `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
        catalogItem - Required. The catalog item to update/create. The 'catalog_item_id' field has to match that in the 'name'.
        updateMask - Optional. Indicates which fields in the provided 'item' to update. If not set, will by default update all fields.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateCatalogItem

        public final CatalogItem updateCatalogItem​(String name,
                                                   CatalogItem catalogItem,
                                                   com.google.protobuf.FieldMask updateMask)
        Updates a catalog item. Partial updating is supported. Non-existing items will be created.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           String name =
               CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                   .toString();
           CatalogItem catalogItem = CatalogItem.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           CatalogItem response = catalogServiceClient.updateCatalogItem(name, catalogItem, updateMask);
         }
         
        Parameters:
        name - Required. Full resource name of catalog item, such as `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
        catalogItem - Required. The catalog item to update/create. The 'catalog_item_id' field has to match that in the 'name'.
        updateMask - Optional. Indicates which fields in the provided 'item' to update. If not set, will by default update all fields.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateCatalogItem

        public final CatalogItem updateCatalogItem​(UpdateCatalogItemRequest request)
        Updates a catalog item. Partial updating is supported. Non-existing items will be created.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           UpdateCatalogItemRequest request =
               UpdateCatalogItemRequest.newBuilder()
                   .setName(
                       CatalogItemPathName.of(
                               "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                           .toString())
                   .setCatalogItem(CatalogItem.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           CatalogItem response = catalogServiceClient.updateCatalogItem(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateCatalogItemCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateCatalogItemRequest,​CatalogItem> updateCatalogItemCallable()
        Updates a catalog item. Partial updating is supported. Non-existing items will be created.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           UpdateCatalogItemRequest request =
               UpdateCatalogItemRequest.newBuilder()
                   .setName(
                       CatalogItemPathName.of(
                               "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                           .toString())
                   .setCatalogItem(CatalogItem.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           ApiFuture<CatalogItem> future =
               catalogServiceClient.updateCatalogItemCallable().futureCall(request);
           // Do something.
           CatalogItem response = future.get();
         }
         
      • deleteCatalogItem

        public final void deleteCatalogItem​(CatalogItemPathName name)
        Deletes a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CatalogItemPathName name =
               CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
           catalogServiceClient.deleteCatalogItem(name);
         }
         
        Parameters:
        name - Required. Full resource name of catalog item, such as `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteCatalogItem

        public final void deleteCatalogItem​(String name)
        Deletes a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           String name =
               CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                   .toString();
           catalogServiceClient.deleteCatalogItem(name);
         }
         
        Parameters:
        name - Required. Full resource name of catalog item, such as `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteCatalogItem

        public final void deleteCatalogItem​(DeleteCatalogItemRequest request)
        Deletes a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           DeleteCatalogItemRequest request =
               DeleteCatalogItemRequest.newBuilder()
                   .setName(
                       CatalogItemPathName.of(
                               "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                           .toString())
                   .build();
           catalogServiceClient.deleteCatalogItem(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteCatalogItemCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteCatalogItemRequest,​com.google.protobuf.Empty> deleteCatalogItemCallable()
        Deletes a catalog item.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           DeleteCatalogItemRequest request =
               DeleteCatalogItemRequest.newBuilder()
                   .setName(
                       CatalogItemPathName.of(
                               "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]")
                           .toString())
                   .build();
           ApiFuture<Empty> future =
               catalogServiceClient.deleteCatalogItemCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • importCatalogItemsAsync

        public final com.google.api.gax.longrunning.OperationFuture<ImportCatalogItemsResponse,​ImportMetadata> importCatalogItemsAsync​(CatalogName parent,
                                                                                                                                             String requestId,
                                                                                                                                             InputConfig inputConfig,
                                                                                                                                             ImportErrorsConfig errorsConfig)
        Bulk import of multiple catalog items. Request processing may be synchronous. No partial updating supported. Non-existing items will be created.

        Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully updated.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
           String requestId = "requestId693933066";
           InputConfig inputConfig = InputConfig.newBuilder().build();
           ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
           ImportCatalogItemsResponse response =
               catalogServiceClient
                   .importCatalogItemsAsync(parent, requestId, inputConfig, errorsConfig)
                   .get();
         }
         
        Parameters:
        parent - Required. `projects/1234/locations/global/catalogs/default_catalog`
        requestId - Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency and used for request deduplication. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response.
        inputConfig - Required. The desired input location of the data.
        errorsConfig - Optional. The desired location of errors incurred during the Import.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • importCatalogItemsAsync

        public final com.google.api.gax.longrunning.OperationFuture<ImportCatalogItemsResponse,​ImportMetadata> importCatalogItemsAsync​(String parent,
                                                                                                                                             String requestId,
                                                                                                                                             InputConfig inputConfig,
                                                                                                                                             ImportErrorsConfig errorsConfig)
        Bulk import of multiple catalog items. Request processing may be synchronous. No partial updating supported. Non-existing items will be created.

        Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully updated.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
           String requestId = "requestId693933066";
           InputConfig inputConfig = InputConfig.newBuilder().build();
           ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
           ImportCatalogItemsResponse response =
               catalogServiceClient
                   .importCatalogItemsAsync(parent, requestId, inputConfig, errorsConfig)
                   .get();
         }
         
        Parameters:
        parent - Required. `projects/1234/locations/global/catalogs/default_catalog`
        requestId - Optional. Unique identifier provided by client, within the ancestor dataset scope. Ensures idempotency and used for request deduplication. Server-generated if unspecified. Up to 128 characters long. This is returned as google.longrunning.Operation.name in the response.
        inputConfig - Required. The desired input location of the data.
        errorsConfig - Optional. The desired location of errors incurred during the Import.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • importCatalogItemsAsync

        public final com.google.api.gax.longrunning.OperationFuture<ImportCatalogItemsResponse,​ImportMetadata> importCatalogItemsAsync​(ImportCatalogItemsRequest request)
        Bulk import of multiple catalog items. Request processing may be synchronous. No partial updating supported. Non-existing items will be created.

        Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully updated.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           ImportCatalogItemsRequest request =
               ImportCatalogItemsRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setRequestId("requestId693933066")
                   .setInputConfig(InputConfig.newBuilder().build())
                   .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
                   .build();
           ImportCatalogItemsResponse response =
               catalogServiceClient.importCatalogItemsAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • importCatalogItemsOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<ImportCatalogItemsRequest,​ImportCatalogItemsResponse,​ImportMetadata> importCatalogItemsOperationCallable()
        Bulk import of multiple catalog items. Request processing may be synchronous. No partial updating supported. Non-existing items will be created.

        Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully updated.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           ImportCatalogItemsRequest request =
               ImportCatalogItemsRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setRequestId("requestId693933066")
                   .setInputConfig(InputConfig.newBuilder().build())
                   .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
                   .build();
           OperationFuture<ImportCatalogItemsResponse, ImportMetadata> future =
               catalogServiceClient.importCatalogItemsOperationCallable().futureCall(request);
           // Do something.
           ImportCatalogItemsResponse response = future.get();
         }
         
      • importCatalogItemsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ImportCatalogItemsRequest,​com.google.longrunning.Operation> importCatalogItemsCallable()
        Bulk import of multiple catalog items. Request processing may be synchronous. No partial updating supported. Non-existing items will be created.

        Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully updated.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
           ImportCatalogItemsRequest request =
               ImportCatalogItemsRequest.newBuilder()
                   .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
                   .setRequestId("requestId693933066")
                   .setInputConfig(InputConfig.newBuilder().build())
                   .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
                   .build();
           ApiFuture<Operation> future =
               catalogServiceClient.importCatalogItemsCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource