Module: Google::Cloud::AIPlatform::V1::VertexRagDataService::Paths

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

Overview

Path helper methods for the VertexRagDataService API.

Instance Method Summary collapse

Instance Method Details

#endpoint_path(project: , location: , endpoint: ) ⇒ ::String #endpoint_path(project: , location: , publisher: , model: ) ⇒ ::String

Create a fully-qualified Endpoint resource string.

Overloads:

  • #endpoint_path(project: , location: , endpoint: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/endpoints/{endpoint}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • endpoint (String) (defaults to: )
  • #endpoint_path(project: , location: , publisher: , model: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/publishers/{publisher}/models/{model}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • publisher (String) (defaults to: )
    • model (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 50

def endpoint_path **args
  resources = {
    "endpoint:location:project" => (proc do |project:, location:, 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}/endpoints/#{endpoint}"
    end),
    "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/"

      "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
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)


83
84
85
86
87
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 83

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

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

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

Create a fully-qualified Model resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


101
102
103
104
105
106
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 101

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

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

#rag_corpus_path(project:, location:, rag_corpus:) ⇒ ::String

Create a fully-qualified RagCorpus resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/ragCorpora/{rag_corpus}

Parameters:

  • project (String)
  • location (String)
  • rag_corpus (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


120
121
122
123
124
125
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 120

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

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

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

Create a fully-qualified RagEngineConfig resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/ragEngineConfig

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


138
139
140
141
142
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 138

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

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

#rag_file_path(project:, location:, rag_corpus:, rag_file:) ⇒ ::String

Create a fully-qualified RagFile resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}

Parameters:

  • project (String)
  • location (String)
  • rag_corpus (String)
  • rag_file (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


157
158
159
160
161
162
163
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 157

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

  "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}/ragFiles/#{rag_file}"
end

#secret_version_path(project:, secret:, secret_version:) ⇒ ::String

Create a fully-qualified SecretVersion resource string.

The resource will be in the following format:

projects/{project}/secrets/{secret}/versions/{secret_version}

Parameters:

  • project (String)
  • secret (String)
  • secret_version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


177
178
179
180
181
182
# File 'lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb', line 177

def secret_version_path project:, secret:, secret_version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/"

  "projects/#{project}/secrets/#{secret}/versions/#{secret_version}"
end