google-cloud-discovery_engine-v1beta 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/v1beta/completion_service/client.rb +429 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +78 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +386 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +114 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +1107 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +768 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +135 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +908 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +905 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +518 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service.rb +58 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +486 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +135 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +443 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/rest.rb +42 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +840 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +768 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/paths.rb +127 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +680 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +905 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +382 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +513 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +131 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +465 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +638 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +768 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +131 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +542 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +905 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +250 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +7 -2
- data/lib/google/cloud/discovery_engine/v1beta.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +41 -0
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +38 -0
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +43 -0
- data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +58 -0
- data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +81 -0
- data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +109 -0
- data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +40 -0
- data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1beta/schema_pb.rb +30 -0
- data/lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb +72 -0
- data/lib/google/cloud/discoveryengine/v1beta/schema_service_services_pb.rb +53 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +151 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +93 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +39 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +59 -0
- data/lib/google-cloud-discovery_engine-v1beta.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/v1beta/common.rb +107 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +98 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +107 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +181 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +286 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +84 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +210 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/schema.rb +45 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +180 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +605 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +473 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +64 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -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 +129 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/date.rb +53 -0
- metadata +254 -12
@@ -0,0 +1,116 @@
|
|
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/v1beta/search_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module DiscoveryEngine
|
24
|
+
module V1beta
|
25
|
+
module SearchService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the SearchService 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 search REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest]
|
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::V1beta::SearchResponse]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def search 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_search_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::V1beta::SearchResponse.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# @private
|
83
|
+
#
|
84
|
+
# GRPC transcoding helper method for the search REST call
|
85
|
+
#
|
86
|
+
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest]
|
87
|
+
# A request object representing the call parameters. Required.
|
88
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
89
|
+
# Uri, Body, Query string parameters
|
90
|
+
def self.transcode_search_request request_pb
|
91
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
92
|
+
.with_bindings(
|
93
|
+
uri_method: :post,
|
94
|
+
uri_template: "/v1beta/{serving_config}:search",
|
95
|
+
body: "*",
|
96
|
+
matches: [
|
97
|
+
["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false]
|
98
|
+
]
|
99
|
+
)
|
100
|
+
.with_bindings(
|
101
|
+
uri_method: :post,
|
102
|
+
uri_template: "/v1beta/{serving_config}:search",
|
103
|
+
body: "*",
|
104
|
+
matches: [
|
105
|
+
["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false]
|
106
|
+
]
|
107
|
+
)
|
108
|
+
transcoder.transcode request_pb
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,52 @@
|
|
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/v1beta/version"
|
24
|
+
|
25
|
+
require "google/cloud/discovery_engine/v1beta/search_service/credentials"
|
26
|
+
require "google/cloud/discovery_engine/v1beta/search_service/paths"
|
27
|
+
require "google/cloud/discovery_engine/v1beta/search_service/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module DiscoveryEngine
|
32
|
+
module V1beta
|
33
|
+
##
|
34
|
+
# Service for search.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a REST client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/discovery_engine/v1beta/search_service/rest"
|
39
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::Client.new
|
40
|
+
#
|
41
|
+
module SearchService
|
42
|
+
# Client for the REST transport
|
43
|
+
module Rest
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
52
|
+
require "google/cloud/discovery_engine/v1beta/search_service/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,55 @@
|
|
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/v1beta/version"
|
24
|
+
|
25
|
+
require "google/cloud/discovery_engine/v1beta/search_service/credentials"
|
26
|
+
require "google/cloud/discovery_engine/v1beta/search_service/paths"
|
27
|
+
require "google/cloud/discovery_engine/v1beta/search_service/client"
|
28
|
+
require "google/cloud/discovery_engine/v1beta/search_service/rest"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module DiscoveryEngine
|
33
|
+
module V1beta
|
34
|
+
##
|
35
|
+
# Service for search.
|
36
|
+
#
|
37
|
+
# @example Load this service and instantiate a gRPC client
|
38
|
+
#
|
39
|
+
# require "google/cloud/discovery_engine/v1beta/search_service"
|
40
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client.new
|
41
|
+
#
|
42
|
+
# @example Load this service and instantiate a REST client
|
43
|
+
#
|
44
|
+
# require "google/cloud/discovery_engine/v1beta/search_service/rest"
|
45
|
+
# client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::Client.new
|
46
|
+
#
|
47
|
+
module SearchService
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
helper_path = ::File.join __dir__, "search_service", "helpers.rb"
|
55
|
+
require "google/cloud/discovery_engine/v1beta/search_service/helpers" if ::File.file? helper_path
|