Module: Google::Cloud::Build::V1::CloudBuild::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/build/v1/cloud_build/paths.rb
Overview
Path helper methods for the CloudBuild API.
Instance Method Summary collapse
-
#build_path(**args) ⇒ ::String
Create a fully-qualified Build resource string.
-
#build_trigger_path(**args) ⇒ ::String
Create a fully-qualified BuildTrigger resource string.
-
#crypto_key_path(project:, location:, keyring:, key:) ⇒ ::String
Create a fully-qualified CryptoKey resource string.
-
#github_enterprise_config_path(**args) ⇒ ::String
Create a fully-qualified GithubEnterpriseConfig resource string.
-
#location_path(project:, location:) ⇒ ::String
Create a fully-qualified Location resource string.
-
#network_path(project:, network:) ⇒ ::String
Create a fully-qualified Network resource string.
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
-
#repository_path(project:, location:, connection:, repository:) ⇒ ::String
Create a fully-qualified Repository resource string.
-
#secret_version_path(project:, secret:, version:) ⇒ ::String
Create a fully-qualified SecretVersion resource string.
-
#service_account_path(project:, service_account:) ⇒ ::String
Create a fully-qualified ServiceAccount resource string.
-
#subscription_path(project:, subscription:) ⇒ ::String
Create a fully-qualified Subscription resource string.
-
#topic_path(project:, topic:) ⇒ ::String
Create a fully-qualified Topic resource string.
-
#worker_pool_path(project:, location:, worker_pool:) ⇒ ::String
Create a fully-qualified WorkerPool resource string.
Instance Method Details
#build_path(project: , build: ) ⇒ ::String #build_path(project: , location: , build: ) ⇒ ::String
Create a fully-qualified Build resource string.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 48 def build_path **args resources = { "build:project" => (proc do |project:, build:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/builds/#{build}" end), "build:location:project" => (proc do |project:, location:, build:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/builds/#{build}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#build_trigger_path(project: , trigger: ) ⇒ ::String #build_trigger_path(project: , location: , trigger: ) ⇒ ::String
Create a fully-qualified BuildTrigger resource string.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 89 def build_trigger_path **args resources = { "project:trigger" => (proc do |project:, trigger:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/triggers/#{trigger}" end), "location:project:trigger" => (proc do |project:, location:, trigger:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/triggers/#{trigger}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#crypto_key_path(project:, location:, keyring:, key:) ⇒ ::String
Create a fully-qualified CryptoKey resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}
122 123 124 125 126 127 128 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 122 def crypto_key_path project:, location:, keyring:, key: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "keyring cannot contain /" if keyring.to_s.include? "/" "projects/#{project}/locations/#{location}/keyRings/#{keyring}/cryptoKeys/#{key}" end |
#github_enterprise_config_path(project: , config: ) ⇒ ::String #github_enterprise_config_path(project: , location: , config: ) ⇒ ::String
Create a fully-qualified GithubEnterpriseConfig resource string.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 151 def github_enterprise_config_path **args resources = { "config:project" => (proc do |project:, config:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/githubEnterpriseConfigs/#{config}" end), "config:location:project" => (proc do |project:, location:, config:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/githubEnterpriseConfigs/#{config}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#location_path(project:, location:) ⇒ ::String
Create a fully-qualified Location resource string.
The resource will be in the following format:
projects/{project}/locations/{location}
182 183 184 185 186 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 182 def location_path project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/locations/#{location}" end |
#network_path(project:, network:) ⇒ ::String
Create a fully-qualified Network resource string.
The resource will be in the following format:
projects/{project}/global/networks/{network}
199 200 201 202 203 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 199 def network_path project:, network: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/global/networks/#{network}" end |
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
The resource will be in the following format:
projects/{project}
215 216 217 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 215 def project_path project: "projects/#{project}" end |
#repository_path(project:, location:, connection:, repository:) ⇒ ::String
Create a fully-qualified Repository resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}
232 233 234 235 236 237 238 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 232 def repository_path project:, location:, connection:, repository: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "connection cannot contain /" if connection.to_s.include? "/" "projects/#{project}/locations/#{location}/connections/#{connection}/repositories/#{repository}" end |
#secret_version_path(project:, secret:, version:) ⇒ ::String
Create a fully-qualified SecretVersion resource string.
The resource will be in the following format:
projects/{project}/secrets/{secret}/versions/{version}
252 253 254 255 256 257 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 252 def secret_version_path project:, secret:, version: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" "projects/#{project}/secrets/#{secret}/versions/#{version}" end |
#service_account_path(project:, service_account:) ⇒ ::String
Create a fully-qualified ServiceAccount resource string.
The resource will be in the following format:
projects/{project}/serviceAccounts/{service_account}
270 271 272 273 274 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 270 def service_account_path project:, service_account: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/serviceAccounts/#{service_account}" end |
#subscription_path(project:, subscription:) ⇒ ::String
Create a fully-qualified Subscription resource string.
The resource will be in the following format:
projects/{project}/subscriptions/{subscription}
287 288 289 290 291 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 287 def subscription_path project:, subscription: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/subscriptions/#{subscription}" end |
#topic_path(project:, topic:) ⇒ ::String
Create a fully-qualified Topic resource string.
The resource will be in the following format:
projects/{project}/topics/{topic}
304 305 306 307 308 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 304 def topic_path project:, topic: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/topics/#{topic}" end |
#worker_pool_path(project:, location:, worker_pool:) ⇒ ::String
Create a fully-qualified WorkerPool resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/workerPools/{worker_pool}
322 323 324 325 326 327 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 322 def worker_pool_path project:, location:, worker_pool: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/workerPools/#{worker_pool}" end |