Module: Google::Cloud::ManagedKafka::V1::ManagedKafka::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb

Overview

Path helper methods for the ManagedKafka API.

Instance Method Summary collapse

Instance Method Details

#acl_path(project:, location:, cluster:, acl:) ⇒ ::String

Create a fully-qualified Acl resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl}

Parameters:

  • project (String)
  • location (String)
  • cluster (String)
  • acl (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 40

def acl_path project:, location:, cluster:, acl:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/"

  "projects/#{project}/locations/#{location}/clusters/#{cluster}/acls/#{acl}"
end

#ca_pool_path(project:, location:, ca_pool:) ⇒ ::String

Create a fully-qualified CaPool resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/caPools/{ca_pool}

Parameters:

  • project (String)
  • location (String)
  • ca_pool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


60
61
62
63
64
65
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 60

def ca_pool_path project:, location:, ca_pool:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/caPools/#{ca_pool}"
end

#cluster_path(project:, location:, cluster:) ⇒ ::String

Create a fully-qualified Cluster resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/clusters/{cluster}

Parameters:

  • project (String)
  • location (String)
  • cluster (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


79
80
81
82
83
84
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 79

def cluster_path project:, location:, cluster:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/clusters/#{cluster}"
end

#consumer_group_path(project:, location:, cluster:, consumer_group:) ⇒ ::String

Create a fully-qualified ConsumerGroup resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group}

Parameters:

  • project (String)
  • location (String)
  • cluster (String)
  • consumer_group (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


99
100
101
102
103
104
105
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 99

def consumer_group_path project:, location:, cluster:, consumer_group:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/"

  "projects/#{project}/locations/#{location}/clusters/#{cluster}/consumerGroups/#{consumer_group}"
end

#crypto_key_path(project:, location:, key_ring:, crypto_key:) ⇒ ::String

Create a fully-qualified CryptoKey resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}

Parameters:

  • project (String)
  • location (String)
  • key_ring (String)
  • crypto_key (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


120
121
122
123
124
125
126
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 120

def crypto_key_path project:, location:, key_ring:, crypto_key:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
end

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


139
140
141
142
143
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 139

def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end

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

Create a fully-qualified Topic resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}

Parameters:

  • project (String)
  • location (String)
  • cluster (String)
  • topic (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


158
159
160
161
162
163
164
# File 'lib/google/cloud/managed_kafka/v1/managed_kafka/paths.rb', line 158

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

  "projects/#{project}/locations/#{location}/clusters/#{cluster}/topics/#{topic}"
end