google-cloud-discovery_engine-v1 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +4 -4
  4. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb +803 -0
  5. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb +47 -0
  6. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb +813 -0
  7. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb +135 -0
  8. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb +749 -0
  9. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb +1148 -0
  10. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb +341 -0
  11. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb +53 -0
  12. data/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb +56 -0
  13. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +8 -0
  14. data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +53 -0
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +11 -1
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +104 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +11 -1
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +8 -0
  19. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +8 -0
  20. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +8 -0
  21. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb +1160 -0
  22. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb +47 -0
  23. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb +813 -0
  24. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb +154 -0
  25. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb +1085 -0
  26. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb +1148 -0
  27. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb +511 -0
  28. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb +53 -0
  29. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb +56 -0
  30. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +8 -0
  31. data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -1
  32. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +8 -0
  33. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +8 -0
  34. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +8 -0
  35. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +8 -0
  36. data/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb +630 -0
  37. data/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb +47 -0
  38. data/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb +813 -0
  39. data/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb +71 -0
  40. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb +590 -0
  41. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb +1148 -0
  42. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb +204 -0
  43. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb +53 -0
  44. data/lib/google/cloud/discovery_engine/v1/user_license_service.rb +56 -0
  45. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  46. data/lib/google/cloud/discovery_engine/v1.rb +5 -2
  47. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +1 -1
  48. data/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +4 -1
  49. data/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb +61 -0
  50. data/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb +55 -0
  51. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +3 -1
  52. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  53. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +4 -1
  54. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +5 -1
  56. data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +1 -1
  57. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +7 -1
  58. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +1 -1
  59. data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +1 -1
  60. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb +48 -0
  61. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_pb.rb +68 -0
  62. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb +58 -0
  63. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +1 -1
  64. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
  65. data/lib/google/cloud/discoveryengine/v1/user_license_pb.rb +48 -0
  66. data/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb +61 -0
  67. data/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb +48 -0
  68. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +17 -0
  69. data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +54 -0
  70. data/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb +222 -0
  71. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +55 -0
  72. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +1 -3
  73. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +3 -0
  74. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +43 -1
  75. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +12 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +99 -4
  77. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +23 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +141 -5
  79. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +8 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +9 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb +81 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb +279 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +6 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +6 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/user_license.rb +85 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb +153 -0
  87. metadata +42 -2
@@ -0,0 +1,1160 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/identity_mapping_store_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1
27
+ module IdentityMappingStoreService
28
+ ##
29
+ # Client for the IdentityMappingStoreService service.
30
+ #
31
+ # Service for managing Identity Mapping Stores.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :identity_mapping_store_service_stub
44
+
45
+ ##
46
+ # Configure the IdentityMappingStoreService Client class.
47
+ #
48
+ # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all IdentityMappingStoreService clients
54
+ # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the IdentityMappingStoreService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @identity_mapping_store_service_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new IdentityMappingStoreService client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the IdentityMappingStoreService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @operations_client = Operations.new do |config|
154
+ config.credentials = credentials
155
+ config.quota_project = @quota_project_id
156
+ config.endpoint = @config.endpoint
157
+ config.universe_domain = @config.universe_domain
158
+ end
159
+
160
+ @identity_mapping_store_service_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ channel_args: @config.channel_args,
167
+ interceptors: @config.interceptors,
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
170
+ )
171
+
172
+ @identity_mapping_store_service_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+
182
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
183
+ config.credentials = credentials
184
+ config.quota_project = @quota_project_id
185
+ config.endpoint = @identity_mapping_store_service_stub.endpoint
186
+ config.universe_domain = @identity_mapping_store_service_stub.universe_domain
187
+ config.logger = @identity_mapping_store_service_stub.logger if config.respond_to? :logger=
188
+ end
189
+ end
190
+
191
+ ##
192
+ # Get the associated client for long-running operations.
193
+ #
194
+ # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations]
195
+ #
196
+ attr_reader :operations_client
197
+
198
+ ##
199
+ # Get the associated client for mix-in of the Locations.
200
+ #
201
+ # @return [Google::Cloud::Location::Locations::Client]
202
+ #
203
+ attr_reader :location_client
204
+
205
+ ##
206
+ # The logger used for request/response debug logging.
207
+ #
208
+ # @return [Logger]
209
+ #
210
+ def logger
211
+ @identity_mapping_store_service_stub.logger
212
+ end
213
+
214
+ # Service calls
215
+
216
+ ##
217
+ # Creates a new Identity Mapping Store.
218
+ #
219
+ # @overload create_identity_mapping_store(request, options = nil)
220
+ # Pass arguments to `create_identity_mapping_store` via a request object, either of type
221
+ # {::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
228
+ #
229
+ # @overload create_identity_mapping_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, identity_mapping_store_id: nil, identity_mapping_store: nil)
230
+ # Pass arguments to `create_identity_mapping_store` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param cmek_config_name [::String]
235
+ # Resource name of the CmekConfig to use for protecting this Identity
236
+ # Mapping Store.
237
+ #
238
+ # Note: The following fields are mutually exclusive: `cmek_config_name`, `disable_cmek`. If a field in that set is populated, all other fields in the set will automatically be cleared.
239
+ # @param disable_cmek [::Boolean]
240
+ # Identity Mapping Store without CMEK protections. If a default CmekConfig
241
+ # is set for the project, setting this field will override the default
242
+ # CmekConfig as well.
243
+ #
244
+ # Note: The following fields are mutually exclusive: `disable_cmek`, `cmek_config_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.
245
+ # @param parent [::String]
246
+ # Required. The parent collection resource name, such as
247
+ # `projects/{project}/locations/{location}`.
248
+ # @param identity_mapping_store_id [::String]
249
+ # Required. The ID of the Identity Mapping Store to create.
250
+ #
251
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
252
+ # (_), and hyphens (-). The maximum length is 63 characters.
253
+ # @param identity_mapping_store [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore, ::Hash]
254
+ # Required. The Identity Mapping Store to create.
255
+ #
256
+ # @yield [response, operation] Access the result along with the RPC operation
257
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
258
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
259
+ #
260
+ # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
261
+ #
262
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
263
+ #
264
+ # @example Basic example
265
+ # require "google/cloud/discovery_engine/v1"
266
+ #
267
+ # # Create a client object. The client can be reused for multiple calls.
268
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
269
+ #
270
+ # # Create a request. To set request fields, pass in keyword arguments.
271
+ # request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new
272
+ #
273
+ # # Call the create_identity_mapping_store method.
274
+ # result = client.create_identity_mapping_store request
275
+ #
276
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.
277
+ # p result
278
+ #
279
+ def create_identity_mapping_store request, options = nil
280
+ raise ::ArgumentError, "request must be provided" if request.nil?
281
+
282
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest
283
+
284
+ # Converts hash and nil to an options object
285
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
286
+
287
+ # Customize the options with defaults
288
+ metadata = @config.rpcs.create_identity_mapping_store.metadata.to_h
289
+
290
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
291
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
293
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
294
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
295
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
+
297
+ header_params = {}
298
+ if request.parent
299
+ header_params["parent"] = request.parent
300
+ end
301
+
302
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
303
+ metadata[:"x-goog-request-params"] ||= request_params_header
304
+
305
+ options.apply_defaults timeout: @config.rpcs.create_identity_mapping_store.timeout,
306
+ metadata: metadata,
307
+ retry_policy: @config.rpcs.create_identity_mapping_store.retry_policy
308
+
309
+ options.apply_defaults timeout: @config.timeout,
310
+ metadata: @config.metadata,
311
+ retry_policy: @config.retry_policy
312
+
313
+ @identity_mapping_store_service_stub.call_rpc :create_identity_mapping_store, request, options: options do |response, operation|
314
+ yield response, operation if block_given?
315
+ end
316
+ rescue ::GRPC::BadStatus => e
317
+ raise ::Google::Cloud::Error.from_error(e)
318
+ end
319
+
320
+ ##
321
+ # Gets the Identity Mapping Store.
322
+ #
323
+ # @overload get_identity_mapping_store(request, options = nil)
324
+ # Pass arguments to `get_identity_mapping_store` via a request object, either of type
325
+ # {::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest} or an equivalent Hash.
326
+ #
327
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Hash]
328
+ # A request object representing the call parameters. Required. To specify no
329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
330
+ # @param options [::Gapic::CallOptions, ::Hash]
331
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
332
+ #
333
+ # @overload get_identity_mapping_store(name: nil)
334
+ # Pass arguments to `get_identity_mapping_store` via keyword arguments. Note that at
335
+ # least one keyword argument is required. To specify no parameters, or to keep all
336
+ # the default parameter values, pass an empty Hash as a request object (see above).
337
+ #
338
+ # @param name [::String]
339
+ # Required. The name of the Identity Mapping Store to get.
340
+ # Format:
341
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
342
+ #
343
+ # @yield [response, operation] Access the result along with the RPC operation
344
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
345
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
346
+ #
347
+ # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
348
+ #
349
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
350
+ #
351
+ # @example Basic example
352
+ # require "google/cloud/discovery_engine/v1"
353
+ #
354
+ # # Create a client object. The client can be reused for multiple calls.
355
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
356
+ #
357
+ # # Create a request. To set request fields, pass in keyword arguments.
358
+ # request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new
359
+ #
360
+ # # Call the get_identity_mapping_store method.
361
+ # result = client.get_identity_mapping_store request
362
+ #
363
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.
364
+ # p result
365
+ #
366
+ def get_identity_mapping_store request, options = nil
367
+ raise ::ArgumentError, "request must be provided" if request.nil?
368
+
369
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest
370
+
371
+ # Converts hash and nil to an options object
372
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
373
+
374
+ # Customize the options with defaults
375
+ metadata = @config.rpcs.get_identity_mapping_store.metadata.to_h
376
+
377
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
378
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
379
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
380
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
381
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
382
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
+
384
+ header_params = {}
385
+ if request.name
386
+ header_params["name"] = request.name
387
+ end
388
+
389
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
390
+ metadata[:"x-goog-request-params"] ||= request_params_header
391
+
392
+ options.apply_defaults timeout: @config.rpcs.get_identity_mapping_store.timeout,
393
+ metadata: metadata,
394
+ retry_policy: @config.rpcs.get_identity_mapping_store.retry_policy
395
+
396
+ options.apply_defaults timeout: @config.timeout,
397
+ metadata: @config.metadata,
398
+ retry_policy: @config.retry_policy
399
+
400
+ @identity_mapping_store_service_stub.call_rpc :get_identity_mapping_store, request, options: options do |response, operation|
401
+ yield response, operation if block_given?
402
+ end
403
+ rescue ::GRPC::BadStatus => e
404
+ raise ::Google::Cloud::Error.from_error(e)
405
+ end
406
+
407
+ ##
408
+ # Deletes the Identity Mapping Store.
409
+ #
410
+ # @overload delete_identity_mapping_store(request, options = nil)
411
+ # Pass arguments to `delete_identity_mapping_store` via a request object, either of type
412
+ # {::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest} or an equivalent Hash.
413
+ #
414
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Hash]
415
+ # A request object representing the call parameters. Required. To specify no
416
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
417
+ # @param options [::Gapic::CallOptions, ::Hash]
418
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
419
+ #
420
+ # @overload delete_identity_mapping_store(name: nil)
421
+ # Pass arguments to `delete_identity_mapping_store` via keyword arguments. Note that at
422
+ # least one keyword argument is required. To specify no parameters, or to keep all
423
+ # the default parameter values, pass an empty Hash as a request object (see above).
424
+ #
425
+ # @param name [::String]
426
+ # Required. The name of the Identity Mapping Store to delete.
427
+ # Format:
428
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
429
+ #
430
+ # @yield [response, operation] Access the result along with the RPC operation
431
+ # @yieldparam response [::Gapic::Operation]
432
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
433
+ #
434
+ # @return [::Gapic::Operation]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
437
+ #
438
+ # @example Basic example
439
+ # require "google/cloud/discovery_engine/v1"
440
+ #
441
+ # # Create a client object. The client can be reused for multiple calls.
442
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
443
+ #
444
+ # # Create a request. To set request fields, pass in keyword arguments.
445
+ # request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new
446
+ #
447
+ # # Call the delete_identity_mapping_store method.
448
+ # result = client.delete_identity_mapping_store request
449
+ #
450
+ # # The returned object is of type Gapic::Operation. You can use it to
451
+ # # check the status of an operation, cancel it, or wait for results.
452
+ # # Here is how to wait for a response.
453
+ # result.wait_until_done! timeout: 60
454
+ # if result.response?
455
+ # p result.response
456
+ # else
457
+ # puts "No response received."
458
+ # end
459
+ #
460
+ def delete_identity_mapping_store request, options = nil
461
+ raise ::ArgumentError, "request must be provided" if request.nil?
462
+
463
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest
464
+
465
+ # Converts hash and nil to an options object
466
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
467
+
468
+ # Customize the options with defaults
469
+ metadata = @config.rpcs.delete_identity_mapping_store.metadata.to_h
470
+
471
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
472
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
473
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
474
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
475
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
476
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
477
+
478
+ header_params = {}
479
+ if request.name
480
+ header_params["name"] = request.name
481
+ end
482
+
483
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
484
+ metadata[:"x-goog-request-params"] ||= request_params_header
485
+
486
+ options.apply_defaults timeout: @config.rpcs.delete_identity_mapping_store.timeout,
487
+ metadata: metadata,
488
+ retry_policy: @config.rpcs.delete_identity_mapping_store.retry_policy
489
+
490
+ options.apply_defaults timeout: @config.timeout,
491
+ metadata: @config.metadata,
492
+ retry_policy: @config.retry_policy
493
+
494
+ @identity_mapping_store_service_stub.call_rpc :delete_identity_mapping_store, request, options: options do |response, operation|
495
+ response = ::Gapic::Operation.new response, @operations_client, options: options
496
+ yield response, operation if block_given?
497
+ throw :response, response
498
+ end
499
+ rescue ::GRPC::BadStatus => e
500
+ raise ::Google::Cloud::Error.from_error(e)
501
+ end
502
+
503
+ ##
504
+ # Imports a list of Identity Mapping Entries to an Identity Mapping Store.
505
+ #
506
+ # @overload import_identity_mappings(request, options = nil)
507
+ # Pass arguments to `import_identity_mappings` via a request object, either of type
508
+ # {::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest} or an equivalent Hash.
509
+ #
510
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Hash]
511
+ # A request object representing the call parameters. Required. To specify no
512
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
513
+ # @param options [::Gapic::CallOptions, ::Hash]
514
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
515
+ #
516
+ # @overload import_identity_mappings(inline_source: nil, identity_mapping_store: nil)
517
+ # Pass arguments to `import_identity_mappings` via keyword arguments. Note that at
518
+ # least one keyword argument is required. To specify no parameters, or to keep all
519
+ # the default parameter values, pass an empty Hash as a request object (see above).
520
+ #
521
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource, ::Hash]
522
+ # The inline source to import identity mapping entries from.
523
+ # @param identity_mapping_store [::String]
524
+ # Required. The name of the Identity Mapping Store to import Identity Mapping
525
+ # Entries to. Format:
526
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
527
+ #
528
+ # @yield [response, operation] Access the result along with the RPC operation
529
+ # @yieldparam response [::Gapic::Operation]
530
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
531
+ #
532
+ # @return [::Gapic::Operation]
533
+ #
534
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
535
+ #
536
+ # @example Basic example
537
+ # require "google/cloud/discovery_engine/v1"
538
+ #
539
+ # # Create a client object. The client can be reused for multiple calls.
540
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
541
+ #
542
+ # # Create a request. To set request fields, pass in keyword arguments.
543
+ # request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new
544
+ #
545
+ # # Call the import_identity_mappings method.
546
+ # result = client.import_identity_mappings request
547
+ #
548
+ # # The returned object is of type Gapic::Operation. You can use it to
549
+ # # check the status of an operation, cancel it, or wait for results.
550
+ # # Here is how to wait for a response.
551
+ # result.wait_until_done! timeout: 60
552
+ # if result.response?
553
+ # p result.response
554
+ # else
555
+ # puts "No response received."
556
+ # end
557
+ #
558
+ def import_identity_mappings request, options = nil
559
+ raise ::ArgumentError, "request must be provided" if request.nil?
560
+
561
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest
562
+
563
+ # Converts hash and nil to an options object
564
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
565
+
566
+ # Customize the options with defaults
567
+ metadata = @config.rpcs.import_identity_mappings.metadata.to_h
568
+
569
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
570
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
571
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
572
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
573
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
574
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
575
+
576
+ header_params = {}
577
+ if request.identity_mapping_store
578
+ header_params["identity_mapping_store"] = request.identity_mapping_store
579
+ end
580
+
581
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
582
+ metadata[:"x-goog-request-params"] ||= request_params_header
583
+
584
+ options.apply_defaults timeout: @config.rpcs.import_identity_mappings.timeout,
585
+ metadata: metadata,
586
+ retry_policy: @config.rpcs.import_identity_mappings.retry_policy
587
+
588
+ options.apply_defaults timeout: @config.timeout,
589
+ metadata: @config.metadata,
590
+ retry_policy: @config.retry_policy
591
+
592
+ @identity_mapping_store_service_stub.call_rpc :import_identity_mappings, request, options: options do |response, operation|
593
+ response = ::Gapic::Operation.new response, @operations_client, options: options
594
+ yield response, operation if block_given?
595
+ throw :response, response
596
+ end
597
+ rescue ::GRPC::BadStatus => e
598
+ raise ::Google::Cloud::Error.from_error(e)
599
+ end
600
+
601
+ ##
602
+ # Purges specified or all Identity Mapping Entries from an Identity Mapping
603
+ # Store.
604
+ #
605
+ # @overload purge_identity_mappings(request, options = nil)
606
+ # Pass arguments to `purge_identity_mappings` via a request object, either of type
607
+ # {::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest} or an equivalent Hash.
608
+ #
609
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Hash]
610
+ # A request object representing the call parameters. Required. To specify no
611
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
612
+ # @param options [::Gapic::CallOptions, ::Hash]
613
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
614
+ #
615
+ # @overload purge_identity_mappings(inline_source: nil, identity_mapping_store: nil, filter: nil, force: nil)
616
+ # Pass arguments to `purge_identity_mappings` via keyword arguments. Note that at
617
+ # least one keyword argument is required. To specify no parameters, or to keep all
618
+ # the default parameter values, pass an empty Hash as a request object (see above).
619
+ #
620
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource, ::Hash]
621
+ # The inline source to purge identity mapping entries from.
622
+ # @param identity_mapping_store [::String]
623
+ # Required. The name of the Identity Mapping Store to purge Identity Mapping
624
+ # Entries from. Format:
625
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
626
+ # @param filter [::String]
627
+ # Filter matching identity mappings to purge.
628
+ # The eligible field for filtering is:
629
+ # * `update_time`: in ISO 8601 "zulu" format.
630
+ # * `external_id`
631
+ #
632
+ # Examples:
633
+ #
634
+ # * Deleting all identity mappings updated in a time range:
635
+ # `update_time > "2012-04-23T18:25:43.511Z" AND update_time <
636
+ # "2012-04-23T18:30:43.511Z"`
637
+ # * Deleting all identity mappings for a given external_id:
638
+ # `external_id = "id1"`
639
+ # * Deleting all identity mappings inside an identity mapping store:
640
+ # `*`
641
+ #
642
+ # The filtering fields are assumed to have an implicit AND.
643
+ # Should not be used with source. An error will be thrown, if both are
644
+ # provided.
645
+ # @param force [::Boolean]
646
+ # Actually performs the purge. If `force` is set to false, return the
647
+ # expected purge count without deleting any identity mappings. This field is
648
+ # only supported for purge with filter. For input source this field is
649
+ # ignored and data will be purged regardless of the value of this field.
650
+ #
651
+ # @yield [response, operation] Access the result along with the RPC operation
652
+ # @yieldparam response [::Gapic::Operation]
653
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
654
+ #
655
+ # @return [::Gapic::Operation]
656
+ #
657
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
658
+ #
659
+ # @example Basic example
660
+ # require "google/cloud/discovery_engine/v1"
661
+ #
662
+ # # Create a client object. The client can be reused for multiple calls.
663
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
664
+ #
665
+ # # Create a request. To set request fields, pass in keyword arguments.
666
+ # request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new
667
+ #
668
+ # # Call the purge_identity_mappings method.
669
+ # result = client.purge_identity_mappings request
670
+ #
671
+ # # The returned object is of type Gapic::Operation. You can use it to
672
+ # # check the status of an operation, cancel it, or wait for results.
673
+ # # Here is how to wait for a response.
674
+ # result.wait_until_done! timeout: 60
675
+ # if result.response?
676
+ # p result.response
677
+ # else
678
+ # puts "No response received."
679
+ # end
680
+ #
681
+ def purge_identity_mappings request, options = nil
682
+ raise ::ArgumentError, "request must be provided" if request.nil?
683
+
684
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest
685
+
686
+ # Converts hash and nil to an options object
687
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
688
+
689
+ # Customize the options with defaults
690
+ metadata = @config.rpcs.purge_identity_mappings.metadata.to_h
691
+
692
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
693
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
694
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
695
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
696
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
697
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
698
+
699
+ header_params = {}
700
+ if request.identity_mapping_store
701
+ header_params["identity_mapping_store"] = request.identity_mapping_store
702
+ end
703
+
704
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
705
+ metadata[:"x-goog-request-params"] ||= request_params_header
706
+
707
+ options.apply_defaults timeout: @config.rpcs.purge_identity_mappings.timeout,
708
+ metadata: metadata,
709
+ retry_policy: @config.rpcs.purge_identity_mappings.retry_policy
710
+
711
+ options.apply_defaults timeout: @config.timeout,
712
+ metadata: @config.metadata,
713
+ retry_policy: @config.retry_policy
714
+
715
+ @identity_mapping_store_service_stub.call_rpc :purge_identity_mappings, request, options: options do |response, operation|
716
+ response = ::Gapic::Operation.new response, @operations_client, options: options
717
+ yield response, operation if block_given?
718
+ throw :response, response
719
+ end
720
+ rescue ::GRPC::BadStatus => e
721
+ raise ::Google::Cloud::Error.from_error(e)
722
+ end
723
+
724
+ ##
725
+ # Lists Identity Mappings in an Identity Mapping Store.
726
+ #
727
+ # @overload list_identity_mappings(request, options = nil)
728
+ # Pass arguments to `list_identity_mappings` via a request object, either of type
729
+ # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest} or an equivalent Hash.
730
+ #
731
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Hash]
732
+ # A request object representing the call parameters. Required. To specify no
733
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
734
+ # @param options [::Gapic::CallOptions, ::Hash]
735
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
736
+ #
737
+ # @overload list_identity_mappings(identity_mapping_store: nil, page_size: nil, page_token: nil)
738
+ # Pass arguments to `list_identity_mappings` via keyword arguments. Note that at
739
+ # least one keyword argument is required. To specify no parameters, or to keep all
740
+ # the default parameter values, pass an empty Hash as a request object (see above).
741
+ #
742
+ # @param identity_mapping_store [::String]
743
+ # Required. The name of the Identity Mapping Store to list Identity Mapping
744
+ # Entries in. Format:
745
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
746
+ # @param page_size [::Integer]
747
+ # Maximum number of IdentityMappings to return. If unspecified, defaults
748
+ # to 2000. The maximum allowed value is 10000. Values above 10000 will be
749
+ # coerced to 10000.
750
+ # @param page_token [::String]
751
+ # A page token, received from a previous `ListIdentityMappings` call.
752
+ # Provide this to retrieve the subsequent page.
753
+ #
754
+ # When paginating, all other parameters provided to
755
+ # `ListIdentityMappings` must match the call that provided the page
756
+ # token.
757
+ #
758
+ # @yield [response, operation] Access the result along with the RPC operation
759
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>]
760
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
761
+ #
762
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>]
763
+ #
764
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
765
+ #
766
+ # @example Basic example
767
+ # require "google/cloud/discovery_engine/v1"
768
+ #
769
+ # # Create a client object. The client can be reused for multiple calls.
770
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
771
+ #
772
+ # # Create a request. To set request fields, pass in keyword arguments.
773
+ # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new
774
+ #
775
+ # # Call the list_identity_mappings method.
776
+ # result = client.list_identity_mappings request
777
+ #
778
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
779
+ # # over elements, and API calls will be issued to fetch pages as needed.
780
+ # result.each do |item|
781
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry.
782
+ # p item
783
+ # end
784
+ #
785
+ def list_identity_mappings request, options = nil
786
+ raise ::ArgumentError, "request must be provided" if request.nil?
787
+
788
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest
789
+
790
+ # Converts hash and nil to an options object
791
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
792
+
793
+ # Customize the options with defaults
794
+ metadata = @config.rpcs.list_identity_mappings.metadata.to_h
795
+
796
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
797
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
798
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
799
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
800
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
801
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
802
+
803
+ header_params = {}
804
+ if request.identity_mapping_store
805
+ header_params["identity_mapping_store"] = request.identity_mapping_store
806
+ end
807
+
808
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
809
+ metadata[:"x-goog-request-params"] ||= request_params_header
810
+
811
+ options.apply_defaults timeout: @config.rpcs.list_identity_mappings.timeout,
812
+ metadata: metadata,
813
+ retry_policy: @config.rpcs.list_identity_mappings.retry_policy
814
+
815
+ options.apply_defaults timeout: @config.timeout,
816
+ metadata: @config.metadata,
817
+ retry_policy: @config.retry_policy
818
+
819
+ @identity_mapping_store_service_stub.call_rpc :list_identity_mappings, request, options: options do |response, operation|
820
+ response = ::Gapic::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mappings, request, response, operation, options
821
+ yield response, operation if block_given?
822
+ throw :response, response
823
+ end
824
+ rescue ::GRPC::BadStatus => e
825
+ raise ::Google::Cloud::Error.from_error(e)
826
+ end
827
+
828
+ ##
829
+ # Lists all Identity Mapping Stores.
830
+ #
831
+ # @overload list_identity_mapping_stores(request, options = nil)
832
+ # Pass arguments to `list_identity_mapping_stores` via a request object, either of type
833
+ # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest} or an equivalent Hash.
834
+ #
835
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Hash]
836
+ # A request object representing the call parameters. Required. To specify no
837
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
838
+ # @param options [::Gapic::CallOptions, ::Hash]
839
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
840
+ #
841
+ # @overload list_identity_mapping_stores(parent: nil, page_size: nil, page_token: nil)
842
+ # Pass arguments to `list_identity_mapping_stores` via keyword arguments. Note that at
843
+ # least one keyword argument is required. To specify no parameters, or to keep all
844
+ # the default parameter values, pass an empty Hash as a request object (see above).
845
+ #
846
+ # @param parent [::String]
847
+ # Required. The parent of the Identity Mapping Stores to list.
848
+ # Format:
849
+ # `projects/{project}/locations/{location}`.
850
+ # @param page_size [::Integer]
851
+ # Maximum number of IdentityMappingStores to return. If unspecified, defaults
852
+ # to 100. The maximum allowed value is 1000. Values above 1000 will be
853
+ # coerced to 1000.
854
+ # @param page_token [::String]
855
+ # A page token, received from a previous `ListIdentityMappingStores` call.
856
+ # Provide this to retrieve the subsequent page.
857
+ #
858
+ # When paginating, all other parameters provided to
859
+ # `ListIdentityMappingStores` must match the call that provided the page
860
+ # token.
861
+ #
862
+ # @yield [response, operation] Access the result along with the RPC operation
863
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>]
864
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
865
+ #
866
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>]
867
+ #
868
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
869
+ #
870
+ # @example Basic example
871
+ # require "google/cloud/discovery_engine/v1"
872
+ #
873
+ # # Create a client object. The client can be reused for multiple calls.
874
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new
875
+ #
876
+ # # Create a request. To set request fields, pass in keyword arguments.
877
+ # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new
878
+ #
879
+ # # Call the list_identity_mapping_stores method.
880
+ # result = client.list_identity_mapping_stores request
881
+ #
882
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
883
+ # # over elements, and API calls will be issued to fetch pages as needed.
884
+ # result.each do |item|
885
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.
886
+ # p item
887
+ # end
888
+ #
889
+ def list_identity_mapping_stores request, options = nil
890
+ raise ::ArgumentError, "request must be provided" if request.nil?
891
+
892
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest
893
+
894
+ # Converts hash and nil to an options object
895
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
896
+
897
+ # Customize the options with defaults
898
+ metadata = @config.rpcs.list_identity_mapping_stores.metadata.to_h
899
+
900
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
901
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
902
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
903
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
904
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
905
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
906
+
907
+ header_params = {}
908
+ if request.parent
909
+ header_params["parent"] = request.parent
910
+ end
911
+
912
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
913
+ metadata[:"x-goog-request-params"] ||= request_params_header
914
+
915
+ options.apply_defaults timeout: @config.rpcs.list_identity_mapping_stores.timeout,
916
+ metadata: metadata,
917
+ retry_policy: @config.rpcs.list_identity_mapping_stores.retry_policy
918
+
919
+ options.apply_defaults timeout: @config.timeout,
920
+ metadata: @config.metadata,
921
+ retry_policy: @config.retry_policy
922
+
923
+ @identity_mapping_store_service_stub.call_rpc :list_identity_mapping_stores, request, options: options do |response, operation|
924
+ response = ::Gapic::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mapping_stores, request, response, operation, options
925
+ yield response, operation if block_given?
926
+ throw :response, response
927
+ end
928
+ rescue ::GRPC::BadStatus => e
929
+ raise ::Google::Cloud::Error.from_error(e)
930
+ end
931
+
932
+ ##
933
+ # Configuration class for the IdentityMappingStoreService API.
934
+ #
935
+ # This class represents the configuration for IdentityMappingStoreService,
936
+ # providing control over timeouts, retry behavior, logging, transport
937
+ # parameters, and other low-level controls. Certain parameters can also be
938
+ # applied individually to specific RPCs. See
939
+ # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration::Rpcs}
940
+ # for a list of RPCs that can be configured independently.
941
+ #
942
+ # Configuration can be applied globally to all clients, or to a single client
943
+ # on construction.
944
+ #
945
+ # @example
946
+ #
947
+ # # Modify the global config, setting the timeout for
948
+ # # create_identity_mapping_store to 20 seconds,
949
+ # # and all remaining timeouts to 10 seconds.
950
+ # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.configure do |config|
951
+ # config.timeout = 10.0
952
+ # config.rpcs.create_identity_mapping_store.timeout = 20.0
953
+ # end
954
+ #
955
+ # # Apply the above configuration only to a new client.
956
+ # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config|
957
+ # config.timeout = 10.0
958
+ # config.rpcs.create_identity_mapping_store.timeout = 20.0
959
+ # end
960
+ #
961
+ # @!attribute [rw] endpoint
962
+ # A custom service endpoint, as a hostname or hostname:port. The default is
963
+ # nil, indicating to use the default endpoint in the current universe domain.
964
+ # @return [::String,nil]
965
+ # @!attribute [rw] credentials
966
+ # Credentials to send with calls. You may provide any of the following types:
967
+ # * (`String`) The path to a service account key file in JSON format
968
+ # * (`Hash`) A service account key as a Hash
969
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
970
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
971
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
972
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
973
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
974
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
975
+ # * (`nil`) indicating no credentials
976
+ #
977
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
978
+ # external source for authentication to Google Cloud, you must validate it before
979
+ # providing it to a Google API client library. Providing an unvalidated credential
980
+ # configuration to Google APIs can compromise the security of your systems and data.
981
+ # For more information, refer to [Validate credential configurations from external
982
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
983
+ # @return [::Object]
984
+ # @!attribute [rw] scope
985
+ # The OAuth scopes
986
+ # @return [::Array<::String>]
987
+ # @!attribute [rw] lib_name
988
+ # The library name as recorded in instrumentation and logging
989
+ # @return [::String]
990
+ # @!attribute [rw] lib_version
991
+ # The library version as recorded in instrumentation and logging
992
+ # @return [::String]
993
+ # @!attribute [rw] channel_args
994
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
995
+ # `GRPC::Core::Channel` object is provided as the credential.
996
+ # @return [::Hash]
997
+ # @!attribute [rw] interceptors
998
+ # An array of interceptors that are run before calls are executed.
999
+ # @return [::Array<::GRPC::ClientInterceptor>]
1000
+ # @!attribute [rw] timeout
1001
+ # The call timeout in seconds.
1002
+ # @return [::Numeric]
1003
+ # @!attribute [rw] metadata
1004
+ # Additional gRPC headers to be sent with the call.
1005
+ # @return [::Hash{::Symbol=>::String}]
1006
+ # @!attribute [rw] retry_policy
1007
+ # The retry policy. The value is a hash with the following keys:
1008
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1009
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1010
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1011
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1012
+ # trigger a retry.
1013
+ # @return [::Hash]
1014
+ # @!attribute [rw] quota_project
1015
+ # A separate project against which to charge quota.
1016
+ # @return [::String]
1017
+ # @!attribute [rw] universe_domain
1018
+ # The universe domain within which to make requests. This determines the
1019
+ # default endpoint URL. The default value of nil uses the environment
1020
+ # universe (usually the default "googleapis.com" universe).
1021
+ # @return [::String,nil]
1022
+ # @!attribute [rw] logger
1023
+ # A custom logger to use for request/response debug logging, or the value
1024
+ # `:default` (the default) to construct a default logger, or `nil` to
1025
+ # explicitly disable logging.
1026
+ # @return [::Logger,:default,nil]
1027
+ #
1028
+ class Configuration
1029
+ extend ::Gapic::Config
1030
+
1031
+ # @private
1032
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1033
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
1034
+
1035
+ config_attr :endpoint, nil, ::String, nil
1036
+ config_attr :credentials, nil do |value|
1037
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1038
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1039
+ allowed.any? { |klass| klass === value }
1040
+ end
1041
+ config_attr :scope, nil, ::String, ::Array, nil
1042
+ config_attr :lib_name, nil, ::String, nil
1043
+ config_attr :lib_version, nil, ::String, nil
1044
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1045
+ config_attr :interceptors, nil, ::Array, nil
1046
+ config_attr :timeout, nil, ::Numeric, nil
1047
+ config_attr :metadata, nil, ::Hash, nil
1048
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1049
+ config_attr :quota_project, nil, ::String, nil
1050
+ config_attr :universe_domain, nil, ::String, nil
1051
+ config_attr :logger, :default, ::Logger, nil, :default
1052
+
1053
+ # @private
1054
+ def initialize parent_config = nil
1055
+ @parent_config = parent_config unless parent_config.nil?
1056
+
1057
+ yield self if block_given?
1058
+ end
1059
+
1060
+ ##
1061
+ # Configurations for individual RPCs
1062
+ # @return [Rpcs]
1063
+ #
1064
+ def rpcs
1065
+ @rpcs ||= begin
1066
+ parent_rpcs = nil
1067
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1068
+ Rpcs.new parent_rpcs
1069
+ end
1070
+ end
1071
+
1072
+ ##
1073
+ # Configuration for the channel pool
1074
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1075
+ #
1076
+ def channel_pool
1077
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1078
+ end
1079
+
1080
+ ##
1081
+ # Configuration RPC class for the IdentityMappingStoreService API.
1082
+ #
1083
+ # Includes fields providing the configuration for each RPC in this service.
1084
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1085
+ # the following configuration fields:
1086
+ #
1087
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1088
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1089
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1090
+ # include the following keys:
1091
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1092
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1093
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1094
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1095
+ # trigger a retry.
1096
+ #
1097
+ class Rpcs
1098
+ ##
1099
+ # RPC-specific configuration for `create_identity_mapping_store`
1100
+ # @return [::Gapic::Config::Method]
1101
+ #
1102
+ attr_reader :create_identity_mapping_store
1103
+ ##
1104
+ # RPC-specific configuration for `get_identity_mapping_store`
1105
+ # @return [::Gapic::Config::Method]
1106
+ #
1107
+ attr_reader :get_identity_mapping_store
1108
+ ##
1109
+ # RPC-specific configuration for `delete_identity_mapping_store`
1110
+ # @return [::Gapic::Config::Method]
1111
+ #
1112
+ attr_reader :delete_identity_mapping_store
1113
+ ##
1114
+ # RPC-specific configuration for `import_identity_mappings`
1115
+ # @return [::Gapic::Config::Method]
1116
+ #
1117
+ attr_reader :import_identity_mappings
1118
+ ##
1119
+ # RPC-specific configuration for `purge_identity_mappings`
1120
+ # @return [::Gapic::Config::Method]
1121
+ #
1122
+ attr_reader :purge_identity_mappings
1123
+ ##
1124
+ # RPC-specific configuration for `list_identity_mappings`
1125
+ # @return [::Gapic::Config::Method]
1126
+ #
1127
+ attr_reader :list_identity_mappings
1128
+ ##
1129
+ # RPC-specific configuration for `list_identity_mapping_stores`
1130
+ # @return [::Gapic::Config::Method]
1131
+ #
1132
+ attr_reader :list_identity_mapping_stores
1133
+
1134
+ # @private
1135
+ def initialize parent_rpcs = nil
1136
+ create_identity_mapping_store_config = parent_rpcs.create_identity_mapping_store if parent_rpcs.respond_to? :create_identity_mapping_store
1137
+ @create_identity_mapping_store = ::Gapic::Config::Method.new create_identity_mapping_store_config
1138
+ get_identity_mapping_store_config = parent_rpcs.get_identity_mapping_store if parent_rpcs.respond_to? :get_identity_mapping_store
1139
+ @get_identity_mapping_store = ::Gapic::Config::Method.new get_identity_mapping_store_config
1140
+ delete_identity_mapping_store_config = parent_rpcs.delete_identity_mapping_store if parent_rpcs.respond_to? :delete_identity_mapping_store
1141
+ @delete_identity_mapping_store = ::Gapic::Config::Method.new delete_identity_mapping_store_config
1142
+ import_identity_mappings_config = parent_rpcs.import_identity_mappings if parent_rpcs.respond_to? :import_identity_mappings
1143
+ @import_identity_mappings = ::Gapic::Config::Method.new import_identity_mappings_config
1144
+ purge_identity_mappings_config = parent_rpcs.purge_identity_mappings if parent_rpcs.respond_to? :purge_identity_mappings
1145
+ @purge_identity_mappings = ::Gapic::Config::Method.new purge_identity_mappings_config
1146
+ list_identity_mappings_config = parent_rpcs.list_identity_mappings if parent_rpcs.respond_to? :list_identity_mappings
1147
+ @list_identity_mappings = ::Gapic::Config::Method.new list_identity_mappings_config
1148
+ list_identity_mapping_stores_config = parent_rpcs.list_identity_mapping_stores if parent_rpcs.respond_to? :list_identity_mapping_stores
1149
+ @list_identity_mapping_stores = ::Gapic::Config::Method.new list_identity_mapping_stores_config
1150
+
1151
+ yield self if block_given?
1152
+ end
1153
+ end
1154
+ end
1155
+ end
1156
+ end
1157
+ end
1158
+ end
1159
+ end
1160
+ end