Module: Google::Cloud::Container::V1beta1::ClusterManager::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/container/v1beta1/cluster_manager/paths.rb

Overview

Path helper methods for the ClusterManager API.

Instance Method Summary collapse

Instance Method Details

#topic_path(project:, topic:) ⇒ ::String

Create a fully-qualified Topic resource string.

The resource will be in the following format:

projects/{project}/topics/{topic}

Parameters:

  • project (String)
  • topic (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/container/v1beta1/cluster_manager/paths.rb', line 38

def topic_path project:, topic:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/topics/#{topic}"
end