# Namespace google::cloud::pubsub (3.7.0-rc)

3.7.0-rc 3.6.0 (latest) 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0 Contains all the Cloud Pub/Sub C++ client types and functions.

## Classes

### [AckHandler](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1AckHandler)

Defines the interface to acknowledge and reject messages.

### [BigQueryConfigBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BigQueryConfigBuilder)

A helper class to build `google::pubsub::v1::BigQueryConfig` protos.

### [BlockingPublisher](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisher)

Publish messages to the Cloud Pub/Sub service.

### [BlockingPublisherConnection](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisherConnection)

A connection to the Cloud Pub/Sub service to publish events.

### [CloudStorageConfigBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1CloudStorageConfigBuilder)

A helper class to build `google::pubsub::v1::CloudStorageConfig` protos.

### [ExactlyOnceAckHandler](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1ExactlyOnceAckHandler)

Defines the interface to acknowledge and reject messages.

### [LimitedErrorCountRetryPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1LimitedErrorCountRetryPolicy)

A retry policy based on counting errors.

### [LimitedTimeRetryPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1LimitedTimeRetryPolicy)

A retry policy based on elapsed time.

### [Message](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Message)

The C++ representation for a Cloud Pub/Sub messages.

### [MessageBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1MessageBuilder)

Constructs [`Message`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Message) objects.

### [Publisher](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Publisher)

Publish messages to the Cloud Pub/Sub service.

### [PublisherConnection](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection)

A connection to the Cloud Pub/Sub service to publish events.

### [PullAckHandler](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PullAckHandler)

Defines the interface to acknowledge and reject messages.

### [PushConfigBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PushConfigBuilder)

Helper class to create google::pubsub::v1::PushConfig protos.

### [RetryPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1RetryPolicy)

The base class for the Pub/Sub library retry policies.

### [Schema](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Schema)

Objects of this class identify a Cloud Pub/Sub schema.

### [SchemaServiceClient](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceClient)

Service for doing schema-related operations.

### [SchemaServiceConnection](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection)

The [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection) object for [`SchemaServiceClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceClient).

### [SchemaServiceConnectionIdempotencyPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnectionIdempotencyPolicy)

### [SchemaServiceLimitedErrorCountRetryPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceLimitedErrorCountRetryPolicy)

A retry policy for [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection) based on counting errors.

### [SchemaServiceLimitedTimeRetryPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceLimitedTimeRetryPolicy)

A retry policy for [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection) based on elapsed time.

### [SchemaServiceRetryPolicy](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceRetryPolicy)

The retry policy for [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection).

### [Snapshot](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Snapshot)

Objects of this class identify a Cloud Pub/Sub snapshot.

### [SnapshotBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SnapshotBuilder)

Build a request to create a Cloud Pub/Sub snapshot.

### [Subscriber](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Subscriber)

Receive messages from the Cloud Pub/Sub service.

### [SubscriberConnection](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection)

A connection to the Cloud Pub/Sub service to receive events.

### [Subscription](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Subscription)

Objects of this class identify a Cloud Pub/Sub subscription.

### [SubscriptionAdminClient](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient)

Performs subscription administrative operations in Cloud Pub/Sub.

### [SubscriptionAdminConnection](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection)

A connection to Cloud Pub/Sub for subscription-related administrative operations.

### [SubscriptionBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionBuilder)

Create a Cloud Pub/Sub subscription configuration.

### [Topic](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Topic)

Objects of this class identify a Cloud Pub/Sub topic.

### [TopicAdminClient](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient)

Performs topic admin operations in Cloud Pub/Sub.

### [TopicAdminConnection](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)

A connection to Cloud Pub/Sub for topic-related administrative operations.

### [TopicBuilder](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicBuilder)

Builds requests to create or update a Cloud Pub/Sub topic.

## Structs

### [BackoffPolicyOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1BackoffPolicyOption)

The backoff policy.

### [CompressionAlgorithmOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1CompressionAlgorithmOption)

Compression algorithm.

### [CompressionThresholdOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1CompressionThresholdOption)

Compression threshold.

### [ConnectionOptionsTraits](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1ConnectionOptionsTraits)

The Cloud Pub/Sub connection traits.

### [FullPublisherActionOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1FullPublisherActionOption)

The action taken by a full publisher.

### [MaxBatchBytesOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxBatchBytesOption)

The maximum size for the messages in a batch.

### [MaxBatchMessagesOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxBatchMessagesOption)

The maximum number of messages in a batch.

### [MaxConcurrencyOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxConcurrencyOption)

The maximum callback concurrency.

### [MaxDeadlineExtensionOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxDeadlineExtensionOption)

The maximum time by which the deadline for each incoming message is extended.

### [MaxDeadlineTimeOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxDeadlineTimeOption)

The maximum deadline for each incoming message.

### [MaxHoldTimeOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxHoldTimeOption)

The maximum hold time for the messages.

### [MaxOtelLinkCountOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxOtelLinkCountOption)

The maximum number of Open Telemetry span links.

### [MaxOutstandingBytesOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxOutstandingBytesOption)

The maximum number of outstanding bytes per streaming pull.

### [MaxOutstandingMessagesOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxOutstandingMessagesOption)

The maximum number of outstanding messages per streaming pull.

### [MaxPendingBytesOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxPendingBytesOption)

The maximum size for pending messages.

### [MaxPendingMessagesOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MaxPendingMessagesOption)

The maximum number of pending messages.

### [MessageOrderingOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MessageOrderingOption)

[Publisher](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Publisher) message ordering.

### [MinDeadlineExtensionOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1MinDeadlineExtensionOption)

The minimum time by which the deadline for each incoming message is extended.

### [PullResponse](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1PullResponse)

The response for a blocking pull.

### [RetryPolicyOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1RetryPolicyOption)

The retry policy.

### [SchemaServiceBackoffPolicyOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceBackoffPolicyOption)

Use with [`google::cloud::Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure the backoff policy.

### [SchemaServiceConnectionIdempotencyPolicyOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnectionIdempotencyPolicyOption)

Use with [`google::cloud::Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure which operations are retried.

### [SchemaServiceRetryPolicyOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceRetryPolicyOption)

Use with [`google::cloud::Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure the retry policy.

### [ShutdownPollingPeriodOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1ShutdownPollingPeriodOption)

How often the session polls for automatic shutdowns.

### [SubscriptionOption](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/structgoogle_1_1cloud_1_1pubsub_1_1SubscriptionOption)

Override the default subscription for a request.

## Enums

### [FullPublisherAction](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub_1ab3f4e687e783e30ae0d046c8f10ac14c)

Actions taken by a full publisher.

## Functions

### MakeBlockingPublisherConnection(std::string const \&, Options)

Creates a new [`BlockingPublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisherConnection) object to work with [`BlockingPublisher`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisher).
The [`BlockingPublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisherConnection) class is provided for applications wanting to mock the [`BlockingPublisher`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisher) behavior in their tests. It is not intended for direct use.

###### Performance

Creating a new [`BlockingPublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisherConnection) is relatively expensive. This typically initiates connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the same [`Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) from `GrpcOptionList` and `CommonOptionList`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`BlockingPublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisherConnection)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `location` | `std::string const &` Sets the prefix for the default [`EndpointOption`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1EndpointOption.html) value. |
| `opts` | `Options` The options to use for this call. Expected options are any of the types in the following option lists. - [`google::cloud::CommonOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::GrpcOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::pubsub::PolicyOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) - [`google::cloud::pubsub::PublisherOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< BlockingPublisherConnection >` |   |

### MakeBlockingPublisherConnection(Options)

A factory function to construct an object of type [`BlockingPublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1BlockingPublisherConnection).
This overload of `MakeBlockingPublisherConnection` does not require a location argument, creating a connection to the global service endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `opts` | `Options` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< BlockingPublisherConnection >` |   |

### MakePublisherConnection(Topic, std::initializer_list\< internal::NonConstructible \>)

Creates a new [`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection) object to work with [`Publisher`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Publisher).

> [!NOTE]
> **Note:** This function exists solely for backwards compatibility. It prevents existing code that calls `MakePublisherConnection(topic, {})` from breaking, due to ambiguity.

> [!WARNING]
> **Deprecated:** Please use `MakePublisherConnection(topic)` instead.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `topic` | `Topic` |
|   | `std::initializer_list< internal::NonConstructible >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< PublisherConnection >` |   |

### MakePublisherConnection(std::string const \&, Topic, Options)

Creates a new [`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection) object to work with [`Publisher`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Publisher).
The [`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection) class is provided for applications wanting to mock the [`Publisher`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Publisher) behavior in their tests. It is not intended for direct use.

###### Performance

Creating a new [`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection) is relatively expensive. This typically initiates connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the same [`Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) from `GrpcOptionList` and `CommonOptionList`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `location` | `std::string const &` Sets the prefix for the default [`EndpointOption`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1EndpointOption.html) value. |
| `topic` | `Topic` the Cloud Pub/Sub topic used by the returned [`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection). |
| `opts` | `Options` The options to use for this call. Expected options are any of the types in the following option lists. - [`google::cloud::CommonOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::GrpcOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::pubsub::PolicyOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) - [`google::cloud::pubsub::PublisherOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< PublisherConnection >` |   |

### MakePublisherConnection(Topic, Options)

A factory function to construct an object of type [`PublisherConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1PublisherConnection).
This overload of `MakePublisherConnection` does not require a location argument, creating a connection to the global service endpoint.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `topic` | `Topic` |
| `opts` | `Options` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< PublisherConnection >` |   |

### MakeSchemaServiceConnection(std::string const \&, Options)

A factory function to construct an object of type [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection).
The returned connection object should not be used directly; instead it should be passed as an argument to the constructor of [SchemaServiceClient](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceClient).

The optional `options` argument may be used to configure aspects of the returned [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection). Expected options are any of the types in the following option lists:

- [`google::cloud::CommonOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html)
- [`google::cloud::GrpcOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html)
- [`google::cloud::UnifiedCredentialsOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html)
- [`google::cloud::pubsub::SchemaServicePolicyOptionList`](about:invalid#zCSafez)

> [!NOTE]
> **Note:** Unexpected options will be ignored. To log unexpected options instead, set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `location` | `std::string const &` Sets the prefix for the default [`EndpointOption`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1EndpointOption.html) value. |
| `options` | `Options` (optional) Configure the [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection) created by this function. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SchemaServiceConnection >` |   |

### MakeSchemaServiceConnection(Options)

A factory function to construct an object of type [`SchemaServiceConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SchemaServiceConnection).
This overload of `MakeSchemaServiceConnection` does not require a location argument, creating a connection to the global service endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `Options` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SchemaServiceConnection >` |   |

### MakeDefaultSchemaServiceConnectionIdempotencyPolicy()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::unique_ptr< SchemaServiceConnectionIdempotencyPolicy >` |   |

### MakeSubscriberConnection(Subscription, std::initializer_list\< internal::NonConstructible \>)

Creates a new [`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection) object to work with [`Subscriber`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Subscriber).

> [!NOTE]
> **Note:** This function exists solely for backwards compatibility. It prevents existing code, which calls `MakeSubscriberConnection(subscription, {})` from breaking, due to ambiguity.

> [!WARNING]
> **Deprecated:** Please use `MakeSubscriberConnection(subscription)` instead.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `subscription` | `Subscription` |
|   | `std::initializer_list< internal::NonConstructible >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SubscriberConnection >` |   |

### MakeSubscriberConnection(std::string const \&, Subscription, Options)

Creates a new [`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection) object to work with [`Subscriber`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Subscriber).
The [`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection) class is not intended for direct use in applications, it is provided for applications wanting to mock the [`Subscriber`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Subscriber) behavior in their tests.

###### Performance

Creating a new [`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection) is relatively expensive. This typically initiate connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the same [`Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) from `GrpcOptionList` and `CommonOptionList`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection)

###### Changing Retry Parameters Example

      namespace pubsub = ::google::cloud::pubsub;
      using ::google::cloud::future;
      using ::google::cloud::Options;
      using ::google::cloud::StatusOr;
      auto sample = [](std::string project_id, std::string subscription_id) {
        // By default a subscriber will retry for 60 seconds, with an initial
        // backoff of 100ms, a maximum backoff of 60 seconds, and the backoff will
        // grow by 30% after each attempt. This changes those defaults.
        auto subscriber = pubsub::Subscriber(pubsub::MakeSubscriberConnection(
            pubsub::Subscription(std::move(project_id), std::move(subscription_id)),
            Options{}
                .set<pubsub::RetryPolicyOption>(
                    pubsub::LimitedTimeRetryPolicy(
                        /*maximum_duration=*/std::chrono::minutes(1))
                        .clone())
                .set<pubsub::BackoffPolicyOption>(
                    pubsub::ExponentialBackoffPolicy(
                        /*initial_delay=*/std::chrono::milliseconds(200),
                        /*maximum_delay=*/std::chrono::seconds(10),
                        /*scaling=*/2.0)
                        .clone())));

        auto session = subscriber.Subscribe(
            [](pubsub::Message const& m, pubsub::AckHandler h) {
              std::move(h).ack();
              std::cout << "Received message " << m << "\n";
              PleaseIgnoreThisSimplifiesTestingTheSamples();
            });
        return std::make_pair(subscriber, std::move(session));
      };

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `location` | `std::string const &` Sets the prefix for the default [`EndpointOption`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1EndpointOption.html) value. |
| `subscription` | `Subscription` the Cloud Pub/Sub subscription used by the returned connection. |
| `opts` | `Options` The options to use for this call. Expected options are any of the types in the following option lists. - [`google::cloud::CommonOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::GrpcOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::pubsub::PolicyOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) - [`google::cloud::pubsub::SubscriberOptionList`](about:invalid#zCSafez) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SubscriberConnection >` |   |

### MakeSubscriberConnection(Subscription, Options)

A factory function to construct an object of type [`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection).
This overload of `MakeSubscriberConnection` does not require a location argument, creating a connection to the global service endpoint.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `subscription` | `Subscription` |
| `opts` | `Options` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SubscriberConnection >` |   |

### MakeSubscriptionAdminConnection(std::initializer_list\< internal::NonConstructible \>)

Creates a new [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) object to work with [`SubscriptionAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient).

> [!NOTE]
> **Note:** This function exists solely for backwards compatibility. It prevents existing code that calls `MakeSubscriptionAdminConnection({})` from breaking, due to ambiguity.

> [!WARNING]
> **Deprecated:** Please use [`MakeSubscriptionAdminConnection()`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) instead.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `std::initializer_list< internal::NonConstructible >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SubscriptionAdminConnection >` |   |

### MakeSubscriptionAdminConnection(Options)

Creates a new [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) object to work with [`SubscriptionAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient).
The [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) class is provided for applications wanting to mock the [`SubscriptionAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient) behavior in their tests. It is not intended for direct use.

###### Performance

Creating a new [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) is relatively expensive. This typically initiates connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the same [`Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) from `GrpcOptionList` and `CommonOptionList`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`SubscriptionAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `opts` | `Options` The options to use for this call. Expected options are any of the types in the following option lists. - [`google::cloud::CommonOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::GrpcOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::pubsub::PolicyOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SubscriptionAdminConnection >` |   |

### MakeSubscriptionAdminConnection(ConnectionOptions const \&, std::unique_ptr\< pubsub::RetryPolicy const \>, std::unique_ptr\< pubsub::BackoffPolicy const \>)

Creates a new [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) object to work with [`SubscriptionAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient).
The [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) class is not intended for direct use in applications, it is provided for applications wanting to mock the [`SubscriptionAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminClient) behavior in their tests.

###### Performance

Creating a new [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) is relatively expensive. This typically initiates connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the identical values for `options`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`SubscriberConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriberConnection)

> [!WARNING]
> **Deprecated:**
>
>
> Please use the `MakeSubscriptionAdminConnection` function that accepts [`google::cloud::Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) instead.

<br />

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `ConnectionOptions const &` (optional) configure the [`SubscriptionAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1SubscriptionAdminConnection) created by this function. |
| `retry_policy` | `std::unique_ptr< pubsub::RetryPolicy const >` control for how long (or how many times) are retryable RPCs attempted. |
| `backoff_policy` | `std::unique_ptr< pubsub::BackoffPolicy const >` controls the backoff behavior between retry attempts, typically some form of exponential backoff with jitter. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< SubscriptionAdminConnection >` |   |

### MakeTopicAdminConnection(std::initializer_list\< internal::NonConstructible \>)

Creates a new [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) object to work with [`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient).

> [!NOTE]
> **Note:** This function exists solely for backwards compatibility. It prevents existing code that calls `MakeTopicAdminConnection({})` from breaking, due to ambiguity.

> [!WARNING]
> **Deprecated:** Please use [`MakeTopicAdminConnection()`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) instead.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `std::initializer_list< internal::NonConstructible >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< TopicAdminConnection >` |   |

### MakeTopicAdminConnection(Options)

Creates a new [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) object to work with [`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient).
The [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) class is provided for applications wanting to mock the [`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient) behavior in their tests. It is not intended for direct use.

###### Performance

Creating a new [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) is relatively expensive. This typically initiates connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the same [`Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) from `GrpcOptionList` and `CommonOptionList`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `opts` | `Options` The options to use for this call. Expected options are any of the types in the following option lists. - [`google::cloud::CommonOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::GrpcOptionList`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html) - [`google::cloud::pubsub::PolicyOptionList`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/namespacegoogle_1_1cloud_1_1pubsub) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< TopicAdminConnection >` |   |

### MakeTopicAdminConnection(ConnectionOptions const \&, std::unique_ptr\< pubsub::RetryPolicy const \>, std::unique_ptr\< pubsub::BackoffPolicy const \>)

Creates a new [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) object to work with [`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient).
The [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) class is provided for applications wanting to mock the [`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient) behavior in their tests. It is not intended for direct use.

###### Performance

Creating a new [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) is relatively expensive. This typically initiate connections to the service, and therefore these objects should be shared and reused when possible. Note that gRPC reuses existing OS resources (sockets) whenever possible, so applications may experience better performance on the second (and subsequent) calls to this function with the identical values for `options`. However, this behavior is not guaranteed and applications should not rely on it.

###### See Also

[`TopicAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient)

> [!WARNING]
> **Deprecated:**
>
>
> Please use the `MakeTopicAdminConnection` function that accepts [`google::cloud::Options`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) instead.

<br />

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `ConnectionOptions const &` (optional) configure the [`TopicAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) created by this function. |
| `retry_policy` | `std::unique_ptr< pubsub::RetryPolicy const >` control for how long (or how many times) are retryable RPCs attempted. |
| `backoff_policy` | `std::unique_ptr< pubsub::BackoffPolicy const >` controls the backoff behavior between retry attempts, typically some form of exponential backoff with jitter. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::shared_ptr< TopicAdminConnection >` |   |

## Type Aliases

### ApplicationCallback

**Alias Of** : `std::function< void(Message, AckHandler)>` Defines the interface for application-level callbacks.
Applications provide a callable compatible with this type to receive messages. They acknowledge (or reject) messages using [`AckHandler`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1AckHandler). This is a move-only type to support asynchronously acknowledgments.

### ExactlyOnceApplicationCallback

**Alias Of** : `std::function< void(pubsub::Message, ExactlyOnceAckHandler)>` Defines the interface for application-level callbacks with exactly-once delivery.
Applications provide a callable compatible with this type to receive messages. They acknowledge (or reject) messages using [`ExactlyOnceAckHandler`](https://docs.cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1ExactlyOnceAckHandler). This is a move-only type to support asynchronous acknowledgments.

### BackoffPolicy

**Alias Of** : `::google::cloud::internal::BackoffPolicy` The base class for backoff policies.

### ExponentialBackoffPolicy

**Alias Of** : `google::cloud::internal::ExponentialBackoffPolicy` A truncated exponential backoff policy with randomized periods.

### ConnectionOptions

**Alias Of** : `::google::cloud::ConnectionOptions< ConnectionOptionsTraits >` Configure a connection for Cloud Pub/Sub services.

### PubsubMessageDataType

**Alias Of** : `std::decay_t< decltype(std::declval< google::pubsub::v1::PubsubMessage >().data())>` Defines the type for message data.
Inside Google some protobuf fields of type `bytes` are mapped to a different type than `std::string`. This is the case for message data. We use this type to automatically detect what is the representation for this field and use the correct mapping.

External users of the Cloud Pub/Sub C++ client library should treat this as a complicated `typedef` for `std::string`. We have no plans to change the type in the external version of the C++ client library for the foreseeable future. In the eventuality that we do decide to change the type, this would be a reason update the library major version number, and we would give users time to migrate.

In other words, external users of the Cloud Pub/Sub C++ client should simply write `std::string` where this type appears. For Google projects that must compile both inside and outside Google, this alias may be convenient.

### PolicyOptionList

**Alias Of** : `OptionList< RetryPolicyOption, BackoffPolicyOption >` The list of all "policy" options.

### PublisherOptionList

**Alias Of** : `OptionList< MaxHoldTimeOption, MaxBatchMessagesOption, MaxBatchBytesOption, MaxPendingMessagesOption, MaxPendingBytesOption, MessageOrderingOption, FullPublisherActionOption, CompressionThresholdOption, MaxOtelLinkCountOption >` The list of options specific to publishers.

### ListSubscriptionsRange

**Alias Of** : `google::cloud::internal::PaginationRange< google::pubsub::v1::Subscription >` An input range to stream Cloud Pub/Sub subscriptions.
This type models an [input range](https://en.cppreference.com/w/cpp/ranges/input_range) of `google::pubsub::v1::Subscription` objects. Applications can make a single pass through the results.

### ListSnapshotsRange

**Alias Of** : `google::cloud::internal::PaginationRange< google::pubsub::v1::Snapshot >` An input range to stream Cloud Pub/Sub snapshots.
This type models an [input range](https://en.cppreference.com/w/cpp/ranges/input_range) of `google::pubsub::v1::Snapshot` objects. Applications can make a single pass through the results.

### ListTopicsRange

**Alias Of** : `google::cloud::internal::PaginationRange< google::pubsub::v1::Topic >` An input range to stream Cloud Pub/Sub topics.
This type models an [input range](https://en.cppreference.com/w/cpp/ranges/input_range) of `google::pubsub::v1::Topic` objects. Applications can make a single pass through the results.

### ListTopicSubscriptionsRange

**Alias Of** : `google::cloud::internal::PaginationRange< std::string >` An input range to stream the Cloud Pub/Sub subscriptions of a topic.
This type models an [input range](https://en.cppreference.com/w/cpp/ranges/input_range) of `std::string` objects. Applications can make a single pass through the results.

### ListTopicSnapshotsRange

**Alias Of** : `google::cloud::internal::PaginationRange< std::string >` An input range to stream the Cloud Pub/Sub snapshots of a topic.
This type models an [input range](https://en.cppreference.com/w/cpp/ranges/input_range) of `std::string` objects. Applications can make a single pass through the results.