Module: Google::Cloud::Functions::V1::CloudFunctionsService::Paths

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

Overview

Path helper methods for the CloudFunctionsService API.

Instance Method Summary collapse

Instance Method Details

#cloud_function_path(project:, location:, function:) ⇒ ::String

Create a fully-qualified CloudFunction resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/functions/{function}

Parameters:

  • project (String)
  • location (String)
  • function (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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

#crypto_key_path(project:, location:, key_ring:, crypto_key:) ⇒ ::String

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}

Parameters:

  • project (String)
  • location (String)
  • key_ring (String)
  • crypto_key (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
64
65
# File 'lib/google/cloud/functions/v1/cloud_functions_service/paths.rb', line 59

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

#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)


78
79
80
81
82
# File 'lib/google/cloud/functions/v1/cloud_functions_service/paths.rb', line 78

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

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

#repository_path(project:, location:, repository:) ⇒ ::String

Create a fully-qualified Repository resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}

Parameters:

  • project (String)
  • location (String)
  • repository (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


96
97
98
99
100
101
# File 'lib/google/cloud/functions/v1/cloud_functions_service/paths.rb', line 96

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

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