Class: Google::Apis::PubsubV1::Topic

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/pubsub_v1/classes.rb,
generated/google/apis/pubsub_v1/representations.rb,
generated/google/apis/pubsub_v1/representations.rb

Overview

A topic resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Topic

Returns a new instance of Topic



1098
1099
1100
# File 'generated/google/apis/pubsub_v1/classes.rb', line 1098

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#kms_key_nameString

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/*. Corresponds to the JSON property kmsKeyName

Returns:

  • (String)


1070
1071
1072
# File 'generated/google/apis/pubsub_v1/classes.rb', line 1070

def kms_key_name
  @kms_key_name
end

#labelsHash<String,String>

See Creating and managing labels. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


1076
1077
1078
# File 'generated/google/apis/pubsub_v1/classes.rb', line 1076

def labels
  @labels
end

#message_storage_policyGoogle::Apis::PubsubV1::MessageStoragePolicy

Policy constraining how messages published to the topic may be stored. It is determined when the topic is created based on the policy configured at the project level. It must not be set by the caller in the request to CreateTopic or to UpdateTopic. This field will be populated in the responses for GetTopic, CreateTopic, and UpdateTopic: if not present in the response, then no constraints are in effect. Corresponds to the JSON property messageStoragePolicy



1086
1087
1088
# File 'generated/google/apis/pubsub_v1/classes.rb', line 1086

def message_storage_policy
  @message_storage_policy
end

#nameString

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". Corresponds to the JSON property name

Returns:

  • (String)


1096
1097
1098
# File 'generated/google/apis/pubsub_v1/classes.rb', line 1096

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1103
1104
1105
1106
1107
1108
# File 'generated/google/apis/pubsub_v1/classes.rb', line 1103

def update!(**args)
  @kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
  @labels = args[:labels] if args.key?(:labels)
  @message_storage_policy = args[:message_storage_policy] if args.key?(:message_storage_policy)
  @name = args[:name] if args.key?(:name)
end