Module: Google::Cloud::Run::V2::Tasks::Paths

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

Overview

Path helper methods for the Tasks API.

Instance Method Summary collapse

Instance Method Details

#execution_path(project:, location:, job:, execution:) ⇒ ::String

Create a fully-qualified Execution resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/jobs/{job}/executions/{execution}

Parameters:

  • project (String)
  • location (String)
  • job (String)
  • execution (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/run/v2/tasks/paths.rb', line 40

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

  "projects/#{project}/locations/#{location}/jobs/#{job}/executions/#{execution}"
end

#task_path(project:, location:, job:, execution:, task:) ⇒ ::String

Create a fully-qualified Task resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}

Parameters:

  • project (String)
  • location (String)
  • job (String)
  • execution (String)
  • task (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


62
63
64
65
66
67
68
69
# File 'lib/google/cloud/run/v2/tasks/paths.rb', line 62

def task_path project:, location:, job:, execution:, task:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/"
  raise ::ArgumentError, "execution cannot contain /" if execution.to_s.include? "/"

  "projects/#{project}/locations/#{location}/jobs/#{job}/executions/#{execution}/tasks/#{task}"
end