This page shows how to get started with the Cloud Client Libraries for the
Lakehouse API. Client libraries make it easier to access
Google Cloud APIs from a supported language. Although you can use
Google Cloud APIs directly by making raw requests to the server, client
libraries provide simplifications that significantly reduce the amount of code
you need to write.

Read more about the Cloud Client Libraries
and the older Google API Client Libraries in
[Client libraries explained](https://docs.cloud.google.com/apis/docs/client-libraries-explained.md.txt).

## Install the client library

### Go

```
go get cloud.google.com/go/biglake/apiv1
```

<br />

For more information about Google Cloud client libraries for Go, see [Google Cloud Go Client Libraries](https://cloud.google.com/go/docs/reference).

For more information, see [Setting Up a Go Development Environment](https://docs.cloud.google.com/go/docs/setup.md.txt).

### Java

If you're using [Maven](https://maven.apache.org/), add the following to your `pom.xml` file:

<br />

```xml
<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-biglake</artifactId>
  <version>VERSION</version>
</dependency>
```

If you're using [Gradle](https://gradle.org/), add the following to your dependencies:

```
implementation 'com.google.cloud:google-cloud-biglake:VERSION'
```
For more information about the latest version, see [Java Cloud client library reference](https://docs.cloud.google.com/java/docs/reference/google-cloud-biglake/latest/overview.md.txt).

For more information, see [Setting Up a Java Development Environment](https://docs.cloud.google.com/java/docs/setup.md.txt).

### Python

```
pip install --upgrade google-cloud-biglake
```

<br />

For more information about the latest version, see [Python Cloud client library reference](https://docs.cloud.google.com/python/docs/reference/google-cloud-biglake/latest.md.txt).

For more information, see [Setting Up a Python Development Environment](https://docs.cloud.google.com/python/docs/setup.md.txt).

### Rust

```
cargo add google-cloud-biglake-v1
```

<br />

For more information about the Rust client library, see [Rust documentation for google-cloud-biglake-v1](https://docs.rs/google-cloud-biglake-v1/latest).

For more information, see [Get started with Rust](https://docs.cloud.google.com/rust/docs/quickstart.md.txt).

<br />

## Set up authentication

To authenticate calls to Google Cloud APIs, client libraries support [Application Default Credentials (ADC)](https://docs.cloud.google.com/docs/authentication/application-default-credentials.md.txt); the libraries look for credentials in a set of defined locations and use those credentials to authenticate requests to the API. With ADC, you can make credentials available to your application in a variety of environments, such as local development or production, without needing to modify your application code.

For production environments, the way you set up ADC depends on the service
and context. For more information, see [Set up Application Default Credentials](https://docs.cloud.google.com/docs/authentication/provide-credentials-adc.md.txt).

For a local development environment, you can set up ADC with the credentials
that are associated with your Google Account:

1.
   [Install](https://docs.cloud.google.com/sdk/docs/install) the Google Cloud CLI.

   After installation,
   [initialize](https://docs.cloud.google.com/sdk/docs/initializing) the Google Cloud CLI by running the following command:

   ```bash
   gcloud init
   ```


   If you're using an external identity provider (IdP), you must first
   [sign in to the gcloud CLI with your federated identity](https://docs.cloud.google.com/iam/docs/workforce-log-in-gcloud.md.txt).
2.

   If you're using a local shell, then create local authentication credentials for your user
   account:

   ```bash
   gcloud auth application-default login
   ```

   You don't need to do this if you're using Cloud Shell.


   If an authentication error is returned, and you are using an external identity provider
   (IdP), confirm that you have
   [signed in to the gcloud CLI with your federated identity](https://docs.cloud.google.com/iam/docs/workforce-log-in-gcloud.md.txt).


   A sign-in screen appears. After you sign in, your credentials are stored in the
   [local credential file used by ADC](https://docs.cloud.google.com/docs/authentication/application-default-credentials.md.txt#personal).

## Use the client library


The following example shows how to use the client library.

### Go

```go

func ExampleIcebergCatalogClient_ListIcebergCatalogs() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := biglake.NewIcebergCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &biglakepb.ListIcebergCatalogsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/biglake/apiv1/biglakepb#ListIcebergCatalogsRequest.
	}
	it := c.ListIcebergCatalogs(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*biglakepb.ListIcebergCatalogsResponse)
	}
}
```

### Java

```java
import com.google.cloud.biglake.v1.IcebergCatalog;
import com.google.cloud.biglake.v1.IcebergCatalogServiceClient;
import com.google.cloud.biglake.v1.ListIcebergCatalogsRequest;
import com.google.cloud.biglake.v1.ProjectName;

public class SyncListIcebergCatalogs {

  public static void main(String[] args) throws Exception {
    syncListIcebergCatalogs();
  }

  public static void syncListIcebergCatalogs() throws Exception {
    // 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 (IcebergCatalogServiceClient icebergCatalogServiceClient =
        IcebergCatalogServiceClient.create()) {
      ListIcebergCatalogsRequest request =
          ListIcebergCatalogsRequest.newBuilder()
              .setParent(ProjectName.of("[PROJECT]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .build();
      for (IcebergCatalog element :
          icebergCatalogServiceClient.listIcebergCatalogs(request).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}
```

### Python

```python
# 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://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import biglake_v1


def sample_list_iceberg_catalogs():
    # Create a client
    client = biglake_v1.IcebergCatalogServiceClient()

    # Initialize request argument(s)
    request = biglake_v1.ListIcebergCatalogsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_iceberg_catalogs(request=request)

    # Handle the response
    for response in page_result:
        print(response)

```

<br />

## Additional resources

### Go

The following list contains links to more resources related to the client libraries for Go:

<br />

- [API reference](https://pkg.go.dev/cloud.google.com/go/biglake/apiv1)
- [Client libraries best practices](https://docs.cloud.google.com/apis/docs/client-libraries-best-practices.md.txt)
- [Issue tracker](https://github.com/googleapis/google-cloud-go/issues)
- [Source code](https://github.com/googleapis/google-cloud-go/tree/main/biglake)

### Java

The following list contains links to more resources related to the client libraries for Java:

<br />

- [API reference](https://docs.cloud.google.com/java/docs/reference/google-cloud-biglake/latest/overview.md.txt)
- [Client libraries best practices](https://docs.cloud.google.com/apis/docs/client-libraries-best-practices.md.txt)
- [Issue tracker](https://github.com/googleapis/google-cloud-java/issues)
- [Source code](https://github.com/googleapis/google-cloud-java/tree/main/java-biglake)

### Python

The following list contains links to more resources related to the client libraries for Python:

<br />

- [API reference](https://docs.cloud.google.com/python/docs/reference/google-cloud-biglake/latest.md.txt)
- [Client libraries best practices](https://docs.cloud.google.com/apis/docs/client-libraries-best-practices.md.txt)
- [Issue tracker](https://github.com/googleapis/google-cloud-python/issues)
- [Source code](https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-biglake)

### Rust

The following list contains links to more resources related to the client libraries for Rust:

<br />

- [API reference](https://docs.rs/google-cloud-biglake-v1/latest)
- [Client libraries best practices](https://docs.cloud.google.com/apis/docs/client-libraries-best-practices.md.txt)
- [Issue tracker](https://github.com/googleapis/google-cloud-rust/issues)
- [Source code](https://github.com/googleapis/google-cloud-rust/tree/main/src/generated/cloud/biglake/v1)

<br />