3.14.0-rc 3.13.0 (latest) 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 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 A service to manipulate subscriptions.

###### Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal `std::shared_ptr<*Connection>` objects compare equal. Objects that compare equal share the same underlying resources.

###### Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

###### Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

## Constructors

### SubscriptionAdminClient(SubscriptionAdminClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `SubscriptionAdminClient const &` |

### SubscriptionAdminClient(SubscriptionAdminClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `SubscriptionAdminClient &&` |

### SubscriptionAdminClient(std::shared_ptr\< SubscriptionAdminConnection \>, Options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `connection` | `std::shared_ptr< SubscriptionAdminConnection >` |
| `opts` | `Options` |

## Operators

### operator=(SubscriptionAdminClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `SubscriptionAdminClient const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `SubscriptionAdminClient &` |   |

### operator=(SubscriptionAdminClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `SubscriptionAdminClient &&` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `SubscriptionAdminClient &` |   |

## Functions

### CreateSubscription(std::string const \&, std::string const \&, google::pubsub::v1::PushConfig const \&, std::int32_t, Options)

Creates a subscription to a given topic.
See the [resource name rules](about:invalid#zCSafez). If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`.

If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format](about:invalid#zCSafez). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. Identifier. The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. |
| `topic` | `std::string const &` Required. The name of the topic from which this subscription is receiving messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be `_deleted-topic_` if the topic has been deleted. |
| `push_config` | `google::pubsub::v1::PushConfig const &` Optional. If push delivery is used with this subscription, this field is used to configure it. |
| `ack_deadline_seconds` | `std::int32_t` Optional. The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be *outstanding* . During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack deadline. To override this value for a given message, call `ModifyAckDeadline` with the corresponding `ack_id` if using non-streaming pull or send the `ack_id` in a `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds (10 minutes). If this parameter is 0, a default value of 10 seconds is used. For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Subscription >` | the result of the RPC. The response message type ([google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateSubscription(google::pubsub::v1::Subscription const \&, Options)

Creates a subscription to a given topic.
See the [resource name rules](about:invalid#zCSafez). If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`.

If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format](about:invalid#zCSafez). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::Subscription const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Subscription >` | the result of the RPC. The response message type ([google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

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

Gets the configuration details of a subscription.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `subscription` | `std::string const &` Required. The name of the subscription to get. Format is `projects/{project}/subscriptions/{sub}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Subscription >` | the result of the RPC. The response message type ([google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetSubscription(google::pubsub::v1::GetSubscriptionRequest const \&, Options)

Gets the configuration details of a subscription.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::GetSubscriptionRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.GetSubscriptionRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2224). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Subscription >` | the result of the RPC. The response message type ([google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSubscription(google::pubsub::v1::Subscription const \&, google::protobuf::FieldMask const \&, Options)

Updates an existing subscription by updating the fields specified in the update mask.
Note that certain properties of a subscription, such as its topic, are not modifiable.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `subscription` | `google::pubsub::v1::Subscription const &` Required. The updated subscription object. |
| `update_mask` | `google::protobuf::FieldMask const &` Required. Indicates which fields in the provided subscription to update. Must be specified and non-empty. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Subscription >` | the result of the RPC. The response message type ([google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSubscription(google::pubsub::v1::UpdateSubscriptionRequest const \&, Options)

Updates an existing subscription by updating the fields specified in the update mask.
Note that certain properties of a subscription, such as its topic, are not modifiable.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::UpdateSubscriptionRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.UpdateSubscriptionRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2236). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Subscription >` | the result of the RPC. The response message type ([google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

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

Lists matching subscriptions.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `std::string const &` Required. The name of the project in which to list subscriptions. Format is `projects/{project-id}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::pubsub::v1::Subscription >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListSubscriptions(google::pubsub::v1::ListSubscriptionsRequest, Options)

Lists matching subscriptions.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::ListSubscriptionsRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.ListSubscriptionsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2247). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::pubsub::v1::Subscription >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.pubsub.v1.Subscription](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L1472), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

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

Deletes an existing subscription.
All messages retained in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `subscription` | `std::string const &` Required. The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeleteSubscription(google::pubsub::v1::DeleteSubscriptionRequest const \&, Options)

Deletes an existing subscription.
All messages retained in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::DeleteSubscriptionRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.DeleteSubscriptionRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2279). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### ModifyPushConfig(std::string const \&, google::pubsub::v1::PushConfig const \&, Options)

Modifies the `PushConfig` for a specified subscription.
This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `subscription` | `std::string const &` Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`. |
| `push_config` | `google::pubsub::v1::PushConfig const &` Required. The push configuration for future deliveries. An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages from the given subscription and allow messages to be pulled and acknowledged - effectively pausing the subscription if `Pull` or `StreamingPull` is not called. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### ModifyPushConfig(google::pubsub::v1::ModifyPushConfigRequest const \&, Options)

Modifies the `PushConfig` for a specified subscription.
This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::ModifyPushConfigRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.ModifyPushConfigRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2291). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

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

Gets the configuration details of a snapshot.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `snapshot` | `std::string const &` Required. The name of the snapshot to get. Format is `projects/{project}/snapshots/{snap}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Snapshot >` | the result of the RPC. The response message type ([google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetSnapshot(google::pubsub::v1::GetSnapshotRequest const \&, Options)

Gets the configuration details of a snapshot.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::GetSnapshotRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.GetSnapshotRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2649). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Snapshot >` | the result of the RPC. The response message type ([google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

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

Lists the existing snapshots.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `std::string const &` Required. The name of the project in which to list snapshots. Format is `projects/{project-id}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::pubsub::v1::Snapshot >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListSnapshots(google::pubsub::v1::ListSnapshotsRequest, Options)

Lists the existing snapshots.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::ListSnapshotsRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.ListSnapshotsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2659). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::pubsub::v1::Snapshot >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

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

Creates a snapshot from the requested subscription.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format](about:invalid#zCSafez). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the [resource name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). Format is `projects/{project}/snapshots/{snap}`. |
| `subscription` | `std::string const &` Required. The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is `projects/{project}/subscriptions/{sub}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Snapshot >` | the result of the RPC. The response message type ([google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateSnapshot(google::pubsub::v1::CreateSnapshotRequest const \&, Options)

Creates a snapshot from the requested subscription.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format](about:invalid#zCSafez). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::CreateSnapshotRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.CreateSnapshotRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2550). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Snapshot >` | the result of the RPC. The response message type ([google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSnapshot(google::pubsub::v1::Snapshot const \&, google::protobuf::FieldMask const \&, Options)

Updates an existing snapshot by updating the fields specified in the update mask.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `snapshot` | `google::pubsub::v1::Snapshot const &` Required. The updated snapshot object. |
| `update_mask` | `google::protobuf::FieldMask const &` Required. Indicates which fields in the provided snapshot to update. Must be specified and non-empty. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Snapshot >` | the result of the RPC. The response message type ([google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateSnapshot(google::pubsub::v1::UpdateSnapshotRequest const \&, Options)

Updates an existing snapshot by updating the fields specified in the update mask.
Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::UpdateSnapshotRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.UpdateSnapshotRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2597). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::Snapshot >` | the result of the RPC. The response message type ([google.pubsub.v1.Snapshot](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2612)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

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

Removes an existing snapshot.
Snapshots are used in [Seek](about:invalid#zCSafez) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `snapshot` | `std::string const &` Required. The name of the snapshot to delete. Format is `projects/{project}/snapshots/{snap}`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeleteSnapshot(google::pubsub::v1::DeleteSnapshotRequest const \&, Options)

Removes an existing snapshot.
Snapshots are used in [Seek](about:invalid#zCSafez) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::DeleteSnapshotRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.DeleteSnapshotRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2690). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### Seek(google::pubsub::v1::SeekRequest const \&, Options)

Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request.
Snapshots are used in [Seek](about:invalid#zCSafez) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. Note that both the subscription and the snapshot must be on the same topic.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::pubsub::v1::SeekRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.pubsub.v1.SeekRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2700). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::pubsub::v1::SeekResponse >` | the result of the RPC. The response message type ([google.pubsub.v1.SeekResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/pubsub/v1/pubsub.proto#L2736)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### SetIamPolicy(google::iam::v1::SetIamPolicyRequest const \&, Options)

Sets the access control policy on the specified resource.
Replaces any existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::SetIamPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.SetIamPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L100). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetIamPolicy(google::iam::v1::GetIamPolicyRequest const \&, Options)

Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy set.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::GetIamPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.GetIamPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L123). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const \&, Options)

Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::TestIamPermissionsRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.TestIamPermissionsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L137). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::TestIamPermissionsResponse >` | the result of the RPC. The response message type ([google.iam.v1.TestIamPermissionsResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L153)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |