Module: Google::Cloud::VectorSearch::V1::DataObjectService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/vector_search/v1/data_object_service/paths.rb

Overview

Path helper methods for the DataObjectService API.

Instance Method Summary collapse

Instance Method Details

#collection_path(project:, location:, collection:) ⇒ ::String

Create a fully-qualified Collection resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/collections/{collection}

Parameters:

  • project (String)
  • location (String)
  • collection (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/vector_search/v1/data_object_service/paths.rb', line 39

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

  "projects/#{project}/locations/#{location}/collections/#{collection}"
end

#data_object_path(project:, location:, collection:, data_object:) ⇒ ::String

Create a fully-qualified DataObject resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/collections/{collection}/dataObjects/{data_object}

Parameters:

  • project (String)
  • location (String)
  • collection (String)
  • data_object (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
64
65
# File 'lib/google/cloud/vector_search/v1/data_object_service/paths.rb', line 59

def data_object_path project:, location:, collection:, data_object:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"

  "projects/#{project}/locations/#{location}/collections/#{collection}/dataObjects/#{data_object}"
end