google-cloud-discovery_engine-v1 0.a → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +431 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb +78 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +388 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +114 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +1155 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +770 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/paths.rb +135 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +956 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +935 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb +518 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1/document_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1/rest.rb +41 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +839 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +770 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb +127 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +679 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +935 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb +382 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +493 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +131 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +446 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/search_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +640 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +770 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +131 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +544 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +935 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +250 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1/version.rb +7 -2
- data/lib/google/cloud/discovery_engine/v1.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/common_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/document_pb.rb +48 -0
- data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +58 -0
- data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +79 -0
- data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +66 -0
- data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/schema_pb.rb +47 -0
- data/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb +61 -0
- data/lib/google/cloud/discoveryengine/v1/schema_service_services_pb.rb +53 -0
- data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +61 -0
- data/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +58 -0
- data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +53 -0
- data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +59 -0
- data/lib/google-cloud-discovery_engine-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/httpbody.rb +80 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/discoveryengine/v1/common.rb +89 -0
- data/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +98 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document.rb +105 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +180 -0
- data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +336 -0
- data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +84 -0
- data/proto_docs/google/cloud/discoveryengine/v1/schema.rb +45 -0
- data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +177 -0
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +294 -0
- data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +466 -0
- data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +64 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +144 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/date.rb +53 -0
- metadata +243 -12
@@ -0,0 +1,250 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "google/cloud/discoveryengine/v1/user_event_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module DiscoveryEngine
|
24
|
+
module V1
|
25
|
+
module UserEventService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the UserEventService service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: true,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the write_user_event REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::UserEvent]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def write_user_event request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_write_user_event_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Baseline implementation for the collect_user_event REST call
|
83
|
+
#
|
84
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest]
|
85
|
+
# A request object representing the call parameters. Required.
|
86
|
+
# @param options [::Gapic::CallOptions]
|
87
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
88
|
+
#
|
89
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
90
|
+
# @yieldparam result [::Google::Api::HttpBody]
|
91
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
92
|
+
#
|
93
|
+
# @return [::Google::Api::HttpBody]
|
94
|
+
# A result object deserialized from the server's reply
|
95
|
+
def collect_user_event request_pb, options = nil
|
96
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
97
|
+
|
98
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_collect_user_event_request request_pb
|
99
|
+
query_string_params = if query_string_params.any?
|
100
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
101
|
+
else
|
102
|
+
{}
|
103
|
+
end
|
104
|
+
|
105
|
+
response = @client_stub.make_http_request(
|
106
|
+
verb,
|
107
|
+
uri: uri,
|
108
|
+
body: body || "",
|
109
|
+
params: query_string_params,
|
110
|
+
options: options
|
111
|
+
)
|
112
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
113
|
+
result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true
|
114
|
+
|
115
|
+
yield result, operation if block_given?
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Baseline implementation for the import_user_events REST call
|
121
|
+
#
|
122
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest]
|
123
|
+
# A request object representing the call parameters. Required.
|
124
|
+
# @param options [::Gapic::CallOptions]
|
125
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
126
|
+
#
|
127
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
128
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
129
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
130
|
+
#
|
131
|
+
# @return [::Google::Longrunning::Operation]
|
132
|
+
# A result object deserialized from the server's reply
|
133
|
+
def import_user_events request_pb, options = nil
|
134
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
135
|
+
|
136
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_import_user_events_request request_pb
|
137
|
+
query_string_params = if query_string_params.any?
|
138
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
139
|
+
else
|
140
|
+
{}
|
141
|
+
end
|
142
|
+
|
143
|
+
response = @client_stub.make_http_request(
|
144
|
+
verb,
|
145
|
+
uri: uri,
|
146
|
+
body: body || "",
|
147
|
+
params: query_string_params,
|
148
|
+
options: options
|
149
|
+
)
|
150
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
151
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
152
|
+
|
153
|
+
yield result, operation if block_given?
|
154
|
+
result
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# @private
|
159
|
+
#
|
160
|
+
# GRPC transcoding helper method for the write_user_event REST call
|
161
|
+
#
|
162
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest]
|
163
|
+
# A request object representing the call parameters. Required.
|
164
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
165
|
+
# Uri, Body, Query string parameters
|
166
|
+
def self.transcode_write_user_event_request request_pb
|
167
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
168
|
+
.with_bindings(
|
169
|
+
uri_method: :post,
|
170
|
+
uri_template: "/v1/{parent}/userEvents:write",
|
171
|
+
body: "user_event",
|
172
|
+
matches: [
|
173
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
|
174
|
+
]
|
175
|
+
)
|
176
|
+
.with_bindings(
|
177
|
+
uri_method: :post,
|
178
|
+
uri_template: "/v1/{parent}/userEvents:write",
|
179
|
+
body: "user_event",
|
180
|
+
matches: [
|
181
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
|
182
|
+
]
|
183
|
+
)
|
184
|
+
transcoder.transcode request_pb
|
185
|
+
end
|
186
|
+
|
187
|
+
##
|
188
|
+
# @private
|
189
|
+
#
|
190
|
+
# GRPC transcoding helper method for the collect_user_event REST call
|
191
|
+
#
|
192
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest]
|
193
|
+
# A request object representing the call parameters. Required.
|
194
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
195
|
+
# Uri, Body, Query string parameters
|
196
|
+
def self.transcode_collect_user_event_request request_pb
|
197
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
198
|
+
.with_bindings(
|
199
|
+
uri_method: :get,
|
200
|
+
uri_template: "/v1/{parent}/userEvents:collect",
|
201
|
+
matches: [
|
202
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
|
203
|
+
]
|
204
|
+
)
|
205
|
+
.with_bindings(
|
206
|
+
uri_method: :get,
|
207
|
+
uri_template: "/v1/{parent}/userEvents:collect",
|
208
|
+
matches: [
|
209
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
|
210
|
+
]
|
211
|
+
)
|
212
|
+
transcoder.transcode request_pb
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# @private
|
217
|
+
#
|
218
|
+
# GRPC transcoding helper method for the import_user_events REST call
|
219
|
+
#
|
220
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest]
|
221
|
+
# A request object representing the call parameters. Required.
|
222
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
223
|
+
# Uri, Body, Query string parameters
|
224
|
+
def self.transcode_import_user_events_request request_pb
|
225
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
226
|
+
.with_bindings(
|
227
|
+
uri_method: :post,
|
228
|
+
uri_template: "/v1/{parent}/userEvents:import",
|
229
|
+
body: "*",
|
230
|
+
matches: [
|
231
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
|
232
|
+
]
|
233
|
+
)
|
234
|
+
.with_bindings(
|
235
|
+
uri_method: :post,
|
236
|
+
uri_template: "/v1/{parent}/userEvents:import",
|
237
|
+
body: "*",
|
238
|
+
matches: [
|
239
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
|
240
|
+
]
|
241
|
+
)
|
242
|
+
transcoder.transcode request_pb
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/discovery_engine/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/discovery_engine/v1/user_event_service/credentials"
|
26
|
+
require "google/cloud/discovery_engine/v1/user_event_service/paths"
|
27
|
+
require "google/cloud/discovery_engine/v1/user_event_service/rest/operations"
|
28
|
+
require "google/cloud/discovery_engine/v1/user_event_service/rest/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module DiscoveryEngine
|
33
|
+
module V1
|
34
|
+
##
|
35
|
+
# Service for ingesting end user actions on a website to Discovery Engine API.
|
36
|
+
#
|
37
|
+
# To load this service and instantiate a REST client:
|
38
|
+
#
|
39
|
+
# require "google/cloud/discovery_engine/v1/user_event_service/rest"
|
40
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new
|
41
|
+
#
|
42
|
+
module UserEventService
|
43
|
+
# Client for the REST transport
|
44
|
+
module Rest
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
53
|
+
require "google/cloud/discovery_engine/v1/user_event_service/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/discovery_engine/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/discovery_engine/v1/user_event_service/credentials"
|
26
|
+
require "google/cloud/discovery_engine/v1/user_event_service/paths"
|
27
|
+
require "google/cloud/discovery_engine/v1/user_event_service/operations"
|
28
|
+
require "google/cloud/discovery_engine/v1/user_event_service/client"
|
29
|
+
require "google/cloud/discovery_engine/v1/user_event_service/rest"
|
30
|
+
|
31
|
+
module Google
|
32
|
+
module Cloud
|
33
|
+
module DiscoveryEngine
|
34
|
+
module V1
|
35
|
+
##
|
36
|
+
# Service for ingesting end user actions on a website to Discovery Engine API.
|
37
|
+
#
|
38
|
+
# @example Load this service and instantiate a gRPC client
|
39
|
+
#
|
40
|
+
# require "google/cloud/discovery_engine/v1/user_event_service"
|
41
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new
|
42
|
+
#
|
43
|
+
# @example Load this service and instantiate a REST client
|
44
|
+
#
|
45
|
+
# require "google/cloud/discovery_engine/v1/user_event_service/rest"
|
46
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new
|
47
|
+
#
|
48
|
+
module UserEventService
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
helper_path = ::File.join __dir__, "user_event_service", "helpers.rb"
|
56
|
+
require "google/cloud/discovery_engine/v1/user_event_service/helpers" if ::File.file? helper_path
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2023 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
# you may not use this file except in compliance with the License.
|
5
7
|
# You may obtain a copy of the License at
|
6
8
|
#
|
7
|
-
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
10
|
#
|
9
11
|
# Unless required by applicable law or agreed to in writing, software
|
10
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -12,11 +14,14 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
15
20
|
module Google
|
16
21
|
module Cloud
|
17
22
|
module DiscoveryEngine
|
18
23
|
module V1
|
19
|
-
VERSION = "0.
|
24
|
+
VERSION = "0.1.0"
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "google/cloud/discovery_engine/v1/completion_service"
|
20
|
+
require "google/cloud/discovery_engine/v1/document_service"
|
21
|
+
require "google/cloud/discovery_engine/v1/schema_service"
|
22
|
+
require "google/cloud/discovery_engine/v1/search_service"
|
23
|
+
require "google/cloud/discovery_engine/v1/user_event_service"
|
24
|
+
require "google/cloud/discovery_engine/v1/version"
|
25
|
+
|
26
|
+
module Google
|
27
|
+
module Cloud
|
28
|
+
module DiscoveryEngine
|
29
|
+
##
|
30
|
+
# API client module.
|
31
|
+
#
|
32
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
33
|
+
#
|
34
|
+
# require "google/cloud/discovery_engine/v1"
|
35
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new
|
36
|
+
#
|
37
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
38
|
+
#
|
39
|
+
# require "google/cloud/discovery_engine/v1"
|
40
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new
|
41
|
+
#
|
42
|
+
module V1
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "v1", "_helpers.rb"
|
49
|
+
require "google/cloud/discovery_engine/v1/_helpers" if ::File.file? helper_path
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/discoveryengine/v1/common.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/resource_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n,google/cloud/discoveryengine/v1/common.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x19google/api/resource.proto\"0\n\x0f\x43ustomAttribute\x12\x0c\n\x04text\x18\x01 \x03(\t\x12\x0f\n\x07numbers\x18\x02 \x03(\x01\"/\n\x08UserInfo\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\nuser_agent\x18\x02 \x01(\tB\xbe\x07\n#com.google.cloud.discoveryengine.v1B\x0b\x43ommonProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1\xea\x41\xe6\x01\n%discoveryengine.googleapis.com/Branch\x12Qprojects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}\x12jprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\xea\x41\x89\x02\n,discoveryengine.googleapis.com/ServingConfig\x12_projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}\x12xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}b\x06proto3"
|
11
|
+
|
12
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
|
14
|
+
begin
|
15
|
+
pool.add_serialized_file(descriptor_data)
|
16
|
+
rescue TypeError => e
|
17
|
+
# Compatibility code: will be removed in the next major version.
|
18
|
+
require 'google/protobuf/descriptor_pb'
|
19
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
20
|
+
parsed.clear_dependency
|
21
|
+
serialized = parsed.class.encode(parsed)
|
22
|
+
file = pool.add_serialized_file(serialized)
|
23
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
24
|
+
imports = [
|
25
|
+
]
|
26
|
+
imports.each do |type_name, expected_filename|
|
27
|
+
import_file = pool.lookup(type_name).file_descriptor
|
28
|
+
if import_file.name != expected_filename
|
29
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
33
|
+
warn "This will become an error in the next major version."
|
34
|
+
end
|
35
|
+
|
36
|
+
module Google
|
37
|
+
module Cloud
|
38
|
+
module DiscoveryEngine
|
39
|
+
module V1
|
40
|
+
CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomAttribute").msgclass
|
41
|
+
UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserInfo").msgclass
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/discoveryengine/v1/completion_service.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
require 'google/api/client_pb'
|
9
|
+
require 'google/api/field_behavior_pb'
|
10
|
+
require 'google/api/resource_pb'
|
11
|
+
|
12
|
+
|
13
|
+
descriptor_data = "\n8google/cloud/discoveryengine/v1/completion_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9d\x01\n\x14\x43ompleteQueryRequest\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0bquery_model\x18\x03 \x01(\t\x12\x16\n\x0euser_pseudo_id\x18\x04 \x01(\t\"\xa1\x01\n\x15\x43ompleteQueryResponse\x12\x61\n\x11query_suggestions\x18\x01 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion\x1a%\n\x0fQuerySuggestion\x12\x12\n\nsuggestion\x18\x01 \x01(\t2\x8a\x03\n\x11\x43ompletionService\x12\xa0\x02\n\rCompleteQuery\x12\x35.google.cloud.discoveryengine.v1.CompleteQueryRequest\x1a\x36.google.cloud.discoveryengine.v1.CompleteQueryResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12\x42/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQueryZR\x12P/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43ompletionServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3"
|
14
|
+
|
15
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
16
|
+
|
17
|
+
begin
|
18
|
+
pool.add_serialized_file(descriptor_data)
|
19
|
+
rescue TypeError => e
|
20
|
+
# Compatibility code: will be removed in the next major version.
|
21
|
+
require 'google/protobuf/descriptor_pb'
|
22
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
23
|
+
parsed.clear_dependency
|
24
|
+
serialized = parsed.class.encode(parsed)
|
25
|
+
file = pool.add_serialized_file(serialized)
|
26
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
27
|
+
imports = [
|
28
|
+
]
|
29
|
+
imports.each do |type_name, expected_filename|
|
30
|
+
import_file = pool.lookup(type_name).file_descriptor
|
31
|
+
if import_file.name != expected_filename
|
32
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
36
|
+
warn "This will become an error in the next major version."
|
37
|
+
end
|
38
|
+
|
39
|
+
module Google
|
40
|
+
module Cloud
|
41
|
+
module DiscoveryEngine
|
42
|
+
module V1
|
43
|
+
CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryRequest").msgclass
|
44
|
+
CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryResponse").msgclass
|
45
|
+
CompleteQueryResponse::QuerySuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion").msgclass
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/discoveryengine/v1/completion_service.proto for package 'Google.Cloud.DiscoveryEngine.V1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2022 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/discoveryengine/v1/completion_service_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module DiscoveryEngine
|
25
|
+
module V1
|
26
|
+
module CompletionService
|
27
|
+
# Service for Auto-Completion.
|
28
|
+
class Service
|
29
|
+
|
30
|
+
include ::GRPC::GenericService
|
31
|
+
|
32
|
+
self.marshal_class_method = :encode
|
33
|
+
self.unmarshal_class_method = :decode
|
34
|
+
self.service_name = 'google.cloud.discoveryengine.v1.CompletionService'
|
35
|
+
|
36
|
+
# Completes the specified user input with keyword suggestions.
|
37
|
+
rpc :CompleteQuery, ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse
|
38
|
+
end
|
39
|
+
|
40
|
+
Stub = Service.rpc_stub_class
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/discoveryengine/v1/document.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/field_behavior_pb'
|
8
|
+
require 'google/api/resource_pb'
|
9
|
+
require 'google/protobuf/struct_pb'
|
10
|
+
|
11
|
+
|
12
|
+
descriptor_data = "\n.google/cloud/discoveryengine/v1/document.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x8f\x05\n\x08\x44ocument\x12.\n\x0bstruct_data\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x13\n\tjson_data\x18\x05 \x01(\tH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\tschema_id\x18\x03 \x01(\t\x12\x42\n\x07\x63ontent\x18\n \x01(\x0b\x32\x31.google.cloud.discoveryengine.v1.Document.Content\x12\x1a\n\x12parent_document_id\x18\x07 \x01(\t\x12\x39\n\x13\x64\x65rived_struct_data\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x1aK\n\x07\x43ontent\x12\x13\n\traw_bytes\x18\x02 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x03 \x01(\tH\x00\x12\x11\n\tmime_type\x18\x01 \x01(\tB\t\n\x07\x63ontent:\x96\x02\xea\x41\x92\x02\n\'discoveryengine.googleapis.com/Document\x12\x66projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}\x12\x7fprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}B\x06\n\x04\x64\x61taB\x80\x02\n#com.google.cloud.discoveryengine.v1B\rDocumentProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3"
|
13
|
+
|
14
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
15
|
+
|
16
|
+
begin
|
17
|
+
pool.add_serialized_file(descriptor_data)
|
18
|
+
rescue TypeError => e
|
19
|
+
# Compatibility code: will be removed in the next major version.
|
20
|
+
require 'google/protobuf/descriptor_pb'
|
21
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
22
|
+
parsed.clear_dependency
|
23
|
+
serialized = parsed.class.encode(parsed)
|
24
|
+
file = pool.add_serialized_file(serialized)
|
25
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
26
|
+
imports = [
|
27
|
+
["google.protobuf.Struct", "google/protobuf/struct.proto"],
|
28
|
+
]
|
29
|
+
imports.each do |type_name, expected_filename|
|
30
|
+
import_file = pool.lookup(type_name).file_descriptor
|
31
|
+
if import_file.name != expected_filename
|
32
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
36
|
+
warn "This will become an error in the next major version."
|
37
|
+
end
|
38
|
+
|
39
|
+
module Google
|
40
|
+
module Cloud
|
41
|
+
module DiscoveryEngine
|
42
|
+
module V1
|
43
|
+
Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document").msgclass
|
44
|
+
Document::Content = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.Content").msgclass
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|