# Cloud Pub/Sub V1 API - Class Google::Cloud::PubSub::V1::TopicAdmin::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::TopicAdmin::Client.

rubocop:disable Style/Documentation

## Inherits

- Object

## Includes

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

## Methods

### .configure

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

Configure the TopicAdmin Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-TopicAdmin-Client-Configuration "Google::Cloud::PubSub::V1::TopicAdmin::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-TopicAdmin-Client-Configuration))
**Returns**

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

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

### .configure_internal

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

Configure the TopicAdmin Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-TopicAdmin-Client-Configuration "Google::Cloud::PubSub::V1::TopicAdmin::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-TopicAdmin-Client-Configuration))
**Returns**

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

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

### #configure

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

Configure the TopicAdmin 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-TopicAdmin-Client#Google__Cloud__PubSub__V1__TopicAdmin__Client_configure_class_ "Google::Cloud::PubSub::V1::TopicAdmin::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-TopicAdmin-Client-Configuration "Google::Cloud::PubSub::V1::TopicAdmin::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-TopicAdmin-Client-Configuration))
**Returns**

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

### #create_topic

    def create_topic(request, options = nil) -> ::Google::Cloud::PubSub::V1::Topic
    def create_topic(name: nil, labels: nil, message_storage_policy: nil, kms_key_name: nil, schema_settings: nil, satisfies_pzs: nil, message_retention_duration: nil, ingestion_data_source_settings: nil, message_transforms: nil, tags: nil) -> ::Google::Cloud::PubSub::V1::Topic

Creates the given topic with the given name. See the [resource name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
**Overloads**

    def create_topic(request, options = nil) -> ::Google::Cloud::PubSub::V1::Topic

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

- **request** ([::Google::Cloud::PubSub::V1::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic), ::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_topic(name: nil, labels: nil, message_storage_policy: nil, kms_key_name: nil, schema_settings: nil, satisfies_pzs: nil, message_retention_duration: nil, ingestion_data_source_settings: nil, message_transforms: nil, tags: nil) -> ::Google::Cloud::PubSub::V1::Topic

Pass arguments to `create_topic` 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 topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` 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"`.
- **labels** (::Hash{::String =\> ::String}) --- Optional. See [Creating and managing labels](https://cloud.google.com/pubsub/docs/labels).
- **message_storage_policy** ([::Google::Cloud::PubSub::V1::MessageStoragePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-MessageStoragePolicy), ::Hash) --- Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
- **kms_key_name** (::String) --- Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic.


  The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
- **schema_settings** ([::Google::Cloud::PubSub::V1::SchemaSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-SchemaSettings), ::Hash) --- Optional. Settings for validating messages published against a schema.
- **satisfies_pzs** (::Boolean) --- Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
- **message_retention_duration** ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Protobuf-Duration), ::Hash) --- Optional. Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last `message_retention_duration` are always available to subscribers. For instance, it allows any attached subscription to [seek to
  a
  timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) that is up to `message_retention_duration` in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. Cannot be more than 31 days or less than 10 minutes.
- **ingestion_data_source_settings** ([::Google::Cloud::PubSub::V1::IngestionDataSourceSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-IngestionDataSourceSettings), ::Hash) --- Optional. Settings for ingestion from a data source into this topic.
- **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 published to the topic. 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::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic))
**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::TopicAdmin::Client.new

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

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

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

### #delete_topic

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

Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
does not exist. After a topic is deleted, a new topic may be created with
the same name; this is an entirely new topic with none of the old
configuration or subscriptions. Existing subscriptions to this topic are
not deleted, but their `topic` field is set to `deleted-topic`.
**Overloads**

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

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

- **request** ([::Google::Cloud::PubSub::V1::DeleteTopicRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DeleteTopicRequest), ::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_topic(topic: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_topic` 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**

- **topic** (::String) --- Required. Name of the topic to delete. Format is `projects/{project}/topics/{topic}`.
**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::TopicAdmin::Client.new

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

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

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

### #detach_subscription

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

Detaches a subscription from this topic. All messages retained in the
subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
will return FAILED_PRECONDITION. If the subscription is a push
subscription, pushes to the endpoint will stop.
**Overloads**

    def detach_subscription(request, options = nil) -> ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse

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

- **request** ([::Google::Cloud::PubSub::V1::DetachSubscriptionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DetachSubscriptionRequest), ::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 detach_subscription(subscription: nil) -> ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse

Pass arguments to `detach_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 detach. Format is `projects/{project}/subscriptions/{subscription}`.
**Yields**

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

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

- ([::Google::Cloud::PubSub::V1::DetachSubscriptionResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-DetachSubscriptionResponse))
**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::TopicAdmin::Client.new

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

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

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

### #get_topic

    def get_topic(request, options = nil) -> ::Google::Cloud::PubSub::V1::Topic
    def get_topic(topic: nil) -> ::Google::Cloud::PubSub::V1::Topic

Gets the configuration of a topic.
**Overloads**

    def get_topic(request, options = nil) -> ::Google::Cloud::PubSub::V1::Topic

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

- **request** ([::Google::Cloud::PubSub::V1::GetTopicRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-GetTopicRequest), ::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_topic(topic: nil) -> ::Google::Cloud::PubSub::V1::Topic

Pass arguments to `get_topic` 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**

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

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

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

- ([::Google::Cloud::PubSub::V1::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic))
**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::TopicAdmin::Client.new

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

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

# The returned object is of type Google::Cloud::PubSub::V1::Topic.
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 TopicAdmin client object.
**Yields**

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

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

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

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

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

### #list_topic_snapshots

    def list_topic_snapshots(request, options = nil) -> ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse
    def list_topic_snapshots(topic: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse

Lists the names of the snapshots on this topic. 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_topic_snapshots(request, options = nil) -> ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse

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

- **request** ([::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicSnapshotsRequest), ::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_topic_snapshots(topic: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse

Pass arguments to `list_topic_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**

- **topic** (::String) --- Required. The name of the topic that snapshots are attached to. Format is `projects/{project}/topics/{topic}`.
- **page_size** (::Integer) --- Optional. Maximum number of snapshot names to return.
- **page_token** (::String) --- Optional. The value returned by the last `ListTopicSnapshotsResponse`; indicates that this is a continuation of a prior `ListTopicSnapshots` 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** ([::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicSnapshotsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicSnapshotsResponse))
**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::TopicAdmin::Client.new

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

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

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

### #list_topic_subscriptions

    def list_topic_subscriptions(request, options = nil) -> ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse
    def list_topic_subscriptions(topic: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse

Lists the names of the attached subscriptions on this topic.
**Overloads**

    def list_topic_subscriptions(request, options = nil) -> ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse

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

- **request** ([::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicSubscriptionsRequest), ::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_topic_subscriptions(topic: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse

Pass arguments to `list_topic_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**

- **topic** (::String) --- Required. The name of the topic that subscriptions are attached to. Format is `projects/{project}/topics/{topic}`.
- **page_size** (::Integer) --- Optional. Maximum number of subscription names to return.
- **page_token** (::String) --- Optional. The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` 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** ([::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicSubscriptionsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicSubscriptionsResponse))
**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::TopicAdmin::Client.new

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

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

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

### #list_topics

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

Lists matching topics.
**Overloads**

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

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

- **request** ([::Google::Cloud::PubSub::V1::ListTopicsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-ListTopicsRequest), ::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_topics(project: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Topic>

Pass arguments to `list_topics` 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 topics. Format is `projects/{project-id}`.
- **page_size** (::Integer) --- Optional. Maximum number of topics to return.
- **page_token** (::String) --- Optional. The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` 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::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::PubSub::V1::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic)\>)
**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::TopicAdmin::Client.new

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

# Call the list_topics method.
result = client.list_topics 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::Topic.
  p item
end
```

### #logger

    def logger() -> Logger

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

- (Logger)

### #publish

    def publish(request, options = nil) -> ::Google::Cloud::PubSub::V1::PublishResponse
    def publish(topic: nil, messages: nil) -> ::Google::Cloud::PubSub::V1::PublishResponse

Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
does not exist.
**Overloads**

    def publish(request, options = nil) -> ::Google::Cloud::PubSub::V1::PublishResponse

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

- **request** ([::Google::Cloud::PubSub::V1::PublishRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PublishRequest), ::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 publish(topic: nil, messages: nil) -> ::Google::Cloud::PubSub::V1::PublishResponse

Pass arguments to `publish` 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**

- **topic** (::String) --- Required. The messages in the request will be published on this topic. Format is `projects/{project}/topics/{topic}`.
- **messages** (::Array\<[::Google::Cloud::PubSub::V1::PubsubMessage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PubsubMessage), ::Hash\>) --- Required. The messages to publish.
**Yields**

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

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

- ([::Google::Cloud::PubSub::V1::PublishResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-PublishResponse))
**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::TopicAdmin::Client.new

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

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

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

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_topic

    def update_topic(request, options = nil) -> ::Google::Cloud::PubSub::V1::Topic
    def update_topic(topic: nil, update_mask: nil) -> ::Google::Cloud::PubSub::V1::Topic

Updates an existing topic by updating the fields specified in the update
mask. Note that certain properties of a topic are not modifiable.
**Overloads**

    def update_topic(request, options = nil) -> ::Google::Cloud::PubSub::V1::Topic

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

- **request** ([::Google::Cloud::PubSub::V1::UpdateTopicRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-UpdateTopicRequest), ::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_topic(topic: nil, update_mask: nil) -> ::Google::Cloud::PubSub::V1::Topic

Pass arguments to `update_topic` 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**

- **topic** ([::Google::Cloud::PubSub::V1::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic), ::Hash) --- Required. The updated topic 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 topic to update. Must be specified and non-empty. Note that if `update_mask` contains "message_storage_policy" but the `message_storage_policy` is not set in the `topic` provided above, then the updated value is determined by the policy configured at the project or organization level.
**Yields**

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

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

- ([::Google::Cloud::PubSub::V1::Topic](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest/Google-Cloud-PubSub-V1-Topic))
**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::TopicAdmin::Client.new

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

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

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