google-cloud-discovery_engine-v1 0.4.2 → 0.5.0

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