Module: Google::Cloud::Retail::V2::ModelService::Paths

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

Overview

Path helper methods for the ModelService API.

Instance Method Summary collapse

Instance Method Details

#catalog_path(project:, location:, catalog:) ⇒ ::String

Create a fully-qualified Catalog resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/catalogs/{catalog}

Parameters:

  • project (String)
  • location (String)
  • catalog (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/retail/v2/model_service/paths.rb', line 39

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

  "projects/#{project}/locations/#{location}/catalogs/#{catalog}"
end

#model_path(project:, location:, catalog:, model:) ⇒ ::String

Create a fully-qualified Model resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}

Parameters:

  • project (String)
  • location (String)
  • catalog (String)
  • model (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
64
65
# File 'lib/google/cloud/retail/v2/model_service/paths.rb', line 59

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

  "projects/#{project}/locations/#{location}/catalogs/#{catalog}/models/#{model}"
end