Module: Google::Cloud::AIPlatform::V1::IndexService::Paths

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

Overview

Path helper methods for the IndexService API.

Instance Method Summary collapse

Instance Method Details

#index_endpoint_path(project:, location:, index_endpoint:) ⇒ ::String

Create a fully-qualified IndexEndpoint resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}

Parameters:

  • project (String)
  • location (String)
  • index_endpoint (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


58
59
60
61
62
63
# File 'lib/google/cloud/ai_platform/v1/index_service/paths.rb', line 58

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

  "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}"
end

#index_path(project:, location:, index:) ⇒ ::String

Create a fully-qualified Index resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/indexes/{index}

Parameters:

  • project (String)
  • location (String)
  • index (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

  "projects/#{project}/locations/#{location}/indexes/#{index}"
end

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


76
77
78
79
80
# File 'lib/google/cloud/ai_platform/v1/index_service/paths.rb', line 76

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

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