Module: Google::Cloud::Dialogflow::V2::Generators::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/dialogflow/v2/generators/paths.rb
Overview
Path helper methods for the Generators API.
Instance Method Summary collapse
-
#app_path(project:, location:, app:) ⇒ ::String
Create a fully-qualified App resource string.
-
#generator_path(project:, location:, generator:) ⇒ ::String
Create a fully-qualified Generator resource string.
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
-
#tool_path(**args) ⇒ ::String
Create a fully-qualified Tool resource string.
-
#toolset_path(project:, location:, app:, toolset:) ⇒ ::String
Create a fully-qualified Toolset resource string.
Instance Method Details
#app_path(project:, location:, app:) ⇒ ::String
Create a fully-qualified App resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/apps/{app}
39 40 41 42 43 44 |
# File 'lib/google/cloud/dialogflow/v2/generators/paths.rb', line 39 def app_path project:, location:, app: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/apps/#{app}" end |
#generator_path(project:, location:, generator:) ⇒ ::String
Create a fully-qualified Generator resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/generators/{generator}
58 59 60 61 62 63 |
# File 'lib/google/cloud/dialogflow/v2/generators/paths.rb', line 58 def generator_path project:, location:, generator: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/generators/#{generator}" end |
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
The resource will be in the following format:
projects/{project}
75 76 77 |
# File 'lib/google/cloud/dialogflow/v2/generators/paths.rb', line 75 def project_path project: "projects/#{project}" end |
#tool_path(project:, location:, tool:) ⇒ ::String #tool_path(project:, location:, app:, tool:) ⇒ ::String
Create a fully-qualified Tool resource string.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/google/cloud/dialogflow/v2/generators/paths.rb', line 102 def tool_path **args resources = { "location:project:tool" => (proc do |project:, location:, tool:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/tools/#{tool}" end), "app:location:project:tool" => (proc do |project:, location:, app:, tool:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#toolset_path(project:, location:, app:, toolset:) ⇒ ::String
Create a fully-qualified Toolset resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}
137 138 139 140 141 142 143 |
# File 'lib/google/cloud/dialogflow/v2/generators/paths.rb', line 137 def toolset_path project:, location:, app:, toolset: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" end |