3535
3636// AUTO-GENERATED DOCUMENTATION AND CLASS.
3737/**
38- * Service Description: Iceberg Catalog Service API: this implements the open-source Iceberg REST
39- * Catalog API. See the API definition here:
40- * https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml
41- *
42- * <p>The API is defined as OpenAPI 3.1.1 spec.
43- *
44- * <p>Currently we only support the following methods: - GetConfig/GetIcebergCatalogConfig -
45- * ListIcebergNamespaces - CheckIcebergNamespaceExists - GetIcebergNamespace -
46- * CreateIcebergNamespace (only supports single level) - DeleteIcebergNamespace -
47- * UpdateIcebergNamespace properties - ListTableIdentifiers - CreateIcebergTable -
48- * DeleteIcebergTable - GetIcebergTable - UpdateIcebergTable (CommitTable) -
49- * LoadIcebergTableCredentials - RegisterTable
50- *
51- * <p>Users are required to provided the `X-Goog-User-Project` header with the project id or number
52- * which can be different from the bucket project id. That project will be charged for the API calls
53- * and the calling user must have access to that project. The caller must have
54- * `serviceusage.services.use` permission on the project.
38+ * Service Description: Lakehouse runtime catalog supports the following catalog management methods:
39+ * - GetIcebergCatalog - ListIcebergCatalogs - DeleteIcebergCatalog - UpdateIcebergCatalog -
40+ * CreateIcebergCatalog - FailoverIcebergCatalog
5541 *
5642 * <p>This class provides the ability to make remote calls to the backing service through method
5743 * calls that map to API methods. Sample code to get started:
139125 * </tr>
140126 * <tr>
141127 * <td><p> CreateIcebergCatalog</td>
142- * <td><p> Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
128+ * <td><p> Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
143129 * <p> If the bucket does not exist, of the caller does not have bucket metadata permissions, the catalog will not be created.</td>
144130 * <td>
145131 * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
150136 * <ul>
151137 * <li><p> createIcebergCatalog(ProjectName parent, IcebergCatalog icebergCatalog, String icebergCatalogId)
152138 * <li><p> createIcebergCatalog(String parent, IcebergCatalog icebergCatalog, String icebergCatalogId)
139+ * <li><p> createIcebergCatalog(ProjectName parent, IcebergCatalog icebergCatalog, String icebergCatalogId, String primaryLocation)
140+ * <li><p> createIcebergCatalog(String parent, IcebergCatalog icebergCatalog, String icebergCatalogId, String primaryLocation)
153141 * </ul>
154142 * <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
155143 * <ul>
@@ -672,9 +660,8 @@ public final IcebergCatalog updateIcebergCatalog(UpdateIcebergCatalogRequest req
672660
673661 // AUTO-GENERATED DOCUMENTATION AND METHOD.
674662 /**
675- * Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs.
676- * Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g.
677- * `my-catalog` for `gs://my-catalog`).
663+ * Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for
664+ * which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
678665 *
679666 * <p>If the bucket does not exist, of the caller does not have bucket metadata permissions, the
680667 * catalog will not be created.
@@ -719,9 +706,8 @@ public final IcebergCatalog createIcebergCatalog(
719706
720707 // AUTO-GENERATED DOCUMENTATION AND METHOD.
721708 /**
722- * Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs.
723- * Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g.
724- * `my-catalog` for `gs://my-catalog`).
709+ * Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for
710+ * which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
725711 *
726712 * <p>If the bucket does not exist, of the caller does not have bucket metadata permissions, the
727713 * catalog will not be created.
@@ -766,9 +752,128 @@ public final IcebergCatalog createIcebergCatalog(
766752
767753 // AUTO-GENERATED DOCUMENTATION AND METHOD.
768754 /**
769- * Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs.
770- * Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g.
771- * `my-catalog` for `gs://my-catalog`).
755+ * Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for
756+ * which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
757+ *
758+ * <p>If the bucket does not exist, of the caller does not have bucket metadata permissions, the
759+ * catalog will not be created.
760+ *
761+ * <p>Sample code:
762+ *
763+ * <pre>{@code
764+ * // This snippet has been automatically generated and should be regarded as a code template only.
765+ * // It will require modifications to work:
766+ * // - It may require correct/in-range values for request initialization.
767+ * // - It may require specifying regional endpoints when creating the service client as shown in
768+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
769+ * try (IcebergCatalogServiceClient icebergCatalogServiceClient =
770+ * IcebergCatalogServiceClient.create()) {
771+ * ProjectName parent = ProjectName.of("[PROJECT]");
772+ * IcebergCatalog icebergCatalog = IcebergCatalog.newBuilder().build();
773+ * String icebergCatalogId = "icebergCatalogId504062865";
774+ * String primaryLocation = "primaryLocation-1140723753";
775+ * IcebergCatalog response =
776+ * icebergCatalogServiceClient.createIcebergCatalog(
777+ * parent, icebergCatalog, icebergCatalogId, primaryLocation);
778+ * }
779+ * }</pre>
780+ *
781+ * @param parent Required. The parent resource where this catalog will be created. Format:
782+ * projects/{project_id}
783+ * @param icebergCatalog Required. The catalog to create. The required fields for creation are: -
784+ * catalog_type. Optionally: credential_mode can be provided, if Credential Vending is
785+ * desired.
786+ * @param icebergCatalogId Required. The name of the catalog.
787+ * @param primaryLocation Optional. The primary location where the catalog metadata will be
788+ * stored.
789+ * <p>For Google Cloud Storage bucket catalogs and BigLake catalogs, if this is not specified,
790+ * then the region is inferred from the bucket's region (`default_location` bucket for BigLake
791+ * catalogs). If specified, the region must be in jurisdiction (near the `default_location`
792+ * bucket's region and the `restricted_locations` buckets' regions for BigLake catalogs).
793+ * <p>For federated catalogs, this must be specified and be a Lakehouse-supported location
794+ * (https://docs.cloud.google.com/lakehouse/docs/locations). It should be close to the remote
795+ * catalog's location for the best performance and cost.
796+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
797+ */
798+ public final IcebergCatalog createIcebergCatalog (
799+ ProjectName parent ,
800+ IcebergCatalog icebergCatalog ,
801+ String icebergCatalogId ,
802+ String primaryLocation ) {
803+ CreateIcebergCatalogRequest request =
804+ CreateIcebergCatalogRequest .newBuilder ()
805+ .setParent (parent == null ? null : parent .toString ())
806+ .setIcebergCatalog (icebergCatalog )
807+ .setIcebergCatalogId (icebergCatalogId )
808+ .setPrimaryLocation (primaryLocation )
809+ .build ();
810+ return createIcebergCatalog (request );
811+ }
812+
813+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
814+ /**
815+ * Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for
816+ * which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
817+ *
818+ * <p>If the bucket does not exist, of the caller does not have bucket metadata permissions, the
819+ * catalog will not be created.
820+ *
821+ * <p>Sample code:
822+ *
823+ * <pre>{@code
824+ * // This snippet has been automatically generated and should be regarded as a code template only.
825+ * // It will require modifications to work:
826+ * // - It may require correct/in-range values for request initialization.
827+ * // - It may require specifying regional endpoints when creating the service client as shown in
828+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
829+ * try (IcebergCatalogServiceClient icebergCatalogServiceClient =
830+ * IcebergCatalogServiceClient.create()) {
831+ * String parent = ProjectName.of("[PROJECT]").toString();
832+ * IcebergCatalog icebergCatalog = IcebergCatalog.newBuilder().build();
833+ * String icebergCatalogId = "icebergCatalogId504062865";
834+ * String primaryLocation = "primaryLocation-1140723753";
835+ * IcebergCatalog response =
836+ * icebergCatalogServiceClient.createIcebergCatalog(
837+ * parent, icebergCatalog, icebergCatalogId, primaryLocation);
838+ * }
839+ * }</pre>
840+ *
841+ * @param parent Required. The parent resource where this catalog will be created. Format:
842+ * projects/{project_id}
843+ * @param icebergCatalog Required. The catalog to create. The required fields for creation are: -
844+ * catalog_type. Optionally: credential_mode can be provided, if Credential Vending is
845+ * desired.
846+ * @param icebergCatalogId Required. The name of the catalog.
847+ * @param primaryLocation Optional. The primary location where the catalog metadata will be
848+ * stored.
849+ * <p>For Google Cloud Storage bucket catalogs and BigLake catalogs, if this is not specified,
850+ * then the region is inferred from the bucket's region (`default_location` bucket for BigLake
851+ * catalogs). If specified, the region must be in jurisdiction (near the `default_location`
852+ * bucket's region and the `restricted_locations` buckets' regions for BigLake catalogs).
853+ * <p>For federated catalogs, this must be specified and be a Lakehouse-supported location
854+ * (https://docs.cloud.google.com/lakehouse/docs/locations). It should be close to the remote
855+ * catalog's location for the best performance and cost.
856+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
857+ */
858+ public final IcebergCatalog createIcebergCatalog (
859+ String parent ,
860+ IcebergCatalog icebergCatalog ,
861+ String icebergCatalogId ,
862+ String primaryLocation ) {
863+ CreateIcebergCatalogRequest request =
864+ CreateIcebergCatalogRequest .newBuilder ()
865+ .setParent (parent )
866+ .setIcebergCatalog (icebergCatalog )
867+ .setIcebergCatalogId (icebergCatalogId )
868+ .setPrimaryLocation (primaryLocation )
869+ .build ();
870+ return createIcebergCatalog (request );
871+ }
872+
873+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
874+ /**
875+ * Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for
876+ * which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
772877 *
773878 * <p>If the bucket does not exist, of the caller does not have bucket metadata permissions, the
774879 * catalog will not be created.
@@ -788,6 +893,7 @@ public final IcebergCatalog createIcebergCatalog(
788893 * .setParent(ProjectName.of("[PROJECT]").toString())
789894 * .setIcebergCatalogId("icebergCatalogId504062865")
790895 * .setIcebergCatalog(IcebergCatalog.newBuilder().build())
896+ * .setPrimaryLocation("primaryLocation-1140723753")
791897 * .build();
792898 * IcebergCatalog response = icebergCatalogServiceClient.createIcebergCatalog(request);
793899 * }
@@ -802,9 +908,8 @@ public final IcebergCatalog createIcebergCatalog(CreateIcebergCatalogRequest req
802908
803909 // AUTO-GENERATED DOCUMENTATION AND METHOD.
804910 /**
805- * Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs.
806- * Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g.
807- * `my-catalog` for `gs://my-catalog`).
911+ * Creates the Iceberg REST Catalog. Google Cloud Storage Bucket catalog id is the bucket for
912+ * which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).
808913 *
809914 * <p>If the bucket does not exist, of the caller does not have bucket metadata permissions, the
810915 * catalog will not be created.
@@ -824,6 +929,7 @@ public final IcebergCatalog createIcebergCatalog(CreateIcebergCatalogRequest req
824929 * .setParent(ProjectName.of("[PROJECT]").toString())
825930 * .setIcebergCatalogId("icebergCatalogId504062865")
826931 * .setIcebergCatalog(IcebergCatalog.newBuilder().build())
932+ * .setPrimaryLocation("primaryLocation-1140723753")
827933 * .build();
828934 * ApiFuture<IcebergCatalog> future =
829935 * icebergCatalogServiceClient.createIcebergCatalogCallable().futureCall(request);
0 commit comments