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