Class Topic (1.118.0)

  public 
  
 final 
  
 class 
 Topic 
  
 extends 
  
 GeneratedMessageV3 
  
 implements 
  
 TopicOrBuilder 
 

A topic resource.

Protobuf type google.pubsub.v1.Topic

Implements

TopicOrBuilder

Static Fields

KMS_KEY_NAME_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 KMS_KEY_NAME_FIELD_NUMBER 
 
Field Value
Type Description
int

LABELS_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 LABELS_FIELD_NUMBER 
 
Field Value
Type Description
int

MESSAGE_RETENTION_DURATION_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 MESSAGE_RETENTION_DURATION_FIELD_NUMBER 
 
Field Value
Type Description
int

MESSAGE_STORAGE_POLICY_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 MESSAGE_STORAGE_POLICY_FIELD_NUMBER 
 
Field Value
Type Description
int

NAME_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 NAME_FIELD_NUMBER 
 
Field Value
Type Description
int

SATISFIES_PZS_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 SATISFIES_PZS_FIELD_NUMBER 
 
Field Value
Type Description
int

SCHEMA_SETTINGS_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 SCHEMA_SETTINGS_FIELD_NUMBER 
 
Field Value
Type Description
int

Static Methods

getDefaultInstance()

  public 
  
 static 
  
 Topic 
  
 getDefaultInstance 
 () 
 
Returns
Type Description
Topic

getDescriptor()

  public 
  
 static 
  
 final 
  
 Descriptors 
 . 
 Descriptor 
  
 getDescriptor 
 () 
 
Returns
Type Description
Descriptor

newBuilder()

  public 
  
 static 
  
 Topic 
 . 
 Builder 
  
 newBuilder 
 () 
 
Returns
Type Description
Topic.Builder

newBuilder(Topic prototype)

  public 
  
 static 
  
 Topic 
 . 
 Builder 
  
 newBuilder 
 ( 
 Topic 
  
 prototype 
 ) 
 
Parameter
Name Description
prototype Topic
Returns
Type Description
Topic.Builder

parseDelimitedFrom(InputStream input)

  public 
  
 static 
  
 Topic 
  
 parseDelimitedFrom 
 ( 
 InputStream 
  
 input 
 ) 
 
Parameter
Name Description
input InputStream
Returns
Type Description
Topic
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Topic 
  
 parseDelimitedFrom 
 ( 
 InputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Topic
Exceptions
Type Description
IOException

parseFrom(byte[] data)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 byte 
 [] 
  
 data 
 ) 
 
Parameter
Name Description
data byte []
Returns
Type Description
Topic
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 byte 
 [] 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name Description
data byte []
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Topic
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 ByteString 
  
 data 
 ) 
 
Parameter
Name Description
data ByteString
Returns
Type Description
Topic
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 ByteString 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Topic
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 CodedInputStream 
  
 input 
 ) 
 
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Topic
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 CodedInputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Topic
Exceptions
Type Description
IOException

parseFrom(InputStream input)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 InputStream 
  
 input 
 ) 
 
Parameter
Name Description
input InputStream
Returns
Type Description
Topic
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 InputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Topic
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 ByteBuffer 
  
 data 
 ) 
 
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Topic
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Topic 
  
 parseFrom 
 ( 
 ByteBuffer 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Topic
Exceptions
Type Description
InvalidProtocolBufferException

parser()

  public 
  
 static 
  
 Parser<Topic> 
  
 parser 
 () 
 
Returns
Type Description
Parser < Topic >

Methods

containsLabels(String key)

  public 
  
 boolean 
  
 containsLabels 
 ( 
 String 
  
 key 
 ) 
 

See Creating and managing labels .

map<string, string> labels = 2;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

  public 
  
 boolean 
  
 equals 
 ( 
 Object 
  
 obj 
 ) 
 
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

  public 
  
 Topic 
  
 getDefaultInstanceForType 
 () 
 
Returns
Type Description
Topic

getKmsKeyName()

  public 
  
 String 
  
 getKmsKeyName 
 () 
 

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

string kms_key_name = 5;

Returns
Type Description
String

The kmsKeyName.

getKmsKeyNameBytes()

  public 
  
 ByteString 
  
 getKmsKeyNameBytes 
 () 
 

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

string kms_key_name = 5;

Returns
Type Description
ByteString

The bytes for kmsKeyName.

getLabels()

  public 
  
 Map<String 
 , 
 String 
>  
 getLabels 
 () 
 

Use #getLabelsMap() instead.

Returns
Type Description
Map < String , String >

getLabelsCount()

  public 
  
 int 
  
 getLabelsCount 
 () 
 

See Creating and managing labels .

map<string, string> labels = 2;

Returns
Type Description
int

getLabelsMap()

  public 
  
 Map<String 
 , 
 String 
>  
 getLabelsMap 
 () 
 

See Creating and managing labels .

map<string, string> labels = 2;

Returns
Type Description
Map < String , String >

getLabelsOrDefault(String key, String defaultValue)

  public 
  
 String 
  
 getLabelsOrDefault 
 ( 
 String 
  
 key 
 , 
  
 String 
  
 defaultValue 
 ) 
 

See Creating and managing labels .

map<string, string> labels = 2;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

  public 
  
 String 
  
 getLabelsOrThrow 
 ( 
 String 
  
 key 
 ) 
 

See Creating and managing labels .

map<string, string> labels = 2;

Parameter
Name Description
key String
Returns
Type Description
String

getMessageRetentionDuration()

  public 
  
 Duration 
  
 getMessageRetentionDuration 
 () 
 

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 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 7 days or less than 10 minutes.

.google.protobuf.Duration message_retention_duration = 8;

Returns
Type Description
Duration

The messageRetentionDuration.

getMessageRetentionDurationOrBuilder()

  public 
  
 DurationOrBuilder 
  
 getMessageRetentionDurationOrBuilder 
 () 
 

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 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 7 days or less than 10 minutes.

.google.protobuf.Duration message_retention_duration = 8;

Returns
Type Description
DurationOrBuilder

getMessageStoragePolicy()

  public 
  
 MessageStoragePolicy 
  
 getMessageStoragePolicy 
 () 
 

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.

.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;

Returns
Type Description
MessageStoragePolicy

The messageStoragePolicy.

getMessageStoragePolicyOrBuilder()

  public 
  
 MessageStoragePolicyOrBuilder 
  
 getMessageStoragePolicyOrBuilder 
 () 
 

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.

.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;

Returns
Type Description
MessageStoragePolicyOrBuilder

getName()

  public 
  
 String 
  
 getName 
 () 
 

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

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The name.

getNameBytes()

  public 
  
 ByteString 
  
 getNameBytes 
 () 
 

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

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

  public 
  
 Parser<Topic> 
  
 getParserForType 
 () 
 
Returns
Type Description
Parser < Topic >
Overrides

getSatisfiesPzs()

  public 
  
 boolean 
  
 getSatisfiesPzs 
 () 
 

Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.

bool satisfies_pzs = 7;

Returns
Type Description
boolean

The satisfiesPzs.

getSchemaSettings()

  public 
  
 SchemaSettings 
  
 getSchemaSettings 
 () 
 

Settings for validating messages published against a schema.

.google.pubsub.v1.SchemaSettings schema_settings = 6;

Returns
Type Description
SchemaSettings

The schemaSettings.

getSchemaSettingsOrBuilder()

  public 
  
 SchemaSettingsOrBuilder 
  
 getSchemaSettingsOrBuilder 
 () 
 

Settings for validating messages published against a schema.

.google.pubsub.v1.SchemaSettings schema_settings = 6;

Returns
Type Description
SchemaSettingsOrBuilder

getSerializedSize()

  public 
  
 int 
  
 getSerializedSize 
 () 
 
Returns
Type Description
int
Overrides

getUnknownFields()

  public 
  
 final 
  
 UnknownFieldSet 
  
 getUnknownFields 
 () 
 
Returns
Type Description
UnknownFieldSet
Overrides

hasMessageRetentionDuration()

  public 
  
 boolean 
  
 hasMessageRetentionDuration 
 () 
 

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 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 7 days or less than 10 minutes.

.google.protobuf.Duration message_retention_duration = 8;

Returns
Type Description
boolean

Whether the messageRetentionDuration field is set.

hasMessageStoragePolicy()

  public 
  
 boolean 
  
 hasMessageStoragePolicy 
 () 
 

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.

.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;

Returns
Type Description
boolean

Whether the messageStoragePolicy field is set.

hasSchemaSettings()

  public 
  
 boolean 
  
 hasSchemaSettings 
 () 
 

Settings for validating messages published against a schema.

.google.pubsub.v1.SchemaSettings schema_settings = 6;

Returns
Type Description
boolean

Whether the schemaSettings field is set.

hashCode()

  public 
  
 int 
  
 hashCode 
 () 
 
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

  protected 
  
 GeneratedMessageV3 
 . 
 FieldAccessorTable 
  
 internalGetFieldAccessorTable 
 () 
 
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapField(int number)

  protected 
  
 MapField 
  
 internalGetMapField 
 ( 
 int 
  
 number 
 ) 
 
Parameter
Name Description
number int
Returns
Type Description
MapField
Overrides

isInitialized()

  public 
  
 final 
  
 boolean 
  
 isInitialized 
 () 
 
Returns
Type Description
boolean
Overrides

newBuilderForType()

  public 
  
 Topic 
 . 
 Builder 
  
 newBuilderForType 
 () 
 
Returns
Type Description
Topic.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

  protected 
  
 Topic 
 . 
 Builder 
  
 newBuilderForType 
 ( 
 GeneratedMessageV3 
 . 
 BuilderParent 
  
 parent 
 ) 
 
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Topic.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

  protected 
  
 Object 
  
 newInstance 
 ( 
 GeneratedMessageV3 
 . 
 UnusedPrivateParameter 
  
 unused 
 ) 
 
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

  public 
  
 Topic 
 . 
 Builder 
  
 toBuilder 
 () 
 
Returns
Type Description
Topic.Builder

writeTo(CodedOutputStream output)

  public 
  
 void 
  
 writeTo 
 ( 
 CodedOutputStream 
  
 output 
 ) 
 
Parameter
Name Description
output CodedOutputStream
Overrides Exceptions
Type Description
IOException
Create a Mobile Website
View Site in Mobile | Classic
Share by: