Module: Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb

Overview

Path helper methods for the PredictionService API.

Instance Method Summary collapse

Instance Method Details

#placement_path(project:, location:, catalog:, event_store:, placement:) ⇒ ::String

Create a fully-qualified Placement resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}

Parameters:

  • project (String)
  • location (String)
  • catalog (String)
  • event_store (String)
  • placement (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


41
42
43
44
45
46
47
48
# File 'lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb', line 41

def placement_path project:, location:, catalog:, event_store:, placement:
  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? "/"
  raise ::ArgumentError, "event_store cannot contain /" if event_store.to_s.include? "/"

  "projects/#{project}/locations/#{location}/catalogs/#{catalog}/eventStores/#{event_store}/placements/#{placement}"
end