/*!

@mainpage Cloud Spanner C++ Client Library

The Cloud Spanner C++ Client library offers types and functions to use Cloud
Spanner from C++ applications.

@tableofcontents{HTML:2}

## Quickstart

The following "Hello World" program should give you a sense of how to use this
library.  This program is also used to illustrate how to incorporate the library
into your project.

@snippet quickstart.cc all

## More Information

- Read more about [Cloud Spanner](https://cloud.google.com/spanner/docs/)
- [Client::ExecuteQuery()](@ref google::cloud::spanner::Client::ExecuteQuery())
  to execute SQL queries in Cloud Spanner.
- [Client::Commit()](@ref google::cloud::spanner::Client::Commit())
  to execute read-write transactions in Cloud Spanner.
- [Client::Read()](@ref google::cloud::spanner::Client::Read()) to read the
  rows in a table.
- @ref spanner-error-handling to learn how the library reports run-time errors.
- @ref spanner-env for environment variables affecting the library. Some of
  these environment variables enable logging to the console. This can be an
  effective approach to diagnose runtime problems.
- @ref spanner-retry-policies to learn how to override the default retry
  policies used by the library.
- @ref spanner-endpoint-example
- @ref spanner-auth-example
- @ref spanner-universe-domain-example
- @ref spanner-mocking
- @ref spanner-isolation-level-example
- The [Setting up your development environment] guide describes how to set up
  a C++ development environment in various platforms, including the Google Cloud
  C++ client libraries.

[google-cloud-cpp]: https://github.com/googleapis/google-cloud-cpp
[project-readme]:   https://github.com/googleapis/google-cloud-cpp#readme
[project-build]:    https://github.com/googleapis/google-cloud-cpp#building-and-installing
[howto-setup-dev-workstation]: https://github.com/googleapis/google-cloud-cpp/blob/main/doc/contributor/howto-guide-setup-development-workstation.md
[quickstart guide]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/bigtable/quickstart#readme
[packaging guide]:  https://github.com/googleapis/google-cloud-cpp/blob/main/doc/packaging%2Emd
[Setting up your development environment]: https://cloud.google.com/cpp/docs/setup

*/

/**
@page spanner-endpoint-example Override the default endpoint

In some cases, you may need to override the default endpoint used by the client
library. Use the `google::cloud::EndpointOption` when initializing the client
library to change this default.  For example, this will override the default
endpoint for `google::cloud::spanner::Client`:

@snippet client_samples.cc set-client-endpoint

Follow these links to find examples for other `*Client` classes:

- [`DatabaseAdminClient`](@ref DatabaseAdminClient-set-endpoint-snippet)
- [`InstanceAdminClient`](@ref InstanceAdminClient-set-endpoint-snippet)

*/

/**
@page spanner-isolation-level-example Support Isolation Level

Cloud Spanner supports different isolation levels for read-write transactions.
You can specify a default isolation level at the client-level, or override it
at the transaction-level.

The following example shows how to set the isolation level:

@snippet samples.cc spanner-isolation-level-setting-sample

*/

/**
@page spanner-auth-example Override the authentication configuration

Some applications cannot use the default authentication mechanism (known as
[Application Default Credentials]). You can override this default using
`google::cloud::UnifiedCredentialsOption`. The following example shows how
to explicitly load a service account key file.

@snippet client_samples.cc with-service-account

Keep in mind that we chose this as an example because it is relatively easy to
understand. Consult the [Best practices for managing service account keys]
guide for more details.

Follow these links to find examples for other `*Client` classes:

- [`DatabaseAdminClient`](@ref DatabaseAdminClient-with-service-account-snippet)
- [`InstanceAdminClient`](@ref InstanceAdminClient-with-service-account-snippet)

*/

/**
@page spanner-universe-domain-example Override the default universe domain

In some cases, you may need to override the default universe domain used by the
client library. Use the `AddUniverseDomainOption` when initializing the client
library to change this default.

@snippet client_samples.cc set-client-universe-domain

Follow these links to find examples for other `*Client` classes:

- [`DatabaseAdminClient`](@ref DatabaseAdminClient-set-universe-domain-snippet)
- [`InstanceAdminClient`](@ref InstanceAdminClient-set-universe-domain-snippet)

*/

/*! @page Client-set-endpoint-snippet Override Client Default Endpoint

@snippet google/cloud/spanner/samples/client_samples.cc set-client-endpoint

*/

/*! @page Client-with-service-account-snippet Override Client Default Authentication

@snippet google/cloud/spanner/samples/client_samples.cc with-service-account

*/

/*! @page Client-set-universe-domain-snippet Override Client Default Universe Domain

@snippet google/cloud/spanner/samples/client_samples.cc set-client-universe-domain

*/

/*! @page DatabaseAdminClient-set-endpoint-snippet Override DatabaseAdminClient Default Endpoint

@snippet google/cloud/spanner/admin/samples/database_admin_client_samples.cc set-client-endpoint

*/

/*! @page DatabaseAdminClient-with-service-account-snippet Override DatabaseAdminClient Default Authentication

@snippet google/cloud/spanner/admin/samples/database_admin_client_samples.cc with-service-account

*/

/*! @page DatabaseAdminClient-set-universe-domain-snippet Override DatabaseAdminClient Default Universe Domain

@snippet google/cloud/spanner/admin/samples/database_admin_client_samples.cc set-client-universe-domain

*/

/*! @page InstanceAdminClient-set-endpoint-snippet Override InstanceAdminClient Default Endpoint

@snippet google/cloud/spanner/admin/samples/instance_admin_client_samples.cc set-client-endpoint

*/

/*! @page InstanceAdminClient-with-service-account-snippet Override InstanceAdminClient Default Authentication

@snippet google/cloud/spanner/admin/samples/instance_admin_client_samples.cc with-service-account

*/

/*! @page InstanceAdminClient-set-universe-domain-snippet Override InstanceAdminClient Default Universe Domain

@snippet google/cloud/spanner/admin/samples/instance_admin_client_samples.cc set-client-universe-domain

*/
