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.
-
#default_service_account_path(project:, location:) ⇒ ::String
Create a fully-qualified DefaultServiceAccount resource string.
-
#git_repository_link_path(project:, location:, connection:, git_repository_link:) ⇒ ::String
Create a fully-qualified GitRepositoryLink 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_attachment_path(project:, region:, networkattachment:) ⇒ ::String
Create a fully-qualified NetworkAttachment 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 |
#default_service_account_path(project:, location:) ⇒ ::String
Create a fully-qualified DefaultServiceAccount resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/defaultServiceAccount
141 142 143 144 145 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 141 def default_service_account_path project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/locations/#{location}/defaultServiceAccount" end |
#git_repository_link_path(project:, location:, connection:, git_repository_link:) ⇒ ::String
Create a fully-qualified GitRepositoryLink resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}
160 161 162 163 164 165 166 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 160 def git_repository_link_path project:, location:, connection:, git_repository_link: 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}/gitRepositoryLinks/#{git_repository_link}" end |
#github_enterprise_config_path(project:, config:) ⇒ ::String #github_enterprise_config_path(project:, location:, config:) ⇒ ::String
Create a fully-qualified GithubEnterpriseConfig resource string.
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 189 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}
220 221 222 223 224 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 220 def location_path project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/locations/#{location}" end |
#network_attachment_path(project:, region:, networkattachment:) ⇒ ::String
Create a fully-qualified NetworkAttachment resource string.
The resource will be in the following format:
projects/{project}/regions/{region}/networkAttachments/{networkattachment}
255 256 257 258 259 260 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 255 def project:, region:, networkattachment: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" "projects/#{project}/regions/#{region}/networkAttachments/#{}" 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}
237 238 239 240 241 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 237 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}
272 273 274 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 272 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}
289 290 291 292 293 294 295 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 289 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}
309 310 311 312 313 314 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 309 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}
327 328 329 330 331 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 327 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}
344 345 346 347 348 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 344 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}
361 362 363 364 365 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 361 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}
379 380 381 382 383 384 |
# File 'lib/google/cloud/build/v1/cloud_build/paths.rb', line 379 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 |