Module: Google::Cloud::Config::V1::Config::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/config/v1/config/paths.rb

Overview

Path helper methods for the Config API.

Instance Method Summary collapse

Instance Method Details

#deployment_path(project:, location:, deployment:) ⇒ ::String

Create a fully-qualified Deployment resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/deployments/{deployment}

Parameters:

  • project (String)
  • location (String)
  • deployment (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/config/v1/config/paths.rb', line 39

def deployment_path project:, location:, deployment:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/deployments/#{deployment}"
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}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


57
58
59
60
61
# File 'lib/google/cloud/config/v1/config/paths.rb', line 57

def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end

#resource_path(project:, location:, deployment:, revision:, resource:) ⇒ ::String

Create a fully-qualified Resource resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}

Parameters:

  • project (String)
  • location (String)
  • deployment (String)
  • revision (String)
  • resource (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


77
78
79
80
81
82
83
84
# File 'lib/google/cloud/config/v1/config/paths.rb', line 77

def resource_path project:, location:, deployment:, revision:, resource:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "deployment cannot contain /" if deployment.to_s.include? "/"
  raise ::ArgumentError, "revision cannot contain /" if revision.to_s.include? "/"

  "projects/#{project}/locations/#{location}/deployments/#{deployment}/revisions/#{revision}/resources/#{resource}"
end

#revision_path(project:, location:, deployment:, revision:) ⇒ ::String

Create a fully-qualified Revision resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}

Parameters:

  • project (String)
  • location (String)
  • deployment (String)
  • revision (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


99
100
101
102
103
104
105
# File 'lib/google/cloud/config/v1/config/paths.rb', line 99

def revision_path project:, location:, deployment:, revision:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "deployment cannot contain /" if deployment.to_s.include? "/"

  "projects/#{project}/locations/#{location}/deployments/#{deployment}/revisions/#{revision}"
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}

Parameters:

  • project (String)
  • service_account (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


118
119
120
121
122
# File 'lib/google/cloud/config/v1/config/paths.rb', line 118

def  project:, service_account:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/serviceAccounts/#{}"
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}

Parameters:

  • project (String)
  • location (String)
  • worker_pool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


136
137
138
139
140
141
# File 'lib/google/cloud/config/v1/config/paths.rb', line 136

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