Module: Google::Cloud::Dataproc::V1::SessionController::Paths

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

Overview

Path helper methods for the SessionController API.

Instance Method Summary collapse

Instance Method Details

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


38
39
40
41
42
# File 'lib/google/cloud/dataproc/v1/session_controller/paths.rb', line 38

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

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


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

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

#session_path(project:, location:, session:) ⇒ ::String

Create a fully-qualified Session resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/sessions/{session}

Parameters:

  • project (String)
  • location (String)
  • session (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


75
76
77
78
79
80
# File 'lib/google/cloud/dataproc/v1/session_controller/paths.rb', line 75

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

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

#session_template_path(project:, location:, template:) ⇒ ::String

Create a fully-qualified SessionTemplate resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/sessionTemplates/{template}

Parameters:

  • project (String)
  • location (String)
  • template (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


94
95
96
97
98
99
# File 'lib/google/cloud/dataproc/v1/session_controller/paths.rb', line 94

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

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