Module: Google::Cloud::Run::V2::Revisions::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/run/v2/revisions/paths.rb

Overview

Path helper methods for the Revisions API.

Instance Method Summary collapse

Instance Method Details

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

Create a fully-qualified Revision resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/services/{service}/revisions/{revision}

Parameters:

  • project (String)
  • location (String)
  • service (String)
  • revision (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/run/v2/revisions/paths.rb', line 40

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

  "projects/#{project}/locations/#{location}/services/#{service}/revisions/#{revision}"
end

#service_path(project:, location:, service:) ⇒ ::String

Create a fully-qualified Service resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/services/{service}

Parameters:

  • project (String)
  • location (String)
  • service (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


60
61
62
63
64
65
# File 'lib/google/cloud/run/v2/revisions/paths.rb', line 60

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

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