module Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Paths

Path helper methods for the WorkflowTemplateService API.

Public Instance Methods

cluster_path(project:, location:, cluster: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified Cluster resource string.

The resource will be in the following format:

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

@param project [String] @param location [String] @param cluster [String]

@return [::String]

# File lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb, line 39
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
location_path(project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified Location resource string.

The resource will be in the following format:

`projects/{project}/locations/{location}`

@param project [String] @param location [String]

@return [::String]

# File lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb, line 57
def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end
region_path(project:, region: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified Region resource string.

The resource will be in the following format:

`projects/{project}/regions/{region}`

@param project [String] @param region [String]

@return [::String]

# File lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb, line 74
def region_path project:, region:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/regions/#{region}"
end
workflow_template_path(**args) click to toggle source

Create a fully-qualified WorkflowTemplate resource string.

@overload workflow_template_path(project:, region:, workflow_template:)

The resource will be in the following format:

`projects/{project}/regions/{region}/workflowTemplates/{workflow_template}`

@param project [String]
@param region [String]
@param workflow_template [String]

@overload workflow_template_path(project:, location:, workflow_template:)

The resource will be in the following format:

`projects/{project}/locations/{location}/workflowTemplates/{workflow_template}`

@param project [String]
@param location [String]
@param workflow_template [String]

@return [::String]

# File lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb, line 102
def workflow_template_path **args
  resources = {
    "project:region:workflow_template" => (proc do |project:, region:, workflow_template:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"

      "projects/#{project}/regions/#{region}/workflowTemplates/#{workflow_template}"
    end),
    "location:project:workflow_template" => (proc do |project:, location:, workflow_template:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/workflowTemplates/#{workflow_template}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end