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
-
#endpoint_path(**args) ⇒ ::String
Create a fully-qualified Endpoint resource string.
-
#location_path(project:, location:) ⇒ ::String
Create a fully-qualified Location resource string.
-
#model_path(project:, location:, model:) ⇒ ::String
Create a fully-qualified Model resource string.
-
#rag_corpus_path(project:, location:, rag_corpus:) ⇒ ::String
Create a fully-qualified RagCorpus resource string.
-
#rag_engine_config_path(project:, location:) ⇒ ::String
Create a fully-qualified RagEngineConfig resource string.
-
#rag_file_path(project:, location:, rag_corpus:, rag_file:) ⇒ ::String
Create a fully-qualified RagFile resource string.
-
#secret_version_path(project:, secret:, secret_version:) ⇒ ::String
Create a fully-qualified SecretVersion resource string.
Instance Method Details
#endpoint_path(project: , location: , endpoint: ) ⇒ ::String #endpoint_path(project: , location: , publisher: , model: ) ⇒ ::String
Create a fully-qualified Endpoint resource string.
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}
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}
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}
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
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}
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}
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 |