google-cloud-discovery_engine-v1beta 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +219 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +205 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +10 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +10 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +824 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb +318 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +770 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +1106 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +306 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/rest.rb +3 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +1035 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/paths.rb +73 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +967 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +1106 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +426 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +911 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/paths.rb +69 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +850 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +366 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +60 -5
- data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +68 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +60 -5
- data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +139 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +132 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +75 -0
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta.rb +3 -0
- data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/chunk_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
- data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_pb.rb +56 -0
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_services_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +12 -1
- data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_services_pb.rb +63 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_pb.rb +47 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_services_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +20 -1
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +5 -0
- data/proto_docs/google/api/client.rb +14 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/chunk.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +38 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +16 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +25 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +10 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +43 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation.rb +223 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation_service.rb +194 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +199 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query.rb +82 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_service.rb +179 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set.rb +57 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set_service.rb +186 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +401 -8
- data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +11 -5
- metadata +44 -2
@@ -0,0 +1,318 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module DiscoveryEngine
|
23
|
+
module V1beta
|
24
|
+
module EvaluationService
|
25
|
+
# Path helper methods for the EvaluationService API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Branch resource string.
|
29
|
+
#
|
30
|
+
# @overload branch_path(project:, location:, data_store:, branch:)
|
31
|
+
# The resource will be in the following format:
|
32
|
+
#
|
33
|
+
# `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`
|
34
|
+
#
|
35
|
+
# @param project [String]
|
36
|
+
# @param location [String]
|
37
|
+
# @param data_store [String]
|
38
|
+
# @param branch [String]
|
39
|
+
#
|
40
|
+
# @overload branch_path(project:, location:, collection:, data_store:, branch:)
|
41
|
+
# The resource will be in the following format:
|
42
|
+
#
|
43
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`
|
44
|
+
#
|
45
|
+
# @param project [String]
|
46
|
+
# @param location [String]
|
47
|
+
# @param collection [String]
|
48
|
+
# @param data_store [String]
|
49
|
+
# @param branch [String]
|
50
|
+
#
|
51
|
+
# @return [::String]
|
52
|
+
def branch_path **args
|
53
|
+
resources = {
|
54
|
+
"branch:data_store:location:project" => (proc do |project:, location:, data_store:, branch:|
|
55
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
56
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
57
|
+
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
|
58
|
+
|
59
|
+
"projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}"
|
60
|
+
end),
|
61
|
+
"branch:collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, branch:|
|
62
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
63
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
64
|
+
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
|
65
|
+
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
|
66
|
+
|
67
|
+
"projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}"
|
68
|
+
end)
|
69
|
+
}
|
70
|
+
|
71
|
+
resource = resources[args.keys.sort.join(":")]
|
72
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
73
|
+
resource.call(**args)
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Create a fully-qualified DataStore resource string.
|
78
|
+
#
|
79
|
+
# @overload data_store_path(project:, location:, data_store:)
|
80
|
+
# The resource will be in the following format:
|
81
|
+
#
|
82
|
+
# `projects/{project}/locations/{location}/dataStores/{data_store}`
|
83
|
+
#
|
84
|
+
# @param project [String]
|
85
|
+
# @param location [String]
|
86
|
+
# @param data_store [String]
|
87
|
+
#
|
88
|
+
# @overload data_store_path(project:, location:, collection:, data_store:)
|
89
|
+
# The resource will be in the following format:
|
90
|
+
#
|
91
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
|
92
|
+
#
|
93
|
+
# @param project [String]
|
94
|
+
# @param location [String]
|
95
|
+
# @param collection [String]
|
96
|
+
# @param data_store [String]
|
97
|
+
#
|
98
|
+
# @return [::String]
|
99
|
+
def data_store_path **args
|
100
|
+
resources = {
|
101
|
+
"data_store:location:project" => (proc do |project:, location:, data_store:|
|
102
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
103
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
104
|
+
|
105
|
+
"projects/#{project}/locations/#{location}/dataStores/#{data_store}"
|
106
|
+
end),
|
107
|
+
"collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:|
|
108
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
109
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
110
|
+
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
|
111
|
+
|
112
|
+
"projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}"
|
113
|
+
end)
|
114
|
+
}
|
115
|
+
|
116
|
+
resource = resources[args.keys.sort.join(":")]
|
117
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
118
|
+
resource.call(**args)
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Create a fully-qualified Evaluation resource string.
|
123
|
+
#
|
124
|
+
# The resource will be in the following format:
|
125
|
+
#
|
126
|
+
# `projects/{project}/locations/{location}/evaluations/{evaluation}`
|
127
|
+
#
|
128
|
+
# @param project [String]
|
129
|
+
# @param location [String]
|
130
|
+
# @param evaluation [String]
|
131
|
+
#
|
132
|
+
# @return [::String]
|
133
|
+
def evaluation_path project:, location:, evaluation:
|
134
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
135
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
136
|
+
|
137
|
+
"projects/#{project}/locations/#{location}/evaluations/#{evaluation}"
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Create a fully-qualified Location resource string.
|
142
|
+
#
|
143
|
+
# The resource will be in the following format:
|
144
|
+
#
|
145
|
+
# `projects/{project}/locations/{location}`
|
146
|
+
#
|
147
|
+
# @param project [String]
|
148
|
+
# @param location [String]
|
149
|
+
#
|
150
|
+
# @return [::String]
|
151
|
+
def location_path project:, location:
|
152
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
153
|
+
|
154
|
+
"projects/#{project}/locations/#{location}"
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Create a fully-qualified SampleQuerySet resource string.
|
159
|
+
#
|
160
|
+
# The resource will be in the following format:
|
161
|
+
#
|
162
|
+
# `projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}`
|
163
|
+
#
|
164
|
+
# @param project [String]
|
165
|
+
# @param location [String]
|
166
|
+
# @param sample_query_set [String]
|
167
|
+
#
|
168
|
+
# @return [::String]
|
169
|
+
def sample_query_set_path project:, location:, sample_query_set:
|
170
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
171
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
172
|
+
|
173
|
+
"projects/#{project}/locations/#{location}/sampleQuerySets/#{sample_query_set}"
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# Create a fully-qualified ServingConfig resource string.
|
178
|
+
#
|
179
|
+
# @overload serving_config_path(project:, location:, data_store:, serving_config:)
|
180
|
+
# The resource will be in the following format:
|
181
|
+
#
|
182
|
+
# `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}`
|
183
|
+
#
|
184
|
+
# @param project [String]
|
185
|
+
# @param location [String]
|
186
|
+
# @param data_store [String]
|
187
|
+
# @param serving_config [String]
|
188
|
+
#
|
189
|
+
# @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:)
|
190
|
+
# The resource will be in the following format:
|
191
|
+
#
|
192
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}`
|
193
|
+
#
|
194
|
+
# @param project [String]
|
195
|
+
# @param location [String]
|
196
|
+
# @param collection [String]
|
197
|
+
# @param data_store [String]
|
198
|
+
# @param serving_config [String]
|
199
|
+
#
|
200
|
+
# @overload serving_config_path(project:, location:, collection:, engine:, serving_config:)
|
201
|
+
# The resource will be in the following format:
|
202
|
+
#
|
203
|
+
# `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}`
|
204
|
+
#
|
205
|
+
# @param project [String]
|
206
|
+
# @param location [String]
|
207
|
+
# @param collection [String]
|
208
|
+
# @param engine [String]
|
209
|
+
# @param serving_config [String]
|
210
|
+
#
|
211
|
+
# @return [::String]
|
212
|
+
def serving_config_path **args
|
213
|
+
resources = {
|
214
|
+
"data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:|
|
215
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
216
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
217
|
+
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
|
218
|
+
|
219
|
+
"projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}"
|
220
|
+
end),
|
221
|
+
"collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:|
|
222
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
223
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
224
|
+
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
|
225
|
+
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
|
226
|
+
|
227
|
+
"projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}"
|
228
|
+
end),
|
229
|
+
"collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:|
|
230
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
231
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
232
|
+
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
|
233
|
+
raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/"
|
234
|
+
|
235
|
+
"projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}"
|
236
|
+
end)
|
237
|
+
}
|
238
|
+
|
239
|
+
resource = resources[args.keys.sort.join(":")]
|
240
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
241
|
+
resource.call(**args)
|
242
|
+
end
|
243
|
+
|
244
|
+
##
|
245
|
+
# Create a fully-qualified Session resource string.
|
246
|
+
#
|
247
|
+
# @overload session_path(project:, location:, data_store:, session:)
|
248
|
+
# The resource will be in the following format:
|
249
|
+
#
|
250
|
+
# `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}`
|
251
|
+
#
|
252
|
+
# @param project [String]
|
253
|
+
# @param location [String]
|
254
|
+
# @param data_store [String]
|
255
|
+
# @param session [String]
|
256
|
+
#
|
257
|
+
# @overload session_path(project:, location:, collection:, data_store:, session:)
|
258
|
+
# The resource will be in the following format:
|
259
|
+
#
|
260
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}`
|
261
|
+
#
|
262
|
+
# @param project [String]
|
263
|
+
# @param location [String]
|
264
|
+
# @param collection [String]
|
265
|
+
# @param data_store [String]
|
266
|
+
# @param session [String]
|
267
|
+
#
|
268
|
+
# @overload session_path(project:, location:, collection:, engine:, session:)
|
269
|
+
# The resource will be in the following format:
|
270
|
+
#
|
271
|
+
# `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
|
272
|
+
#
|
273
|
+
# @param project [String]
|
274
|
+
# @param location [String]
|
275
|
+
# @param collection [String]
|
276
|
+
# @param engine [String]
|
277
|
+
# @param session [String]
|
278
|
+
#
|
279
|
+
# @return [::String]
|
280
|
+
def session_path **args
|
281
|
+
resources = {
|
282
|
+
"data_store:location:project:session" => (proc do |project:, location:, data_store:, session:|
|
283
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
284
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
285
|
+
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
|
286
|
+
|
287
|
+
"projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}"
|
288
|
+
end),
|
289
|
+
"collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:|
|
290
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
291
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
292
|
+
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
|
293
|
+
raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
|
294
|
+
|
295
|
+
"projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}"
|
296
|
+
end),
|
297
|
+
"collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:|
|
298
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
299
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
300
|
+
raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
|
301
|
+
raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/"
|
302
|
+
|
303
|
+
"projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}"
|
304
|
+
end)
|
305
|
+
}
|
306
|
+
|
307
|
+
resource = resources[args.keys.sort.join(":")]
|
308
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
309
|
+
resource.call(**args)
|
310
|
+
end
|
311
|
+
|
312
|
+
extend self
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|