google-cloud-discovery_engine-v1beta 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +235 -4
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +801 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +221 -4
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +1077 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest.rb +1 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service.rb +1 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +20 -3
  10. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +91 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +20 -3
  12. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +45 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +925 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/credentials.rb +47 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +801 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/paths.rb +97 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +864 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +1077 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/service_stub.rb +403 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest.rb +54 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/data_store_service.rb +57 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +887 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/engine_service/credentials.rb +47 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +801 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb +73 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +826 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +1077 -0
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +366 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest.rb +54 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/engine_service.rb +57 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +22 -3
  33. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +19 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +22 -3
  35. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +8 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +4 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +48 -10
  39. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +19 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +48 -10
  41. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +8 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +646 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/credentials.rb +47 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/paths.rb +146 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +599 -0
  46. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/service_stub.rb +291 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest.rb +52 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service.rb +55 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +1635 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/credentials.rb +47 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +801 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/paths.rb +127 -0
  53. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +1525 -0
  54. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +1077 -0
  55. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +860 -0
  56. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest.rb +53 -0
  57. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service.rb +56 -0
  58. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
  59. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  60. data/lib/google/cloud/discovery_engine/v1beta.rb +4 -0
  61. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +6 -1
  62. data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +45 -0
  63. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +4 -1
  64. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
  65. data/lib/google/cloud/discoveryengine/v1beta/conversation_pb.rb +1 -1
  66. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  67. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +49 -0
  68. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +62 -0
  69. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_services_pb.rb +61 -0
  70. data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +1 -1
  71. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +1 -1
  72. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +53 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +62 -0
  74. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +55 -0
  75. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +7 -1
  76. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +6 -1
  77. data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb +1 -1
  78. data/lib/google/cloud/discoveryengine/v1beta/schema_pb.rb +1 -1
  79. data/lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb +1 -1
  80. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +8 -1
  81. data/lib/google/cloud/discoveryengine/v1beta/serving_config_pb.rb +53 -0
  82. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_pb.rb +54 -0
  83. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_services_pb.rb +53 -0
  84. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +54 -0
  85. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_pb.rb +82 -0
  86. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb.rb +74 -0
  87. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  88. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +1 -1
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +60 -0
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +53 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +10 -4
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +2 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +19 -1
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +88 -0
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +216 -0
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +219 -0
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +179 -0
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +66 -0
  100. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +41 -0
  101. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +22 -3
  102. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +166 -15
  103. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +247 -0
  104. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +85 -0
  105. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +160 -0
  106. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine_service.rb +528 -0
  107. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +4 -3
  108. metadata +60 -2
@@ -0,0 +1,1635 @@
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
+ require "google/cloud/errors"
20
+ require "google/cloud/discoveryengine/v1beta/site_search_engine_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module SiteSearchEngineService
28
+ ##
29
+ # Client for the SiteSearchEngineService service.
30
+ #
31
+ # Service for managing site search related resources.
32
+ #
33
+ class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
+
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :site_search_engine_service_stub
41
+
42
+ ##
43
+ # Configure the SiteSearchEngineService Client class.
44
+ #
45
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all SiteSearchEngineService clients
51
+ # ::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the SiteSearchEngineService Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # The effective universe domain
99
+ #
100
+ # @return [String]
101
+ #
102
+ def universe_domain
103
+ @site_search_engine_service_stub.universe_domain
104
+ end
105
+
106
+ ##
107
+ # Create a new SiteSearchEngineService client object.
108
+ #
109
+ # @example
110
+ #
111
+ # # Create a client using the default configuration
112
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
113
+ #
114
+ # # Create a client using a custom configuration
115
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new do |config|
116
+ # config.timeout = 10.0
117
+ # end
118
+ #
119
+ # @yield [config] Configure the SiteSearchEngineService client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ def initialize
123
+ # These require statements are intentionally placed here to initialize
124
+ # the gRPC module only when it's required.
125
+ # See https://github.com/googleapis/toolkit/issues/446
126
+ require "gapic/grpc"
127
+ require "google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb"
128
+
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @operations_client = Operations.new do |config|
151
+ config.credentials = credentials
152
+ config.quota_project = @quota_project_id
153
+ config.endpoint = @config.endpoint
154
+ config.universe_domain = @config.universe_domain
155
+ end
156
+
157
+ @site_search_engine_service_stub = ::Gapic::ServiceStub.new(
158
+ ::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Stub,
159
+ credentials: credentials,
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ channel_args: @config.channel_args,
164
+ interceptors: @config.interceptors,
165
+ channel_pool_config: @config.channel_pool
166
+ )
167
+
168
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
169
+ config.credentials = credentials
170
+ config.quota_project = @quota_project_id
171
+ config.endpoint = @site_search_engine_service_stub.endpoint
172
+ config.universe_domain = @site_search_engine_service_stub.universe_domain
173
+ end
174
+ end
175
+
176
+ ##
177
+ # Get the associated client for long-running operations.
178
+ #
179
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Operations]
180
+ #
181
+ attr_reader :operations_client
182
+
183
+ ##
184
+ # Get the associated client for mix-in of the Locations.
185
+ #
186
+ # @return [Google::Cloud::Location::Locations::Client]
187
+ #
188
+ attr_reader :location_client
189
+
190
+ # Service calls
191
+
192
+ ##
193
+ # Gets the
194
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine SiteSearchEngine}.
195
+ #
196
+ # @overload get_site_search_engine(request, options = nil)
197
+ # Pass arguments to `get_site_search_engine` via a request object, either of type
198
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetSiteSearchEngineRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetSiteSearchEngineRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
205
+ #
206
+ # @overload get_site_search_engine(name: nil)
207
+ # Pass arguments to `get_site_search_engine` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param name [::String]
212
+ # Required. Resource name of
213
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine SiteSearchEngine},
214
+ # such as
215
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`.
216
+ #
217
+ # If the caller does not have permission to access the [SiteSearchEngine],
218
+ # regardless of whether or not it exists, a PERMISSION_DENIED error is
219
+ # returned.
220
+ #
221
+ # @yield [response, operation] Access the result along with the RPC operation
222
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine]
223
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
224
+ #
225
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/discovery_engine/v1beta"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::DiscoveryEngine::V1beta::GetSiteSearchEngineRequest.new
237
+ #
238
+ # # Call the get_site_search_engine method.
239
+ # result = client.get_site_search_engine request
240
+ #
241
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine.
242
+ # p result
243
+ #
244
+ def get_site_search_engine request, options = nil
245
+ raise ::ArgumentError, "request must be provided" if request.nil?
246
+
247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetSiteSearchEngineRequest
248
+
249
+ # Converts hash and nil to an options object
250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
251
+
252
+ # Customize the options with defaults
253
+ metadata = @config.rpcs.get_site_search_engine.metadata.to_h
254
+
255
+ # Set x-goog-api-client and x-goog-user-project headers
256
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
258
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
259
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
260
+
261
+ header_params = {}
262
+ if request.name
263
+ header_params["name"] = request.name
264
+ end
265
+
266
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
267
+ metadata[:"x-goog-request-params"] ||= request_params_header
268
+
269
+ options.apply_defaults timeout: @config.rpcs.get_site_search_engine.timeout,
270
+ metadata: metadata,
271
+ retry_policy: @config.rpcs.get_site_search_engine.retry_policy
272
+
273
+ options.apply_defaults timeout: @config.timeout,
274
+ metadata: @config.metadata,
275
+ retry_policy: @config.retry_policy
276
+
277
+ @site_search_engine_service_stub.call_rpc :get_site_search_engine, request, options: options do |response, operation|
278
+ yield response, operation if block_given?
279
+ return response
280
+ end
281
+ rescue ::GRPC::BadStatus => e
282
+ raise ::Google::Cloud::Error.from_error(e)
283
+ end
284
+
285
+ ##
286
+ # Creates a {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}.
287
+ #
288
+ # @overload create_target_site(request, options = nil)
289
+ # Pass arguments to `create_target_site` via a request object, either of type
290
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CreateTargetSiteRequest} or an equivalent Hash.
291
+ #
292
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::CreateTargetSiteRequest, ::Hash]
293
+ # A request object representing the call parameters. Required. To specify no
294
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
295
+ # @param options [::Gapic::CallOptions, ::Hash]
296
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
297
+ #
298
+ # @overload create_target_site(parent: nil, target_site: nil)
299
+ # Pass arguments to `create_target_site` via keyword arguments. Note that at
300
+ # least one keyword argument is required. To specify no parameters, or to keep all
301
+ # the default parameter values, pass an empty Hash as a request object (see above).
302
+ #
303
+ # @param parent [::String]
304
+ # Required. Parent resource name of
305
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}, such as
306
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`.
307
+ # @param target_site [::Google::Cloud::DiscoveryEngine::V1beta::TargetSite, ::Hash]
308
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}
309
+ # to create.
310
+ #
311
+ # @yield [response, operation] Access the result along with the RPC operation
312
+ # @yieldparam response [::Gapic::Operation]
313
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
314
+ #
315
+ # @return [::Gapic::Operation]
316
+ #
317
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
318
+ #
319
+ # @example Basic example
320
+ # require "google/cloud/discovery_engine/v1beta"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Cloud::DiscoveryEngine::V1beta::CreateTargetSiteRequest.new
327
+ #
328
+ # # Call the create_target_site method.
329
+ # result = client.create_target_site request
330
+ #
331
+ # # The returned object is of type Gapic::Operation. You can use it to
332
+ # # check the status of an operation, cancel it, or wait for results.
333
+ # # Here is how to wait for a response.
334
+ # result.wait_until_done! timeout: 60
335
+ # if result.response?
336
+ # p result.response
337
+ # else
338
+ # puts "No response received."
339
+ # end
340
+ #
341
+ def create_target_site request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::CreateTargetSiteRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ metadata = @config.rpcs.create_target_site.metadata.to_h
351
+
352
+ # Set x-goog-api-client and x-goog-user-project headers
353
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
356
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ header_params = {}
359
+ if request.parent
360
+ header_params["parent"] = request.parent
361
+ end
362
+
363
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
+ metadata[:"x-goog-request-params"] ||= request_params_header
365
+
366
+ options.apply_defaults timeout: @config.rpcs.create_target_site.timeout,
367
+ metadata: metadata,
368
+ retry_policy: @config.rpcs.create_target_site.retry_policy
369
+
370
+ options.apply_defaults timeout: @config.timeout,
371
+ metadata: @config.metadata,
372
+ retry_policy: @config.retry_policy
373
+
374
+ @site_search_engine_service_stub.call_rpc :create_target_site, request, options: options do |response, operation|
375
+ response = ::Gapic::Operation.new response, @operations_client, options: options
376
+ yield response, operation if block_given?
377
+ return response
378
+ end
379
+ rescue ::GRPC::BadStatus => e
380
+ raise ::Google::Cloud::Error.from_error(e)
381
+ end
382
+
383
+ ##
384
+ # Creates {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite} in a
385
+ # batch.
386
+ #
387
+ # @overload batch_create_target_sites(request, options = nil)
388
+ # Pass arguments to `batch_create_target_sites` via a request object, either of type
389
+ # {::Google::Cloud::DiscoveryEngine::V1beta::BatchCreateTargetSitesRequest} or an equivalent Hash.
390
+ #
391
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::BatchCreateTargetSitesRequest, ::Hash]
392
+ # A request object representing the call parameters. Required. To specify no
393
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
394
+ # @param options [::Gapic::CallOptions, ::Hash]
395
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
396
+ #
397
+ # @overload batch_create_target_sites(parent: nil, requests: nil)
398
+ # Pass arguments to `batch_create_target_sites` via keyword arguments. Note that at
399
+ # least one keyword argument is required. To specify no parameters, or to keep all
400
+ # the default parameter values, pass an empty Hash as a request object (see above).
401
+ #
402
+ # @param parent [::String]
403
+ # Required. The parent resource shared by all TargetSites being created.
404
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`.
405
+ # The parent field in the CreateBookRequest messages must either be empty or
406
+ # match this field.
407
+ # @param requests [::Array<::Google::Cloud::DiscoveryEngine::V1beta::CreateTargetSiteRequest, ::Hash>]
408
+ # Required. The request message specifying the resources to create.
409
+ # A maximum of 20 TargetSites can be created in a batch.
410
+ #
411
+ # @yield [response, operation] Access the result along with the RPC operation
412
+ # @yieldparam response [::Gapic::Operation]
413
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
414
+ #
415
+ # @return [::Gapic::Operation]
416
+ #
417
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
418
+ #
419
+ # @example Basic example
420
+ # require "google/cloud/discovery_engine/v1beta"
421
+ #
422
+ # # Create a client object. The client can be reused for multiple calls.
423
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
424
+ #
425
+ # # Create a request. To set request fields, pass in keyword arguments.
426
+ # request = Google::Cloud::DiscoveryEngine::V1beta::BatchCreateTargetSitesRequest.new
427
+ #
428
+ # # Call the batch_create_target_sites method.
429
+ # result = client.batch_create_target_sites request
430
+ #
431
+ # # The returned object is of type Gapic::Operation. You can use it to
432
+ # # check the status of an operation, cancel it, or wait for results.
433
+ # # Here is how to wait for a response.
434
+ # result.wait_until_done! timeout: 60
435
+ # if result.response?
436
+ # p result.response
437
+ # else
438
+ # puts "No response received."
439
+ # end
440
+ #
441
+ def batch_create_target_sites request, options = nil
442
+ raise ::ArgumentError, "request must be provided" if request.nil?
443
+
444
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::BatchCreateTargetSitesRequest
445
+
446
+ # Converts hash and nil to an options object
447
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
448
+
449
+ # Customize the options with defaults
450
+ metadata = @config.rpcs.batch_create_target_sites.metadata.to_h
451
+
452
+ # Set x-goog-api-client and x-goog-user-project headers
453
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
455
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
456
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
457
+
458
+ header_params = {}
459
+ if request.parent
460
+ header_params["parent"] = request.parent
461
+ end
462
+
463
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
464
+ metadata[:"x-goog-request-params"] ||= request_params_header
465
+
466
+ options.apply_defaults timeout: @config.rpcs.batch_create_target_sites.timeout,
467
+ metadata: metadata,
468
+ retry_policy: @config.rpcs.batch_create_target_sites.retry_policy
469
+
470
+ options.apply_defaults timeout: @config.timeout,
471
+ metadata: @config.metadata,
472
+ retry_policy: @config.retry_policy
473
+
474
+ @site_search_engine_service_stub.call_rpc :batch_create_target_sites, request, options: options do |response, operation|
475
+ response = ::Gapic::Operation.new response, @operations_client, options: options
476
+ yield response, operation if block_given?
477
+ return response
478
+ end
479
+ rescue ::GRPC::BadStatus => e
480
+ raise ::Google::Cloud::Error.from_error(e)
481
+ end
482
+
483
+ ##
484
+ # Gets a {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}.
485
+ #
486
+ # @overload get_target_site(request, options = nil)
487
+ # Pass arguments to `get_target_site` via a request object, either of type
488
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetTargetSiteRequest} or an equivalent Hash.
489
+ #
490
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetTargetSiteRequest, ::Hash]
491
+ # A request object representing the call parameters. Required. To specify no
492
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
493
+ # @param options [::Gapic::CallOptions, ::Hash]
494
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
495
+ #
496
+ # @overload get_target_site(name: nil)
497
+ # Pass arguments to `get_target_site` via keyword arguments. Note that at
498
+ # least one keyword argument is required. To specify no parameters, or to keep all
499
+ # the default parameter values, pass an empty Hash as a request object (see above).
500
+ #
501
+ # @param name [::String]
502
+ # Required. Full resource name of
503
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}, such as
504
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`.
505
+ #
506
+ # If the caller does not have permission to access the
507
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}, regardless of
508
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
509
+ #
510
+ # If the requested
511
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite} does not
512
+ # exist, a NOT_FOUND error is returned.
513
+ #
514
+ # @yield [response, operation] Access the result along with the RPC operation
515
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::TargetSite]
516
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
517
+ #
518
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::TargetSite]
519
+ #
520
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
521
+ #
522
+ # @example Basic example
523
+ # require "google/cloud/discovery_engine/v1beta"
524
+ #
525
+ # # Create a client object. The client can be reused for multiple calls.
526
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
527
+ #
528
+ # # Create a request. To set request fields, pass in keyword arguments.
529
+ # request = Google::Cloud::DiscoveryEngine::V1beta::GetTargetSiteRequest.new
530
+ #
531
+ # # Call the get_target_site method.
532
+ # result = client.get_target_site request
533
+ #
534
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::TargetSite.
535
+ # p result
536
+ #
537
+ def get_target_site request, options = nil
538
+ raise ::ArgumentError, "request must be provided" if request.nil?
539
+
540
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetTargetSiteRequest
541
+
542
+ # Converts hash and nil to an options object
543
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
544
+
545
+ # Customize the options with defaults
546
+ metadata = @config.rpcs.get_target_site.metadata.to_h
547
+
548
+ # Set x-goog-api-client and x-goog-user-project headers
549
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
550
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
551
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
552
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
553
+
554
+ header_params = {}
555
+ if request.name
556
+ header_params["name"] = request.name
557
+ end
558
+
559
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
560
+ metadata[:"x-goog-request-params"] ||= request_params_header
561
+
562
+ options.apply_defaults timeout: @config.rpcs.get_target_site.timeout,
563
+ metadata: metadata,
564
+ retry_policy: @config.rpcs.get_target_site.retry_policy
565
+
566
+ options.apply_defaults timeout: @config.timeout,
567
+ metadata: @config.metadata,
568
+ retry_policy: @config.retry_policy
569
+
570
+ @site_search_engine_service_stub.call_rpc :get_target_site, request, options: options do |response, operation|
571
+ yield response, operation if block_given?
572
+ return response
573
+ end
574
+ rescue ::GRPC::BadStatus => e
575
+ raise ::Google::Cloud::Error.from_error(e)
576
+ end
577
+
578
+ ##
579
+ # Updates a {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}.
580
+ #
581
+ # @overload update_target_site(request, options = nil)
582
+ # Pass arguments to `update_target_site` via a request object, either of type
583
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateTargetSiteRequest} or an equivalent Hash.
584
+ #
585
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::UpdateTargetSiteRequest, ::Hash]
586
+ # A request object representing the call parameters. Required. To specify no
587
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
588
+ # @param options [::Gapic::CallOptions, ::Hash]
589
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
590
+ #
591
+ # @overload update_target_site(target_site: nil)
592
+ # Pass arguments to `update_target_site` via keyword arguments. Note that at
593
+ # least one keyword argument is required. To specify no parameters, or to keep all
594
+ # the default parameter values, pass an empty Hash as a request object (see above).
595
+ #
596
+ # @param target_site [::Google::Cloud::DiscoveryEngine::V1beta::TargetSite, ::Hash]
597
+ # Required. The target site to update.
598
+ # If the caller does not have permission to update the
599
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}, regardless of
600
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
601
+ #
602
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite} to
603
+ # update does not exist, a NOT_FOUND error is returned.
604
+ #
605
+ # @yield [response, operation] Access the result along with the RPC operation
606
+ # @yieldparam response [::Gapic::Operation]
607
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
608
+ #
609
+ # @return [::Gapic::Operation]
610
+ #
611
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
612
+ #
613
+ # @example Basic example
614
+ # require "google/cloud/discovery_engine/v1beta"
615
+ #
616
+ # # Create a client object. The client can be reused for multiple calls.
617
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
618
+ #
619
+ # # Create a request. To set request fields, pass in keyword arguments.
620
+ # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateTargetSiteRequest.new
621
+ #
622
+ # # Call the update_target_site method.
623
+ # result = client.update_target_site request
624
+ #
625
+ # # The returned object is of type Gapic::Operation. You can use it to
626
+ # # check the status of an operation, cancel it, or wait for results.
627
+ # # Here is how to wait for a response.
628
+ # result.wait_until_done! timeout: 60
629
+ # if result.response?
630
+ # p result.response
631
+ # else
632
+ # puts "No response received."
633
+ # end
634
+ #
635
+ def update_target_site request, options = nil
636
+ raise ::ArgumentError, "request must be provided" if request.nil?
637
+
638
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::UpdateTargetSiteRequest
639
+
640
+ # Converts hash and nil to an options object
641
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
642
+
643
+ # Customize the options with defaults
644
+ metadata = @config.rpcs.update_target_site.metadata.to_h
645
+
646
+ # Set x-goog-api-client and x-goog-user-project headers
647
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
648
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
649
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
650
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
651
+
652
+ header_params = {}
653
+ if request.target_site&.name
654
+ header_params["target_site.name"] = request.target_site.name
655
+ end
656
+
657
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
658
+ metadata[:"x-goog-request-params"] ||= request_params_header
659
+
660
+ options.apply_defaults timeout: @config.rpcs.update_target_site.timeout,
661
+ metadata: metadata,
662
+ retry_policy: @config.rpcs.update_target_site.retry_policy
663
+
664
+ options.apply_defaults timeout: @config.timeout,
665
+ metadata: @config.metadata,
666
+ retry_policy: @config.retry_policy
667
+
668
+ @site_search_engine_service_stub.call_rpc :update_target_site, request, options: options do |response, operation|
669
+ response = ::Gapic::Operation.new response, @operations_client, options: options
670
+ yield response, operation if block_given?
671
+ return response
672
+ end
673
+ rescue ::GRPC::BadStatus => e
674
+ raise ::Google::Cloud::Error.from_error(e)
675
+ end
676
+
677
+ ##
678
+ # Deletes a {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}.
679
+ #
680
+ # @overload delete_target_site(request, options = nil)
681
+ # Pass arguments to `delete_target_site` via a request object, either of type
682
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DeleteTargetSiteRequest} or an equivalent Hash.
683
+ #
684
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::DeleteTargetSiteRequest, ::Hash]
685
+ # A request object representing the call parameters. Required. To specify no
686
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
687
+ # @param options [::Gapic::CallOptions, ::Hash]
688
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
689
+ #
690
+ # @overload delete_target_site(name: nil)
691
+ # Pass arguments to `delete_target_site` via keyword arguments. Note that at
692
+ # least one keyword argument is required. To specify no parameters, or to keep all
693
+ # the default parameter values, pass an empty Hash as a request object (see above).
694
+ #
695
+ # @param name [::String]
696
+ # Required. Full resource name of
697
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}, such as
698
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`.
699
+ #
700
+ # If the caller does not have permission to access the
701
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}, regardless of
702
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
703
+ #
704
+ # If the requested
705
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite} does not
706
+ # exist, a NOT_FOUND error is returned.
707
+ #
708
+ # @yield [response, operation] Access the result along with the RPC operation
709
+ # @yieldparam response [::Gapic::Operation]
710
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
711
+ #
712
+ # @return [::Gapic::Operation]
713
+ #
714
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
715
+ #
716
+ # @example Basic example
717
+ # require "google/cloud/discovery_engine/v1beta"
718
+ #
719
+ # # Create a client object. The client can be reused for multiple calls.
720
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
721
+ #
722
+ # # Create a request. To set request fields, pass in keyword arguments.
723
+ # request = Google::Cloud::DiscoveryEngine::V1beta::DeleteTargetSiteRequest.new
724
+ #
725
+ # # Call the delete_target_site method.
726
+ # result = client.delete_target_site request
727
+ #
728
+ # # The returned object is of type Gapic::Operation. You can use it to
729
+ # # check the status of an operation, cancel it, or wait for results.
730
+ # # Here is how to wait for a response.
731
+ # result.wait_until_done! timeout: 60
732
+ # if result.response?
733
+ # p result.response
734
+ # else
735
+ # puts "No response received."
736
+ # end
737
+ #
738
+ def delete_target_site request, options = nil
739
+ raise ::ArgumentError, "request must be provided" if request.nil?
740
+
741
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::DeleteTargetSiteRequest
742
+
743
+ # Converts hash and nil to an options object
744
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
745
+
746
+ # Customize the options with defaults
747
+ metadata = @config.rpcs.delete_target_site.metadata.to_h
748
+
749
+ # Set x-goog-api-client and x-goog-user-project headers
750
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
751
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
752
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
753
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
754
+
755
+ header_params = {}
756
+ if request.name
757
+ header_params["name"] = request.name
758
+ end
759
+
760
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
761
+ metadata[:"x-goog-request-params"] ||= request_params_header
762
+
763
+ options.apply_defaults timeout: @config.rpcs.delete_target_site.timeout,
764
+ metadata: metadata,
765
+ retry_policy: @config.rpcs.delete_target_site.retry_policy
766
+
767
+ options.apply_defaults timeout: @config.timeout,
768
+ metadata: @config.metadata,
769
+ retry_policy: @config.retry_policy
770
+
771
+ @site_search_engine_service_stub.call_rpc :delete_target_site, request, options: options do |response, operation|
772
+ response = ::Gapic::Operation.new response, @operations_client, options: options
773
+ yield response, operation if block_given?
774
+ return response
775
+ end
776
+ rescue ::GRPC::BadStatus => e
777
+ raise ::Google::Cloud::Error.from_error(e)
778
+ end
779
+
780
+ ##
781
+ # Gets a list of
782
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}s.
783
+ #
784
+ # @overload list_target_sites(request, options = nil)
785
+ # Pass arguments to `list_target_sites` via a request object, either of type
786
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListTargetSitesRequest} or an equivalent Hash.
787
+ #
788
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListTargetSitesRequest, ::Hash]
789
+ # A request object representing the call parameters. Required. To specify no
790
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
791
+ # @param options [::Gapic::CallOptions, ::Hash]
792
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
793
+ #
794
+ # @overload list_target_sites(parent: nil, page_size: nil, page_token: nil)
795
+ # Pass arguments to `list_target_sites` via keyword arguments. Note that at
796
+ # least one keyword argument is required. To specify no parameters, or to keep all
797
+ # the default parameter values, pass an empty Hash as a request object (see above).
798
+ #
799
+ # @param parent [::String]
800
+ # Required. The parent site search engine resource name, such as
801
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`.
802
+ #
803
+ # If the caller does not have permission to list
804
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite}s under this
805
+ # site search engine, regardless of whether or not this branch exists, a
806
+ # PERMISSION_DENIED error is returned.
807
+ # @param page_size [::Integer]
808
+ # Requested page size. Server may return fewer items than requested. If
809
+ # unspecified, server will pick an appropriate default. The maximum value is
810
+ # 1000; values above 1000 will be coerced to 1000.
811
+ #
812
+ # If this field is negative, an INVALID_ARGUMENT error is returned.
813
+ # @param page_token [::String]
814
+ # A page token, received from a previous `ListTargetSites` call.
815
+ # Provide this to retrieve the subsequent page.
816
+ #
817
+ # When paginating, all other parameters provided to `ListTargetSites`
818
+ # must match the call that provided the page token.
819
+ #
820
+ # @yield [response, operation] Access the result along with the RPC operation
821
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::TargetSite>]
822
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
823
+ #
824
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::TargetSite>]
825
+ #
826
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
827
+ #
828
+ # @example Basic example
829
+ # require "google/cloud/discovery_engine/v1beta"
830
+ #
831
+ # # Create a client object. The client can be reused for multiple calls.
832
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
833
+ #
834
+ # # Create a request. To set request fields, pass in keyword arguments.
835
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ListTargetSitesRequest.new
836
+ #
837
+ # # Call the list_target_sites method.
838
+ # result = client.list_target_sites request
839
+ #
840
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
841
+ # # over elements, and API calls will be issued to fetch pages as needed.
842
+ # result.each do |item|
843
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::TargetSite.
844
+ # p item
845
+ # end
846
+ #
847
+ def list_target_sites request, options = nil
848
+ raise ::ArgumentError, "request must be provided" if request.nil?
849
+
850
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListTargetSitesRequest
851
+
852
+ # Converts hash and nil to an options object
853
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
854
+
855
+ # Customize the options with defaults
856
+ metadata = @config.rpcs.list_target_sites.metadata.to_h
857
+
858
+ # Set x-goog-api-client and x-goog-user-project headers
859
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
860
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
861
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
862
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
863
+
864
+ header_params = {}
865
+ if request.parent
866
+ header_params["parent"] = request.parent
867
+ end
868
+
869
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
870
+ metadata[:"x-goog-request-params"] ||= request_params_header
871
+
872
+ options.apply_defaults timeout: @config.rpcs.list_target_sites.timeout,
873
+ metadata: metadata,
874
+ retry_policy: @config.rpcs.list_target_sites.retry_policy
875
+
876
+ options.apply_defaults timeout: @config.timeout,
877
+ metadata: @config.metadata,
878
+ retry_policy: @config.retry_policy
879
+
880
+ @site_search_engine_service_stub.call_rpc :list_target_sites, request, options: options do |response, operation|
881
+ response = ::Gapic::PagedEnumerable.new @site_search_engine_service_stub, :list_target_sites, request, response, operation, options
882
+ yield response, operation if block_given?
883
+ return response
884
+ end
885
+ rescue ::GRPC::BadStatus => e
886
+ raise ::Google::Cloud::Error.from_error(e)
887
+ end
888
+
889
+ ##
890
+ # Upgrade from basic site search to advanced site search.
891
+ #
892
+ # @overload enable_advanced_site_search(request, options = nil)
893
+ # Pass arguments to `enable_advanced_site_search` via a request object, either of type
894
+ # {::Google::Cloud::DiscoveryEngine::V1beta::EnableAdvancedSiteSearchRequest} or an equivalent Hash.
895
+ #
896
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::EnableAdvancedSiteSearchRequest, ::Hash]
897
+ # A request object representing the call parameters. Required. To specify no
898
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
899
+ # @param options [::Gapic::CallOptions, ::Hash]
900
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
901
+ #
902
+ # @overload enable_advanced_site_search(site_search_engine: nil)
903
+ # Pass arguments to `enable_advanced_site_search` via keyword arguments. Note that at
904
+ # least one keyword argument is required. To specify no parameters, or to keep all
905
+ # the default parameter values, pass an empty Hash as a request object (see above).
906
+ #
907
+ # @param site_search_engine [::String]
908
+ # Required. Full resource name of the
909
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine SiteSearchEngine},
910
+ # such as
911
+ # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`.
912
+ #
913
+ # @yield [response, operation] Access the result along with the RPC operation
914
+ # @yieldparam response [::Gapic::Operation]
915
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
916
+ #
917
+ # @return [::Gapic::Operation]
918
+ #
919
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
920
+ #
921
+ # @example Basic example
922
+ # require "google/cloud/discovery_engine/v1beta"
923
+ #
924
+ # # Create a client object. The client can be reused for multiple calls.
925
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
926
+ #
927
+ # # Create a request. To set request fields, pass in keyword arguments.
928
+ # request = Google::Cloud::DiscoveryEngine::V1beta::EnableAdvancedSiteSearchRequest.new
929
+ #
930
+ # # Call the enable_advanced_site_search method.
931
+ # result = client.enable_advanced_site_search request
932
+ #
933
+ # # The returned object is of type Gapic::Operation. You can use it to
934
+ # # check the status of an operation, cancel it, or wait for results.
935
+ # # Here is how to wait for a response.
936
+ # result.wait_until_done! timeout: 60
937
+ # if result.response?
938
+ # p result.response
939
+ # else
940
+ # puts "No response received."
941
+ # end
942
+ #
943
+ def enable_advanced_site_search request, options = nil
944
+ raise ::ArgumentError, "request must be provided" if request.nil?
945
+
946
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::EnableAdvancedSiteSearchRequest
947
+
948
+ # Converts hash and nil to an options object
949
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
950
+
951
+ # Customize the options with defaults
952
+ metadata = @config.rpcs.enable_advanced_site_search.metadata.to_h
953
+
954
+ # Set x-goog-api-client and x-goog-user-project headers
955
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
956
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
957
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
958
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
959
+
960
+ header_params = {}
961
+ if request.site_search_engine
962
+ header_params["site_search_engine"] = request.site_search_engine
963
+ end
964
+
965
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
966
+ metadata[:"x-goog-request-params"] ||= request_params_header
967
+
968
+ options.apply_defaults timeout: @config.rpcs.enable_advanced_site_search.timeout,
969
+ metadata: metadata,
970
+ retry_policy: @config.rpcs.enable_advanced_site_search.retry_policy
971
+
972
+ options.apply_defaults timeout: @config.timeout,
973
+ metadata: @config.metadata,
974
+ retry_policy: @config.retry_policy
975
+
976
+ @site_search_engine_service_stub.call_rpc :enable_advanced_site_search, request, options: options do |response, operation|
977
+ response = ::Gapic::Operation.new response, @operations_client, options: options
978
+ yield response, operation if block_given?
979
+ return response
980
+ end
981
+ rescue ::GRPC::BadStatus => e
982
+ raise ::Google::Cloud::Error.from_error(e)
983
+ end
984
+
985
+ ##
986
+ # Downgrade from advanced site search to basic site search.
987
+ #
988
+ # @overload disable_advanced_site_search(request, options = nil)
989
+ # Pass arguments to `disable_advanced_site_search` via a request object, either of type
990
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DisableAdvancedSiteSearchRequest} or an equivalent Hash.
991
+ #
992
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::DisableAdvancedSiteSearchRequest, ::Hash]
993
+ # A request object representing the call parameters. Required. To specify no
994
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
995
+ # @param options [::Gapic::CallOptions, ::Hash]
996
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
997
+ #
998
+ # @overload disable_advanced_site_search(site_search_engine: nil)
999
+ # Pass arguments to `disable_advanced_site_search` via keyword arguments. Note that at
1000
+ # least one keyword argument is required. To specify no parameters, or to keep all
1001
+ # the default parameter values, pass an empty Hash as a request object (see above).
1002
+ #
1003
+ # @param site_search_engine [::String]
1004
+ # Required. Full resource name of the
1005
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine SiteSearchEngine},
1006
+ # such as
1007
+ # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`.
1008
+ #
1009
+ # @yield [response, operation] Access the result along with the RPC operation
1010
+ # @yieldparam response [::Gapic::Operation]
1011
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1012
+ #
1013
+ # @return [::Gapic::Operation]
1014
+ #
1015
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1016
+ #
1017
+ # @example Basic example
1018
+ # require "google/cloud/discovery_engine/v1beta"
1019
+ #
1020
+ # # Create a client object. The client can be reused for multiple calls.
1021
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
1022
+ #
1023
+ # # Create a request. To set request fields, pass in keyword arguments.
1024
+ # request = Google::Cloud::DiscoveryEngine::V1beta::DisableAdvancedSiteSearchRequest.new
1025
+ #
1026
+ # # Call the disable_advanced_site_search method.
1027
+ # result = client.disable_advanced_site_search request
1028
+ #
1029
+ # # The returned object is of type Gapic::Operation. You can use it to
1030
+ # # check the status of an operation, cancel it, or wait for results.
1031
+ # # Here is how to wait for a response.
1032
+ # result.wait_until_done! timeout: 60
1033
+ # if result.response?
1034
+ # p result.response
1035
+ # else
1036
+ # puts "No response received."
1037
+ # end
1038
+ #
1039
+ def disable_advanced_site_search request, options = nil
1040
+ raise ::ArgumentError, "request must be provided" if request.nil?
1041
+
1042
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::DisableAdvancedSiteSearchRequest
1043
+
1044
+ # Converts hash and nil to an options object
1045
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1046
+
1047
+ # Customize the options with defaults
1048
+ metadata = @config.rpcs.disable_advanced_site_search.metadata.to_h
1049
+
1050
+ # Set x-goog-api-client and x-goog-user-project headers
1051
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1052
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1053
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
1054
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1055
+
1056
+ header_params = {}
1057
+ if request.site_search_engine
1058
+ header_params["site_search_engine"] = request.site_search_engine
1059
+ end
1060
+
1061
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1062
+ metadata[:"x-goog-request-params"] ||= request_params_header
1063
+
1064
+ options.apply_defaults timeout: @config.rpcs.disable_advanced_site_search.timeout,
1065
+ metadata: metadata,
1066
+ retry_policy: @config.rpcs.disable_advanced_site_search.retry_policy
1067
+
1068
+ options.apply_defaults timeout: @config.timeout,
1069
+ metadata: @config.metadata,
1070
+ retry_policy: @config.retry_policy
1071
+
1072
+ @site_search_engine_service_stub.call_rpc :disable_advanced_site_search, request, options: options do |response, operation|
1073
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1074
+ yield response, operation if block_given?
1075
+ return response
1076
+ end
1077
+ rescue ::GRPC::BadStatus => e
1078
+ raise ::Google::Cloud::Error.from_error(e)
1079
+ end
1080
+
1081
+ ##
1082
+ # Request on-demand recrawl for a list of URIs.
1083
+ #
1084
+ # @overload recrawl_uris(request, options = nil)
1085
+ # Pass arguments to `recrawl_uris` via a request object, either of type
1086
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RecrawlUrisRequest} or an equivalent Hash.
1087
+ #
1088
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::RecrawlUrisRequest, ::Hash]
1089
+ # A request object representing the call parameters. Required. To specify no
1090
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1091
+ # @param options [::Gapic::CallOptions, ::Hash]
1092
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1093
+ #
1094
+ # @overload recrawl_uris(site_search_engine: nil, uris: nil)
1095
+ # Pass arguments to `recrawl_uris` via keyword arguments. Note that at
1096
+ # least one keyword argument is required. To specify no parameters, or to keep all
1097
+ # the default parameter values, pass an empty Hash as a request object (see above).
1098
+ #
1099
+ # @param site_search_engine [::String]
1100
+ # Required. Full resource name of the
1101
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngine SiteSearchEngine},
1102
+ # such as
1103
+ # `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
1104
+ # @param uris [::Array<::String>]
1105
+ # Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
1106
+ # an INVALID_ARGUMENT error is thrown. Each URI should match at least one
1107
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TargetSite TargetSite} in
1108
+ # `site_search_engine`.
1109
+ #
1110
+ # @yield [response, operation] Access the result along with the RPC operation
1111
+ # @yieldparam response [::Gapic::Operation]
1112
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1113
+ #
1114
+ # @return [::Gapic::Operation]
1115
+ #
1116
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1117
+ #
1118
+ # @example Basic example
1119
+ # require "google/cloud/discovery_engine/v1beta"
1120
+ #
1121
+ # # Create a client object. The client can be reused for multiple calls.
1122
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
1123
+ #
1124
+ # # Create a request. To set request fields, pass in keyword arguments.
1125
+ # request = Google::Cloud::DiscoveryEngine::V1beta::RecrawlUrisRequest.new
1126
+ #
1127
+ # # Call the recrawl_uris method.
1128
+ # result = client.recrawl_uris request
1129
+ #
1130
+ # # The returned object is of type Gapic::Operation. You can use it to
1131
+ # # check the status of an operation, cancel it, or wait for results.
1132
+ # # Here is how to wait for a response.
1133
+ # result.wait_until_done! timeout: 60
1134
+ # if result.response?
1135
+ # p result.response
1136
+ # else
1137
+ # puts "No response received."
1138
+ # end
1139
+ #
1140
+ def recrawl_uris request, options = nil
1141
+ raise ::ArgumentError, "request must be provided" if request.nil?
1142
+
1143
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::RecrawlUrisRequest
1144
+
1145
+ # Converts hash and nil to an options object
1146
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1147
+
1148
+ # Customize the options with defaults
1149
+ metadata = @config.rpcs.recrawl_uris.metadata.to_h
1150
+
1151
+ # Set x-goog-api-client and x-goog-user-project headers
1152
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1153
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1154
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
1155
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1156
+
1157
+ header_params = {}
1158
+ if request.site_search_engine
1159
+ header_params["site_search_engine"] = request.site_search_engine
1160
+ end
1161
+
1162
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1163
+ metadata[:"x-goog-request-params"] ||= request_params_header
1164
+
1165
+ options.apply_defaults timeout: @config.rpcs.recrawl_uris.timeout,
1166
+ metadata: metadata,
1167
+ retry_policy: @config.rpcs.recrawl_uris.retry_policy
1168
+
1169
+ options.apply_defaults timeout: @config.timeout,
1170
+ metadata: @config.metadata,
1171
+ retry_policy: @config.retry_policy
1172
+
1173
+ @site_search_engine_service_stub.call_rpc :recrawl_uris, request, options: options do |response, operation|
1174
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1175
+ yield response, operation if block_given?
1176
+ return response
1177
+ end
1178
+ rescue ::GRPC::BadStatus => e
1179
+ raise ::Google::Cloud::Error.from_error(e)
1180
+ end
1181
+
1182
+ ##
1183
+ # Verify target sites' ownership and validity.
1184
+ # This API sends all the target sites under site search engine for
1185
+ # verification.
1186
+ #
1187
+ # @overload batch_verify_target_sites(request, options = nil)
1188
+ # Pass arguments to `batch_verify_target_sites` via a request object, either of type
1189
+ # {::Google::Cloud::DiscoveryEngine::V1beta::BatchVerifyTargetSitesRequest} or an equivalent Hash.
1190
+ #
1191
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::BatchVerifyTargetSitesRequest, ::Hash]
1192
+ # A request object representing the call parameters. Required. To specify no
1193
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1194
+ # @param options [::Gapic::CallOptions, ::Hash]
1195
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1196
+ #
1197
+ # @overload batch_verify_target_sites(parent: nil)
1198
+ # Pass arguments to `batch_verify_target_sites` via keyword arguments. Note that at
1199
+ # least one keyword argument is required. To specify no parameters, or to keep all
1200
+ # the default parameter values, pass an empty Hash as a request object (see above).
1201
+ #
1202
+ # @param parent [::String]
1203
+ # Required. The parent resource shared by all TargetSites being verified.
1204
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`.
1205
+ #
1206
+ # @yield [response, operation] Access the result along with the RPC operation
1207
+ # @yieldparam response [::Gapic::Operation]
1208
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1209
+ #
1210
+ # @return [::Gapic::Operation]
1211
+ #
1212
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1213
+ #
1214
+ # @example Basic example
1215
+ # require "google/cloud/discovery_engine/v1beta"
1216
+ #
1217
+ # # Create a client object. The client can be reused for multiple calls.
1218
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
1219
+ #
1220
+ # # Create a request. To set request fields, pass in keyword arguments.
1221
+ # request = Google::Cloud::DiscoveryEngine::V1beta::BatchVerifyTargetSitesRequest.new
1222
+ #
1223
+ # # Call the batch_verify_target_sites method.
1224
+ # result = client.batch_verify_target_sites request
1225
+ #
1226
+ # # The returned object is of type Gapic::Operation. You can use it to
1227
+ # # check the status of an operation, cancel it, or wait for results.
1228
+ # # Here is how to wait for a response.
1229
+ # result.wait_until_done! timeout: 60
1230
+ # if result.response?
1231
+ # p result.response
1232
+ # else
1233
+ # puts "No response received."
1234
+ # end
1235
+ #
1236
+ def batch_verify_target_sites request, options = nil
1237
+ raise ::ArgumentError, "request must be provided" if request.nil?
1238
+
1239
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::BatchVerifyTargetSitesRequest
1240
+
1241
+ # Converts hash and nil to an options object
1242
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1243
+
1244
+ # Customize the options with defaults
1245
+ metadata = @config.rpcs.batch_verify_target_sites.metadata.to_h
1246
+
1247
+ # Set x-goog-api-client and x-goog-user-project headers
1248
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1249
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1250
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
1251
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1252
+
1253
+ header_params = {}
1254
+ if request.parent
1255
+ header_params["parent"] = request.parent
1256
+ end
1257
+
1258
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1259
+ metadata[:"x-goog-request-params"] ||= request_params_header
1260
+
1261
+ options.apply_defaults timeout: @config.rpcs.batch_verify_target_sites.timeout,
1262
+ metadata: metadata,
1263
+ retry_policy: @config.rpcs.batch_verify_target_sites.retry_policy
1264
+
1265
+ options.apply_defaults timeout: @config.timeout,
1266
+ metadata: @config.metadata,
1267
+ retry_policy: @config.retry_policy
1268
+
1269
+ @site_search_engine_service_stub.call_rpc :batch_verify_target_sites, request, options: options do |response, operation|
1270
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1271
+ yield response, operation if block_given?
1272
+ return response
1273
+ end
1274
+ rescue ::GRPC::BadStatus => e
1275
+ raise ::Google::Cloud::Error.from_error(e)
1276
+ end
1277
+
1278
+ ##
1279
+ # Returns list of target sites with its domain verification status.
1280
+ # This method can only be called under data store with BASIC_SITE_SEARCH
1281
+ # state at the moment.
1282
+ #
1283
+ # @overload fetch_domain_verification_status(request, options = nil)
1284
+ # Pass arguments to `fetch_domain_verification_status` via a request object, either of type
1285
+ # {::Google::Cloud::DiscoveryEngine::V1beta::FetchDomainVerificationStatusRequest} or an equivalent Hash.
1286
+ #
1287
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::FetchDomainVerificationStatusRequest, ::Hash]
1288
+ # A request object representing the call parameters. Required. To specify no
1289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1290
+ # @param options [::Gapic::CallOptions, ::Hash]
1291
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1292
+ #
1293
+ # @overload fetch_domain_verification_status(site_search_engine: nil, page_size: nil, page_token: nil)
1294
+ # Pass arguments to `fetch_domain_verification_status` via keyword arguments. Note that at
1295
+ # least one keyword argument is required. To specify no parameters, or to keep all
1296
+ # the default parameter values, pass an empty Hash as a request object (see above).
1297
+ #
1298
+ # @param site_search_engine [::String]
1299
+ # Required. The site search engine resource under which we fetch all the
1300
+ # domain verification status.
1301
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`.
1302
+ # @param page_size [::Integer]
1303
+ # Requested page size. Server may return fewer items than requested. If
1304
+ # unspecified, server will pick an appropriate default. The maximum value is
1305
+ # 1000; values above 1000 will be coerced to 1000.
1306
+ #
1307
+ # If this field is negative, an INVALID_ARGUMENT error is returned.
1308
+ # @param page_token [::String]
1309
+ # A page token, received from a previous `FetchDomainVerificationStatus`
1310
+ # call. Provide this to retrieve the subsequent page.
1311
+ #
1312
+ # When paginating, all other parameters provided to
1313
+ # `FetchDomainVerificationStatus` must match the call that provided the page
1314
+ # token.
1315
+ #
1316
+ # @yield [response, operation] Access the result along with the RPC operation
1317
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::TargetSite>]
1318
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1319
+ #
1320
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::TargetSite>]
1321
+ #
1322
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1323
+ #
1324
+ # @example Basic example
1325
+ # require "google/cloud/discovery_engine/v1beta"
1326
+ #
1327
+ # # Create a client object. The client can be reused for multiple calls.
1328
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new
1329
+ #
1330
+ # # Create a request. To set request fields, pass in keyword arguments.
1331
+ # request = Google::Cloud::DiscoveryEngine::V1beta::FetchDomainVerificationStatusRequest.new
1332
+ #
1333
+ # # Call the fetch_domain_verification_status method.
1334
+ # result = client.fetch_domain_verification_status request
1335
+ #
1336
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1337
+ # # over elements, and API calls will be issued to fetch pages as needed.
1338
+ # result.each do |item|
1339
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::TargetSite.
1340
+ # p item
1341
+ # end
1342
+ #
1343
+ def fetch_domain_verification_status request, options = nil
1344
+ raise ::ArgumentError, "request must be provided" if request.nil?
1345
+
1346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::FetchDomainVerificationStatusRequest
1347
+
1348
+ # Converts hash and nil to an options object
1349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1350
+
1351
+ # Customize the options with defaults
1352
+ metadata = @config.rpcs.fetch_domain_verification_status.metadata.to_h
1353
+
1354
+ # Set x-goog-api-client and x-goog-user-project headers
1355
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1357
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
1358
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1359
+
1360
+ header_params = {}
1361
+ if request.site_search_engine
1362
+ header_params["site_search_engine"] = request.site_search_engine
1363
+ end
1364
+
1365
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1366
+ metadata[:"x-goog-request-params"] ||= request_params_header
1367
+
1368
+ options.apply_defaults timeout: @config.rpcs.fetch_domain_verification_status.timeout,
1369
+ metadata: metadata,
1370
+ retry_policy: @config.rpcs.fetch_domain_verification_status.retry_policy
1371
+
1372
+ options.apply_defaults timeout: @config.timeout,
1373
+ metadata: @config.metadata,
1374
+ retry_policy: @config.retry_policy
1375
+
1376
+ @site_search_engine_service_stub.call_rpc :fetch_domain_verification_status, request, options: options do |response, operation|
1377
+ response = ::Gapic::PagedEnumerable.new @site_search_engine_service_stub, :fetch_domain_verification_status, request, response, operation, options
1378
+ yield response, operation if block_given?
1379
+ return response
1380
+ end
1381
+ rescue ::GRPC::BadStatus => e
1382
+ raise ::Google::Cloud::Error.from_error(e)
1383
+ end
1384
+
1385
+ ##
1386
+ # Configuration class for the SiteSearchEngineService API.
1387
+ #
1388
+ # This class represents the configuration for SiteSearchEngineService,
1389
+ # providing control over timeouts, retry behavior, logging, transport
1390
+ # parameters, and other low-level controls. Certain parameters can also be
1391
+ # applied individually to specific RPCs. See
1392
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client::Configuration::Rpcs}
1393
+ # for a list of RPCs that can be configured independently.
1394
+ #
1395
+ # Configuration can be applied globally to all clients, or to a single client
1396
+ # on construction.
1397
+ #
1398
+ # @example
1399
+ #
1400
+ # # Modify the global config, setting the timeout for
1401
+ # # get_site_search_engine to 20 seconds,
1402
+ # # and all remaining timeouts to 10 seconds.
1403
+ # ::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.configure do |config|
1404
+ # config.timeout = 10.0
1405
+ # config.rpcs.get_site_search_engine.timeout = 20.0
1406
+ # end
1407
+ #
1408
+ # # Apply the above configuration only to a new client.
1409
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SiteSearchEngineService::Client.new do |config|
1410
+ # config.timeout = 10.0
1411
+ # config.rpcs.get_site_search_engine.timeout = 20.0
1412
+ # end
1413
+ #
1414
+ # @!attribute [rw] endpoint
1415
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1416
+ # nil, indicating to use the default endpoint in the current universe domain.
1417
+ # @return [::String,nil]
1418
+ # @!attribute [rw] credentials
1419
+ # Credentials to send with calls. You may provide any of the following types:
1420
+ # * (`String`) The path to a service account key file in JSON format
1421
+ # * (`Hash`) A service account key as a Hash
1422
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1423
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1424
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1425
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1426
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1427
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1428
+ # * (`nil`) indicating no credentials
1429
+ # @return [::Object]
1430
+ # @!attribute [rw] scope
1431
+ # The OAuth scopes
1432
+ # @return [::Array<::String>]
1433
+ # @!attribute [rw] lib_name
1434
+ # The library name as recorded in instrumentation and logging
1435
+ # @return [::String]
1436
+ # @!attribute [rw] lib_version
1437
+ # The library version as recorded in instrumentation and logging
1438
+ # @return [::String]
1439
+ # @!attribute [rw] channel_args
1440
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1441
+ # `GRPC::Core::Channel` object is provided as the credential.
1442
+ # @return [::Hash]
1443
+ # @!attribute [rw] interceptors
1444
+ # An array of interceptors that are run before calls are executed.
1445
+ # @return [::Array<::GRPC::ClientInterceptor>]
1446
+ # @!attribute [rw] timeout
1447
+ # The call timeout in seconds.
1448
+ # @return [::Numeric]
1449
+ # @!attribute [rw] metadata
1450
+ # Additional gRPC headers to be sent with the call.
1451
+ # @return [::Hash{::Symbol=>::String}]
1452
+ # @!attribute [rw] retry_policy
1453
+ # The retry policy. The value is a hash with the following keys:
1454
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1455
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1456
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1457
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1458
+ # trigger a retry.
1459
+ # @return [::Hash]
1460
+ # @!attribute [rw] quota_project
1461
+ # A separate project against which to charge quota.
1462
+ # @return [::String]
1463
+ # @!attribute [rw] universe_domain
1464
+ # The universe domain within which to make requests. This determines the
1465
+ # default endpoint URL. The default value of nil uses the environment
1466
+ # universe (usually the default "googleapis.com" universe).
1467
+ # @return [::String,nil]
1468
+ #
1469
+ class Configuration
1470
+ extend ::Gapic::Config
1471
+
1472
+ # @private
1473
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1474
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
1475
+
1476
+ config_attr :endpoint, nil, ::String, nil
1477
+ config_attr :credentials, nil do |value|
1478
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1479
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1480
+ allowed.any? { |klass| klass === value }
1481
+ end
1482
+ config_attr :scope, nil, ::String, ::Array, nil
1483
+ config_attr :lib_name, nil, ::String, nil
1484
+ config_attr :lib_version, nil, ::String, nil
1485
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1486
+ config_attr :interceptors, nil, ::Array, nil
1487
+ config_attr :timeout, nil, ::Numeric, nil
1488
+ config_attr :metadata, nil, ::Hash, nil
1489
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1490
+ config_attr :quota_project, nil, ::String, nil
1491
+ config_attr :universe_domain, nil, ::String, nil
1492
+
1493
+ # @private
1494
+ def initialize parent_config = nil
1495
+ @parent_config = parent_config unless parent_config.nil?
1496
+
1497
+ yield self if block_given?
1498
+ end
1499
+
1500
+ ##
1501
+ # Configurations for individual RPCs
1502
+ # @return [Rpcs]
1503
+ #
1504
+ def rpcs
1505
+ @rpcs ||= begin
1506
+ parent_rpcs = nil
1507
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1508
+ Rpcs.new parent_rpcs
1509
+ end
1510
+ end
1511
+
1512
+ ##
1513
+ # Configuration for the channel pool
1514
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1515
+ #
1516
+ def channel_pool
1517
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1518
+ end
1519
+
1520
+ ##
1521
+ # Configuration RPC class for the SiteSearchEngineService API.
1522
+ #
1523
+ # Includes fields providing the configuration for each RPC in this service.
1524
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1525
+ # the following configuration fields:
1526
+ #
1527
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1528
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1529
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1530
+ # include the following keys:
1531
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1532
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1533
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1534
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1535
+ # trigger a retry.
1536
+ #
1537
+ class Rpcs
1538
+ ##
1539
+ # RPC-specific configuration for `get_site_search_engine`
1540
+ # @return [::Gapic::Config::Method]
1541
+ #
1542
+ attr_reader :get_site_search_engine
1543
+ ##
1544
+ # RPC-specific configuration for `create_target_site`
1545
+ # @return [::Gapic::Config::Method]
1546
+ #
1547
+ attr_reader :create_target_site
1548
+ ##
1549
+ # RPC-specific configuration for `batch_create_target_sites`
1550
+ # @return [::Gapic::Config::Method]
1551
+ #
1552
+ attr_reader :batch_create_target_sites
1553
+ ##
1554
+ # RPC-specific configuration for `get_target_site`
1555
+ # @return [::Gapic::Config::Method]
1556
+ #
1557
+ attr_reader :get_target_site
1558
+ ##
1559
+ # RPC-specific configuration for `update_target_site`
1560
+ # @return [::Gapic::Config::Method]
1561
+ #
1562
+ attr_reader :update_target_site
1563
+ ##
1564
+ # RPC-specific configuration for `delete_target_site`
1565
+ # @return [::Gapic::Config::Method]
1566
+ #
1567
+ attr_reader :delete_target_site
1568
+ ##
1569
+ # RPC-specific configuration for `list_target_sites`
1570
+ # @return [::Gapic::Config::Method]
1571
+ #
1572
+ attr_reader :list_target_sites
1573
+ ##
1574
+ # RPC-specific configuration for `enable_advanced_site_search`
1575
+ # @return [::Gapic::Config::Method]
1576
+ #
1577
+ attr_reader :enable_advanced_site_search
1578
+ ##
1579
+ # RPC-specific configuration for `disable_advanced_site_search`
1580
+ # @return [::Gapic::Config::Method]
1581
+ #
1582
+ attr_reader :disable_advanced_site_search
1583
+ ##
1584
+ # RPC-specific configuration for `recrawl_uris`
1585
+ # @return [::Gapic::Config::Method]
1586
+ #
1587
+ attr_reader :recrawl_uris
1588
+ ##
1589
+ # RPC-specific configuration for `batch_verify_target_sites`
1590
+ # @return [::Gapic::Config::Method]
1591
+ #
1592
+ attr_reader :batch_verify_target_sites
1593
+ ##
1594
+ # RPC-specific configuration for `fetch_domain_verification_status`
1595
+ # @return [::Gapic::Config::Method]
1596
+ #
1597
+ attr_reader :fetch_domain_verification_status
1598
+
1599
+ # @private
1600
+ def initialize parent_rpcs = nil
1601
+ get_site_search_engine_config = parent_rpcs.get_site_search_engine if parent_rpcs.respond_to? :get_site_search_engine
1602
+ @get_site_search_engine = ::Gapic::Config::Method.new get_site_search_engine_config
1603
+ create_target_site_config = parent_rpcs.create_target_site if parent_rpcs.respond_to? :create_target_site
1604
+ @create_target_site = ::Gapic::Config::Method.new create_target_site_config
1605
+ batch_create_target_sites_config = parent_rpcs.batch_create_target_sites if parent_rpcs.respond_to? :batch_create_target_sites
1606
+ @batch_create_target_sites = ::Gapic::Config::Method.new batch_create_target_sites_config
1607
+ get_target_site_config = parent_rpcs.get_target_site if parent_rpcs.respond_to? :get_target_site
1608
+ @get_target_site = ::Gapic::Config::Method.new get_target_site_config
1609
+ update_target_site_config = parent_rpcs.update_target_site if parent_rpcs.respond_to? :update_target_site
1610
+ @update_target_site = ::Gapic::Config::Method.new update_target_site_config
1611
+ delete_target_site_config = parent_rpcs.delete_target_site if parent_rpcs.respond_to? :delete_target_site
1612
+ @delete_target_site = ::Gapic::Config::Method.new delete_target_site_config
1613
+ list_target_sites_config = parent_rpcs.list_target_sites if parent_rpcs.respond_to? :list_target_sites
1614
+ @list_target_sites = ::Gapic::Config::Method.new list_target_sites_config
1615
+ enable_advanced_site_search_config = parent_rpcs.enable_advanced_site_search if parent_rpcs.respond_to? :enable_advanced_site_search
1616
+ @enable_advanced_site_search = ::Gapic::Config::Method.new enable_advanced_site_search_config
1617
+ disable_advanced_site_search_config = parent_rpcs.disable_advanced_site_search if parent_rpcs.respond_to? :disable_advanced_site_search
1618
+ @disable_advanced_site_search = ::Gapic::Config::Method.new disable_advanced_site_search_config
1619
+ recrawl_uris_config = parent_rpcs.recrawl_uris if parent_rpcs.respond_to? :recrawl_uris
1620
+ @recrawl_uris = ::Gapic::Config::Method.new recrawl_uris_config
1621
+ batch_verify_target_sites_config = parent_rpcs.batch_verify_target_sites if parent_rpcs.respond_to? :batch_verify_target_sites
1622
+ @batch_verify_target_sites = ::Gapic::Config::Method.new batch_verify_target_sites_config
1623
+ fetch_domain_verification_status_config = parent_rpcs.fetch_domain_verification_status if parent_rpcs.respond_to? :fetch_domain_verification_status
1624
+ @fetch_domain_verification_status = ::Gapic::Config::Method.new fetch_domain_verification_status_config
1625
+
1626
+ yield self if block_given?
1627
+ end
1628
+ end
1629
+ end
1630
+ end
1631
+ end
1632
+ end
1633
+ end
1634
+ end
1635
+ end