Module: Google::Cloud::Tasks::V2beta2::CloudTasks::Paths

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

Overview

Path helper methods for the CloudTasks API.

Instance Method Summary collapse

Instance Method Details

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


38
39
40
41
42
# File 'lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb', line 38

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

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

#queue_path(project:, location:, queue:) ⇒ ::String

Create a fully-qualified Queue resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/queues/{queue}

Parameters:

  • project (String)
  • location (String)
  • queue (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


56
57
58
59
60
61
# File 'lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb', line 56

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

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

#task_path(project:, location:, queue:, task:) ⇒ ::String

Create a fully-qualified Task resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/queues/{queue}/tasks/{task}

Parameters:

  • project (String)
  • location (String)
  • queue (String)
  • task (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


76
77
78
79
80
81
82
# File 'lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb', line 76

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

  "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}"
end