# Cloud Pub/Sub V1 API - Class Google::Cloud::PubSub::V1::SubscriptionAdmin::Client (v1.16.0)

1.16.0 (latest) 1.15.0 1.14.2 1.13.0 1.12.0 1.11.1 1.10.0 1.9.0 1.8.2 1.7.1 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.2 1.0.0 0.25.0 0.24.0 0.23.0 0.22.0 0.21.2 0.20.2 0.19.0 0.18.1 0.17.4 0.16.0 0.15.1 0.14.0 0.13.1 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.1 0.6.2 Reference documentation and code samples for the Cloud Pub/Sub V1 API class Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.

rubocop:disable Style/Documentation

## Inherits

- Object

## Includes

- [Google::Cloud::PubSub::V1::SubscriptionAdmin::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the SubscriptionAdmin Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration "Google::Cloud::PubSub::V1::SubscriptionAdmin::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all SubscriptionAdmin clients
::Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.configure do |config|
  config.timeout = 10.0
end
```

### .configure_internal

    def self.configure_internal() { |config| ... } -> Client::Configuration

Configure the SubscriptionAdmin Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration "Google::Cloud::PubSub::V1::SubscriptionAdmin::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all SubscriptionAdmin clients
::Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.configure do |config|
  config.timeout = 10.0
end
```

### #acknowledge

    def acknowledge(request, options = nil) -> ::Google::Protobuf::Empty
    def acknowledge(subscription: nil, ack_ids: nil) -> ::Google::Protobuf::Empty

Acknowledges the messages associated with the `ack_ids` in the
`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
from the subscription.


<br />

Acknowledging a message whose ack deadline has expired may succeed,
but such a message may be redelivered later. Acknowledging a message more
than once will not result in an error.
**Overloads**

    def acknowledge(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `acknowledge` via a request object, either of type [AcknowledgeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-AcknowledgeRequest "Google::Cloud::PubSub::V1::AcknowledgeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::AcknowledgeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-AcknowledgeRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def acknowledge(subscription: nil, ack_ids: nil) -> ::Google::Protobuf::Empty

Pass arguments to `acknowledge` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **subscription** (::String) --- Required. The subscription whose message is being acknowledged. Format is `projects/{project}/subscriptions/{sub}`.
- **ack_ids** (::Array\<::String\>) --- Required. The acknowledgment ID for the messages being acknowledged that was returned by the Pub/Sub system in the `Pull` response. Must not be empty.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new

# Call the acknowledge method.
result = client.acknowledge request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the SubscriptionAdmin Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client#Google__Cloud__PubSub__V1__SubscriptionAdmin__Client_configure_class_ "Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration "Google::Cloud::PubSub::V1::SubscriptionAdmin::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))

### #create_snapshot

    def create_snapshot(request, options = nil) -> ::Google::Cloud::PubSub::V1::Snapshot
    def create_snapshot(name: nil, subscription: nil, labels: nil, tags: nil) -> ::Google::Cloud::PubSub::V1::Snapshot

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](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
generated name is populated in the returned Snapshot object. Note that for
REST API requests, you must specify a name in the request.
**Overloads**

    def create_snapshot(request, options = nil) -> ::Google::Cloud::PubSub::V1::Snapshot

Pass arguments to `create_snapshot` via a request object, either of type [CreateSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-CreateSnapshotRequest "Google::Cloud::PubSub::V1::CreateSnapshotRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::CreateSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-CreateSnapshotRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_snapshot(name: nil, subscription: nil, labels: nil, tags: nil) -> ::Google::Cloud::PubSub::V1::Snapshot

Pass arguments to `create_snapshot` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- 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** (::String) --- 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}`.
- **labels** (::Hash{::String =\> ::String}) --- Optional. See [Creating and managing
  labels](https://cloud.google.com/pubsub/docs/labels).
- **tags** (::Hash{::String =\> ::String}) --- Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" See https://docs.cloud.google.com/pubsub/docs/tags for more information on using tags with Pub/Sub resources.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new

# Call the create_snapshot method.
result = client.create_snapshot request

# The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
p result
```

### #create_subscription

    def create_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::Subscription
    def create_subscription(name: nil, topic: nil, push_config: nil, bigquery_config: nil, cloud_storage_config: nil, bigtable_config: nil, ack_deadline_seconds: nil, retain_acked_messages: nil, message_retention_duration: nil, labels: nil, enable_message_ordering: nil, expiration_policy: nil, filter: nil, dead_letter_policy: nil, retry_policy: nil, detached: nil, enable_exactly_once_delivery: nil, message_transforms: nil, tags: nil) -> ::Google::Cloud::PubSub::V1::Subscription

Creates a subscription to a given topic. See the [resource name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
If the subscription already exists, returns `ALREADY_EXISTS`.
If the corresponding topic doesn't exist, returns `NOT_FOUND`.


<br />

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](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
generated name is populated in the returned Subscription object. Note that
for REST API requests, you must specify a name in the request.
**Overloads**

    def create_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::Subscription

Pass arguments to `create_subscription` via a request object, either of type [Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription "Google::Cloud::PubSub::V1::Subscription (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_subscription(name: nil, topic: nil, push_config: nil, bigquery_config: nil, cloud_storage_config: nil, bigtable_config: nil, ack_deadline_seconds: nil, retain_acked_messages: nil, message_retention_duration: nil, labels: nil, enable_message_ordering: nil, expiration_policy: nil, filter: nil, dead_letter_policy: nil, retry_policy: nil, detached: nil, enable_exactly_once_delivery: nil, message_transforms: nil, tags: nil) -> ::Google::Cloud::PubSub::V1::Subscription

Pass arguments to `create_subscription` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- 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** (::String) --- 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::Cloud::PubSub::V1::PushConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PushConfig), ::Hash) --- Optional. If push delivery is used with this subscription, this field is used to configure it.
- **bigquery_config** ([::Google::Cloud::PubSub::V1::BigQueryConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-BigQueryConfig), ::Hash) --- Optional. If delivery to BigQuery is used with this subscription, this field is used to configure it.
- **cloud_storage_config** ([::Google::Cloud::PubSub::V1::CloudStorageConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-CloudStorageConfig), ::Hash) --- Optional. If delivery to Google Cloud Storage is used with this subscription, this field is used to configure it.
- **bigtable_config** ([::Google::Cloud::PubSub::V1::BigtableConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-BigtableConfig), ::Hash) --- Optional. If delivery to Bigtable is used with this subscription, this field is used to configure it.
- **ack_deadline_seconds** (::Integer) --- 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.
- **retain_acked_messages** (::Boolean) --- Optional. Indicates whether to retain acknowledged messages. If true, then messages are not expunged from the subscription's backlog, even if they are acknowledged, until they fall out of the `message_retention_duration` window. This must be true if you would like to [`Seek` to a timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in the past to replay previously-acknowledged messages.
- **message_retention_duration** ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Duration), ::Hash) --- Optional. How long to retain unacknowledged messages in the subscription's backlog, from the moment a message is published. If `retain_acked_messages` is true, then this also configures the retention of acknowledged messages, and thus configures how far back in time a `Seek` can be done. Defaults to 7 days. Cannot be more than 31 days or less than 10 minutes.
- **labels** (::Hash{::String =\> ::String}) --- Optional. See [Creating and managing
  labels](https://cloud.google.com/pubsub/docs/labels).
- **enable_message_ordering** (::Boolean) --- Optional. If true, messages published with the same `ordering_key` in `PubsubMessage` will be delivered to the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they may be delivered in any order.
- **expiration_policy** ([::Google::Cloud::PubSub::V1::ExpirationPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ExpirationPolicy), ::Hash) --- Optional. A policy that specifies the conditions for this subscription's expiration. A subscription is considered active as long as any connected subscriber is successfully consuming messages from the subscription or is issuing operations on the subscription. If `expiration_policy` is not set, a *default policy* with `ttl` of 31 days will be used. The minimum allowed value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, but `expiration_policy.ttl` is not set, the subscription never expires.
- **filter** (::String) --- Optional. An expression written in the Pub/Sub [filter
  language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, then only `PubsubMessage`s whose `attributes` field matches the filter are delivered on this subscription. If empty, then no messages are filtered out.
- **dead_letter_policy** ([::Google::Cloud::PubSub::V1::DeadLetterPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DeadLetterPolicy), ::Hash) --- Optional. A policy that specifies the conditions for dead lettering messages in this subscription. If dead_letter_policy is not set, dead lettering is disabled.


  The Pub/Sub service account associated with this subscriptions's
  parent project (i.e.,
  service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
  permission to Acknowledge() messages on this subscription.
- **retry_policy** ([::Google::Cloud::PubSub::V1::RetryPolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-RetryPolicy), ::Hash) --- Optional. A policy that specifies how Pub/Sub retries message delivery for this subscription.


  If not set, the default retry policy is applied. This generally implies
  that messages will be retried as soon as possible for healthy subscribers.
  RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded
  events for a given message.
- **detached** (::Boolean) --- Optional. Indicates whether the subscription is detached from its topic. Detached subscriptions don't receive messages from their topic and don't retain any backlog. `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will not be made.
- **enable_exactly_once_delivery** (::Boolean) --- Optional. If true, Pub/Sub provides the following guarantees for the delivery of a message with a given value of `message_id` on this subscription:


  - The message sent to a subscriber is guaranteed not to be resent before the message's acknowledgment deadline expires.
  - An acknowledged message will not be resent to a subscriber.

  Note that subscribers may still receive multiple copies of a message
  when `enable_exactly_once_delivery` is true if the message was published
  multiple times by a publisher client. These copies are considered distinct
  by Pub/Sub and have distinct `message_id` values.
- **message_transforms** (::Array\<[::Google::Cloud::PubSub::V1::MessageTransform](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-MessageTransform), ::Hash\>) --- Optional. Transforms to be applied to messages before they are delivered to subscribers. Transforms are applied in the order specified.
- **tags** (::Hash{::String =\> ::String}) --- Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" See https://docs.cloud.google.com/pubsub/docs/tags for more information on using tags with Pub/Sub resources.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::Subscription.new

# Call the create_subscription method.
result = client.create_subscription request

# The returned object is of type Google::Cloud::PubSub::V1::Subscription.
p result
```

### #delete_snapshot

    def delete_snapshot(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_snapshot(snapshot: nil) -> ::Google::Protobuf::Empty

Removes an existing 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.
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.
**Overloads**

    def delete_snapshot(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_snapshot` via a request object, either of type [DeleteSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DeleteSnapshotRequest "Google::Cloud::PubSub::V1::DeleteSnapshotRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::DeleteSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DeleteSnapshotRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_snapshot(snapshot: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_snapshot` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **snapshot** (::String) --- Required. The name of the snapshot to delete. Format is `projects/{project}/snapshots/{snap}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new

# Call the delete_snapshot method.
result = client.delete_snapshot request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_subscription

    def delete_subscription(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_subscription(subscription: nil) -> ::Google::Protobuf::Empty

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.
**Overloads**

    def delete_subscription(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_subscription` via a request object, either of type [DeleteSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DeleteSubscriptionRequest "Google::Cloud::PubSub::V1::DeleteSubscriptionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DeleteSubscriptionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_subscription(subscription: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_subscription` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **subscription** (::String) --- Required. The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new

# Call the delete_subscription method.
result = client.delete_subscription request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_snapshot

    def get_snapshot(request, options = nil) -> ::Google::Cloud::PubSub::V1::Snapshot
    def get_snapshot(snapshot: nil) -> ::Google::Cloud::PubSub::V1::Snapshot

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.
**Overloads**

    def get_snapshot(request, options = nil) -> ::Google::Cloud::PubSub::V1::Snapshot

Pass arguments to `get_snapshot` via a request object, either of type [GetSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-GetSnapshotRequest "Google::Cloud::PubSub::V1::GetSnapshotRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::GetSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-GetSnapshotRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_snapshot(snapshot: nil) -> ::Google::Cloud::PubSub::V1::Snapshot

Pass arguments to `get_snapshot` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **snapshot** (::String) --- Required. The name of the snapshot to get. Format is `projects/{project}/snapshots/{snap}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new

# Call the get_snapshot method.
result = client.get_snapshot request

# The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
p result
```

### #get_subscription

    def get_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::Subscription
    def get_subscription(subscription: nil) -> ::Google::Cloud::PubSub::V1::Subscription

Gets the configuration details of a subscription.
**Overloads**

    def get_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::Subscription

Pass arguments to `get_subscription` via a request object, either of type [GetSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-GetSubscriptionRequest "Google::Cloud::PubSub::V1::GetSubscriptionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::GetSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-GetSubscriptionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_subscription(subscription: nil) -> ::Google::Cloud::PubSub::V1::Subscription

Pass arguments to `get_subscription` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **subscription** (::String) --- Required. The name of the subscription to get. Format is `projects/{project}/subscriptions/{sub}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new

# Call the get_subscription method.
result = client.get_subscription request

# The returned object is of type Google::Cloud::PubSub::V1::Subscription.
p result
```

### #iam_policy_client

    def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

Get the associated client for mix-in of the IAMPolicy.
**Returns**

- (Google::Iam::V1::IAMPolicy::Client)

### #initialize

    def initialize() { |config| ... } -> Client

Create a new SubscriptionAdmin client object.
**Yields**

- (config) --- Configure the SubscriptionAdmin client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SubscriptionAdmin-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_snapshots

    def list_snapshots(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>
    def list_snapshots(project: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>

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.
**Overloads**

    def list_snapshots(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>

Pass arguments to `list_snapshots` via a request object, either of type [ListSnapshotsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListSnapshotsRequest "Google::Cloud::PubSub::V1::ListSnapshotsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::ListSnapshotsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListSnapshotsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_snapshots(project: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>

Pass arguments to `list_snapshots` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **project** (::String) --- Required. The name of the project in which to list snapshots. Format is `projects/{project-id}`.
- **page_size** (::Integer) --- Optional. Maximum number of snapshots to return.
- **page_token** (::String) --- Optional. The value returned by the last `ListSnapshotsResponse`; indicates that this is a continuation of a prior `ListSnapshots` call, and that the system should return the next page of data.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new

# Call the list_snapshots method.
result = client.list_snapshots request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot.
  p item
end
```

### #list_subscriptions

    def list_subscriptions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>
    def list_subscriptions(project: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>

Lists matching subscriptions.
**Overloads**

    def list_subscriptions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>

Pass arguments to `list_subscriptions` via a request object, either of type [ListSubscriptionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListSubscriptionsRequest "Google::Cloud::PubSub::V1::ListSubscriptionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::ListSubscriptionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListSubscriptionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_subscriptions(project: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>

Pass arguments to `list_subscriptions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **project** (::String) --- Required. The name of the project in which to list subscriptions. Format is `projects/{project-id}`.
- **page_size** (::Integer) --- Optional. Maximum number of subscriptions to return.
- **page_token** (::String) --- Optional. The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new

# Call the list_subscriptions method.
result = client.list_subscriptions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::PubSub::V1::Subscription.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #modify_ack_deadline

    def modify_ack_deadline(request, options = nil) -> ::Google::Protobuf::Empty
    def modify_ack_deadline(subscription: nil, ack_ids: nil, ack_deadline_seconds: nil) -> ::Google::Protobuf::Empty

Modifies the ack deadline for a specific message. This method is useful
to indicate that more time is needed to process a message by the
subscriber, or to make the message available for redelivery if the
processing was interrupted. Note that this does not modify the
subscription-level `ackDeadlineSeconds` used for subsequent messages.
**Overloads**

    def modify_ack_deadline(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `modify_ack_deadline` via a request object, either of type [ModifyAckDeadlineRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ModifyAckDeadlineRequest "Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ModifyAckDeadlineRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def modify_ack_deadline(subscription: nil, ack_ids: nil, ack_deadline_seconds: nil) -> ::Google::Protobuf::Empty

Pass arguments to `modify_ack_deadline` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **subscription** (::String) --- Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`.
- **ack_ids** (::Array\<::String\>) --- Required. List of acknowledgment IDs.
- **ack_deadline_seconds** (::Integer) --- Required. The new ack deadline with respect to the time this request was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might immediately make the message available for delivery to another subscriber client. This typically results in an increase in the rate of message redeliveries (that is, duplicates). The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify in a single request is 600 seconds (10 minutes).
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new

# Call the modify_ack_deadline method.
result = client.modify_ack_deadline request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #modify_push_config

    def modify_push_config(request, options = nil) -> ::Google::Protobuf::Empty
    def modify_push_config(subscription: nil, push_config: nil) -> ::Google::Protobuf::Empty

Modifies the `PushConfig` for a specified subscription.


<br />

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`.
**Overloads**

    def modify_push_config(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `modify_push_config` via a request object, either of type [ModifyPushConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ModifyPushConfigRequest "Google::Cloud::PubSub::V1::ModifyPushConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::ModifyPushConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ModifyPushConfigRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def modify_push_config(subscription: nil, push_config: nil) -> ::Google::Protobuf::Empty

Pass arguments to `modify_push_config` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **subscription** (::String) --- Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`.
- **push_config** ([::Google::Cloud::PubSub::V1::PushConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PushConfig), ::Hash) --- 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.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new

# Call the modify_push_config method.
result = client.modify_push_config request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #pull

    def pull(request, options = nil) -> ::Google::Cloud::PubSub::V1::PullResponse
    def pull(subscription: nil, return_immediately: nil, max_messages: nil) -> ::Google::Cloud::PubSub::V1::PullResponse

Pulls messages from the server.
**Overloads**

    def pull(request, options = nil) -> ::Google::Cloud::PubSub::V1::PullResponse

Pass arguments to `pull` via a request object, either of type [PullRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PullRequest "Google::Cloud::PubSub::V1::PullRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::PullRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PullRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def pull(subscription: nil, return_immediately: nil, max_messages: nil) -> ::Google::Cloud::PubSub::V1::PullResponse

Pass arguments to `pull` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **subscription** (::String) --- Required. The subscription from which messages should be pulled. Format is `projects/{project}/subscriptions/{sub}`.
- **return_immediately** (::Boolean) --- Optional. If this field set to true, the system will respond immediately even if it there are no messages available to return in the `Pull` response. Otherwise, the system may wait (for a bounded amount of time) until at least one message is available, rather than returning no messages. Warning: setting this field to `true` is discouraged because it adversely impacts the performance of `Pull` operations. We recommend that users do not set this field.
- **max_messages** (::Integer) --- Required. The maximum number of messages to return for this request. Must be a positive integer. The Pub/Sub system may return fewer than the number specified.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::PullResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PullResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::PullResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PullResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::PullRequest.new

# Call the pull method.
result = client.pull request

# The returned object is of type Google::Cloud::PubSub::V1::PullResponse.
p result
```

### #seek

    def seek(request, options = nil) -> ::Google::Cloud::PubSub::V1::SeekResponse
    def seek(subscription: nil, time: nil, snapshot: nil) -> ::Google::Cloud::PubSub::V1::SeekResponse

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](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. Note that both the subscription and the
snapshot must be on the same topic.
**Overloads**

    def seek(request, options = nil) -> ::Google::Cloud::PubSub::V1::SeekResponse

Pass arguments to `seek` via a request object, either of type [Google::Cloud::PubSub::V1::SeekRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SeekRequest "Google::Cloud::PubSub::V1::SeekRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::SeekRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SeekRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def seek(subscription: nil, time: nil, snapshot: nil) -> ::Google::Cloud::PubSub::V1::SeekResponse

Pass arguments to `seek` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **subscription** (::String) --- Required. The subscription to affect.
- **time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- Optional. The time to seek to. Messages retained in the subscription that were published before this time are marked as acknowledged, and messages retained in the subscription that were published after this time are marked as unacknowledged. Note that this operation affects only those messages retained in the subscription (configured by the combination of `message_retention_duration` and `retain_acked_messages`). For example, if `time` corresponds to a point before the message retention window (or to a point before the system's notion of the subscription creation time), only retained messages will be marked as unacknowledged, and already-expunged messages will not be restored.


  Note: The following parameters are mutually exclusive: `time`, `snapshot`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **snapshot** (::String) --- Optional. The snapshot to seek to. The snapshot's topic must be the same as that of the provided subscription. Format is `projects/{project}/snapshots/{snap}`.


  Note: The following parameters are mutually exclusive: `snapshot`, `time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::SeekResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SeekResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::SeekResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SeekResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::SeekRequest.new

# Call the seek method.
result = client.seek request

# The returned object is of type Google::Cloud::PubSub::V1::SeekResponse.
p result
```

### #streaming_pull

    def streaming_pull(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullResponse>

Establishes a stream with the server, which sends messages down to the
client. The client streams acknowledgments and ack deadline modifications
back to the server. The server will close the stream and return the status
on any error. The server may close the stream with status `UNAVAILABLE` to
reassign server-side resources, in which case, the client should
re-establish the stream. Flow control can be achieved by configuring the
underlying RPC channel.
**Parameters**

- **request** (::Gapic::StreamInput, ::Enumerable\<[::Google::Cloud::PubSub::V1::StreamingPullRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-StreamingPullRequest), ::Hash\>) --- An enumerable of [Google::Cloud::PubSub::V1::StreamingPullRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-StreamingPullRequest "Google::Cloud::PubSub::V1::StreamingPullRequest (class)") instances.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::PubSub::V1::StreamingPullResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-StreamingPullResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::PubSub::V1::StreamingPullResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-StreamingPullResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create an input stream.
input = Gapic::StreamInput.new

# Call the streaming_pull method to start streaming.
output = client.streaming_pull input

# Send requests on the stream. For each request object, set fields by
# passing keyword arguments. Be sure to close the stream when done.
input << Google::Cloud::PubSub::V1::StreamingPullRequest.new
input << Google::Cloud::PubSub::V1::StreamingPullRequest.new
input.close

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::PubSub::V1::StreamingPullResponse
output.each do |current_response|
  p current_response
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_snapshot

    def update_snapshot(request, options = nil) -> ::Google::Cloud::PubSub::V1::Snapshot
    def update_snapshot(snapshot: nil, update_mask: nil) -> ::Google::Cloud::PubSub::V1::Snapshot

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.
**Overloads**

    def update_snapshot(request, options = nil) -> ::Google::Cloud::PubSub::V1::Snapshot

Pass arguments to `update_snapshot` via a request object, either of type [UpdateSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-UpdateSnapshotRequest "Google::Cloud::PubSub::V1::UpdateSnapshotRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::UpdateSnapshotRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-UpdateSnapshotRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_snapshot(snapshot: nil, update_mask: nil) -> ::Google::Cloud::PubSub::V1::Snapshot

Pass arguments to `update_snapshot` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **snapshot** ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot), ::Hash) --- Required. The updated snapshot object.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Required. Indicates which fields in the provided snapshot to update. Must be specified and non-empty.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Snapshot](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Snapshot))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new

# Call the update_snapshot method.
result = client.update_snapshot request

# The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
p result
```

### #update_subscription

    def update_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::Subscription
    def update_subscription(subscription: nil, update_mask: nil) -> ::Google::Cloud::PubSub::V1::Subscription

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.
**Overloads**

    def update_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::Subscription

Pass arguments to `update_subscription` via a request object, either of type [UpdateSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-UpdateSubscriptionRequest "Google::Cloud::PubSub::V1::UpdateSubscriptionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-UpdateSubscriptionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_subscription(subscription: nil, update_mask: nil) -> ::Google::Cloud::PubSub::V1::Subscription

Pass arguments to `update_subscription` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **subscription** ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription), ::Hash) --- Required. The updated subscription object.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Required. Indicates which fields in the provided subscription to update. Must be specified and non-empty.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Subscription](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Subscription))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/pubsub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PubSub::V1::SubscriptionAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new

# Call the update_subscription method.
result = client.update_subscription request

# The returned object is of type Google::Cloud::PubSub::V1::Subscription.
p result
```