Module: Google::Cloud::PubSub::V1::SchemaService::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/pubsub/v1/schema_service/paths.rb

Overview

Path helper methods for the SchemaService 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)


37
38
39
# File 'lib/google/cloud/pubsub/v1/schema_service/paths.rb', line 37

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

#schema_path(project:, schema:) ⇒ ::String

Create a fully-qualified Schema resource string.

The resource will be in the following format:

projects/{project}/schemas/{schema}

Parameters:

  • project (String)
  • schema (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


52
53
54
55
56
# File 'lib/google/cloud/pubsub/v1/schema_service/paths.rb', line 52

def schema_path project:, schema:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/schemas/#{schema}"
end