Module: Google::Cloud::Bigtable::V2::Bigtable::Paths

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

Overview

Path helper methods for the Bigtable API.

Instance Method Summary collapse

Instance Method Details

#authorized_view_path(project:, instance:, table:, authorized_view:) ⇒ ::String

Create a fully-qualified AuthorizedView resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}

Parameters:

  • project (String)
  • instance (String)
  • table (String)
  • authorized_view (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def authorized_view_path project:, instance:, table:, authorized_view:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/"
  raise ::ArgumentError, "table cannot contain /" if table.to_s.include? "/"

  "projects/#{project}/instances/#{instance}/tables/#{table}/authorizedViews/#{authorized_view}"
end

#instance_path(project:, instance:) ⇒ ::String

Create a fully-qualified Instance resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}

Parameters:

  • project (String)
  • instance (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
# File 'lib/google/cloud/bigtable/v2/bigtable/paths.rb', line 59

def instance_path project:, instance:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/instances/#{instance}"
end

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

Create a fully-qualified Table resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/tables/{table}

Parameters:

  • project (String)
  • instance (String)
  • table (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


77
78
79
80
81
82
# File 'lib/google/cloud/bigtable/v2/bigtable/paths.rb', line 77

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

  "projects/#{project}/instances/#{instance}/tables/#{table}"
end