Module: Google::Cloud::Functions::V2::FunctionService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/functions/v2/function_service/paths.rb

Overview

Path helper methods for the FunctionService API.

Instance Method Summary collapse

Instance Method Details

#build_path(project:, location:, build:) ⇒ ::String

Create a fully-qualified Build resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/builds/{build}

Parameters:

  • project (String)
  • location (String)
  • build (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 39

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

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

#channel_path(project:, location:, channel:) ⇒ ::String

Create a fully-qualified Channel resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/channels/{channel}

Parameters:

  • project (String)
  • location (String)
  • channel (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


58
59
60
61
62
63
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 58

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

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

#connector_path(project:, location:, connector:) ⇒ ::String

Create a fully-qualified Connector resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/connectors/{connector}

Parameters:

  • project (String)
  • location (String)
  • connector (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


77
78
79
80
81
82
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 77

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

  "projects/#{project}/locations/#{location}/connectors/#{connector}"
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)


97
98
99
100
101
102
103
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 97

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

#function_path(project:, location:, function:) ⇒ ::String

Create a fully-qualified Function resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/functions/{function}

Parameters:

  • project (String)
  • location (String)
  • function (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


117
118
119
120
121
122
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 117

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

  "projects/#{project}/locations/#{location}/functions/#{function}"
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)


135
136
137
138
139
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 135

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

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

#repository_path(project:, location:, repository:) ⇒ ::String

Create a fully-qualified Repository resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}

Parameters:

  • project (String)
  • location (String)
  • repository (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


153
154
155
156
157
158
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 153

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

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

#service_path(project:, location:, service:) ⇒ ::String

Create a fully-qualified Service resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/services/{service}

Parameters:

  • project (String)
  • location (String)
  • service (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


172
173
174
175
176
177
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 172

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

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

#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)


190
191
192
193
194
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 190

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

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

#trigger_path(project:, location:, trigger:) ⇒ ::String

Create a fully-qualified Trigger resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/triggers/{trigger}

Parameters:

  • project (String)
  • location (String)
  • trigger (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


208
209
210
211
212
213
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 208

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

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

#worker_pool_path(project:, location:, worker_pool:) ⇒ ::String

Create a fully-qualified WorkerPool resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/workerPools/{worker_pool}

Parameters:

  • project (String)
  • location (String)
  • worker_pool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


227
228
229
230
231
232
# File 'lib/google/cloud/functions/v2/function_service/paths.rb', line 227

def worker_pool_path project:, location:, worker_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}/workerPools/#{worker_pool}"
end