Module: Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/bigquery/storage/v1/big_query_read/paths.rb

Overview

Path helper methods for the BigQueryRead API.

Instance Method Summary collapse

Instance Method Details

#project_path(project:) ⇒ ::String

Create a fully-qualified Project resource string.

The resource will be in the following format:

projects/{project}

Parameters:

  • project (String)

Returns:

  • (::String)


38
39
40
# File 'lib/google/cloud/bigquery/storage/v1/big_query_read/paths.rb', line 38

def project_path project:
  "projects/#{project}"
end

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

Create a fully-qualified ReadSession 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)


54
55
56
57
58
59
# File 'lib/google/cloud/bigquery/storage/v1/big_query_read/paths.rb', line 54

def read_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

#read_stream_path(project:, location:, session:, stream:) ⇒ ::String

Create a fully-qualified ReadStream resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


74
75
76
77
78
79
80
# File 'lib/google/cloud/bigquery/storage/v1/big_query_read/paths.rb', line 74

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

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

#table_path(project:, dataset:, table:) ⇒ ::String

Create a fully-qualified Table resource string.

The resource will be in the following format:

projects/{project}/datasets/{dataset}/tables/{table}

Parameters:

  • project (String)
  • dataset (String)
  • table (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


94
95
96
97
98
99
# File 'lib/google/cloud/bigquery/storage/v1/big_query_read/paths.rb', line 94

def table_path project:, dataset:, table:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"

  "projects/#{project}/datasets/#{dataset}/tables/#{table}"
end