Module: Google::Cloud::Dataproc::V1::WorkflowTemplateService::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb
Overview
Path helper methods for the WorkflowTemplateService API.
Instance Method Summary collapse
-
#location_path(project:, location:) ⇒ ::String
Create a fully-qualified Location resource string.
-
#node_group_path(project:, region:, cluster:, node_group:) ⇒ ::String
Create a fully-qualified NodeGroup resource string.
-
#region_path(project:, region:) ⇒ ::String
Create a fully-qualified Region resource string.
-
#service_path(project:, location:, service:) ⇒ ::String
Create a fully-qualified Service resource string.
-
#workflow_template_path(**args) ⇒ ::String
Create a fully-qualified WorkflowTemplate resource string.
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}
38 39 40 41 42 |
# File 'lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb', line 38 def location_path project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/locations/#{location}" end |
#node_group_path(project:, region:, cluster:, node_group:) ⇒ ::String
Create a fully-qualified NodeGroup resource string.
The resource will be in the following format:
projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}
57 58 59 60 61 62 63 |
# File 'lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb', line 57 def node_group_path project:, region:, cluster:, node_group: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" end |
#region_path(project:, region:) ⇒ ::String
Create a fully-qualified Region resource string.
The resource will be in the following format:
projects/{project}/regions/{region}
76 77 78 79 80 |
# File 'lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb', line 76 def region_path project:, region: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/regions/#{region}" 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}
94 95 96 97 98 99 |
# File 'lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb', line 94 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 |
#workflow_template_path(project: , region: , workflow_template: ) ⇒ ::String #workflow_template_path(project: , location: , workflow_template: ) ⇒ ::String
Create a fully-qualified WorkflowTemplate resource string.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb', line 123 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 |