# Cloud Pub/Sub v1 API - Class Topic (3.36.0)

3.36.0 (latest) 3.35.0 3.34.0 3.33.0 3.32.0 3.31.0 3.30.0 3.29.0 3.28.0 3.27.0 3.26.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.1 3.9.1 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0

    public sealed class Topic : IMessage<Topic>, IEquatable<Topic>, IDeepCloneable<Topic>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Pub/Sub v1 API class Topic.

A topic resource.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Topic

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Topic](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Topic](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Topic](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.PubSub.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1)

## Assembly

Google.Cloud.PubSub.V1.dll

## Constructors

### Topic()

    public Topic()

### Topic(Topic)

    public Topic(Topic other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic` |

## Properties

### IngestionDataSourceSettings

    public IngestionDataSourceSettings IngestionDataSourceSettings { get; set; }

Optional. Settings for ingestion from a data source into this topic.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.IngestionDataSourceSettings` |   |

### KmsKeyName

    public string KmsKeyName { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### KmsKeyNameAsCryptoKeyName

    public CryptoKeyName KmsKeyNameAsCryptoKeyName { get; set; }

[CryptoKeyName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CryptoKeyName)-typed view over the [KmsKeyName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic#Google_Cloud_PubSub_V1_Topic_KmsKeyName) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CryptoKeyName` |   |

### Labels

    public MapField<string, string> Labels { get; }

Optional. See [Creating and managing labels](https://cloud.google.com/pubsub/docs/labels).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### MessageRetentionDuration

    public Duration MessageRetentionDuration { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Duration.html` |   |

### MessageStoragePolicy

    public MessageStoragePolicy MessageStoragePolicy { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.MessageStoragePolicy` |   |

### MessageTransforms

    public RepeatedField<MessageTransform> MessageTransforms { get; }

Optional. Transforms to be applied to messages published to the topic.
Transforms are applied in the order specified.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.MessageTransform` |   |

### Name

    public string Name { get; set; }

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"`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### SatisfiesPzs

    public bool SatisfiesPzs { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### SchemaSettings

    public SchemaSettings SchemaSettings { get; set; }

Optional. Settings for validating messages published against a schema.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SchemaSettings` |   |

### State

    public Topic.Types.State State { get; set; }

Output only. An output-only field indicating the state of the topic.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topichttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic.Types.State` |   |

### Tags

    public MapField<string, string> Tags { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### TopicName

    public TopicName TopicName { get; set; }

[TopicName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.TopicName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.Topic#Google_Cloud_PubSub_V1_Topic_Name) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.TopicName` |   |