module Google::Cloud::Kms::V1::KeyManagementService::Paths

Path helper methods for the KeyManagementService API.

Public Instance Methods

crypto_key_path(project:, location:, key_ring:, crypto_key: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified CryptoKey resource string.

The resource will be in the following format:

`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`

@param project [String] @param location [String] @param key_ring [String] @param crypto_key [String]

@return [::String]

# File lib/google/cloud/kms/v1/key_management_service/paths.rb, line 40
def crypto_key_path project:, location:, key_ring:, crypto_key:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
end
crypto_key_version_path(project:, location:, key_ring:, crypto_key:, crypto_key_version: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified CryptoKeyVersion resource string.

The resource will be in the following format:

`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`

@param project [String] @param location [String] @param key_ring [String] @param crypto_key [String] @param crypto_key_version [String]

@return [::String]

# File lib/google/cloud/kms/v1/key_management_service/paths.rb, line 62
def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
  raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
end
import_job_path(project:, location:, key_ring:, import_job: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified ImportJob resource string.

The resource will be in the following format:

`projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}`

@param project [String] @param location [String] @param key_ring [String] @param import_job [String]

@return [::String]

# File lib/google/cloud/kms/v1/key_management_service/paths.rb, line 84
def import_job_path project:, location:, key_ring:, import_job:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/importJobs/#{import_job}"
end
key_ring_path(project:, location:, key_ring: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified KeyRing resource string.

The resource will be in the following format:

`projects/{project}/locations/{location}/keyRings/{key_ring}`

@param project [String] @param location [String] @param key_ring [String]

@return [::String]

# File lib/google/cloud/kms/v1/key_management_service/paths.rb, line 104
def key_ring_path project:, location:, key_ring:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}"
end
location_path(project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/") click to toggle source

Create a fully-qualified Location resource string.

The resource will be in the following format:

`projects/{project}/locations/{location}`

@param project [String] @param location [String]

@return [::String]

# File lib/google/cloud/kms/v1/key_management_service/paths.rb, line 122
def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

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